Get the list of Pods in the specified cluster and namespace..
OK
상태 정보
네임스페이스 이름
"cocktail-system"
노드 이름
"apps-gpu-v100"
파드 이름
"cocktail-api-cmdb-0"
파드 상태
"Running"
재시작 파드 수
0
시작 시각
"2023-05-01 09:20:09"
const response = await fetch('/v1/clusters/{clusterId}/namespaces/{namespaceName}/pods', {
method: 'GET',
headers: {},
});
const data = await response.json();
[
{
"conditions": [
{
"lastTransitionTime": "22023-05-01 09:20:19",
"status": "True",
"type": "Initialized"
}
],
"detail": {
"annotations": {
"cni.projectcalico.org/containerID": "2869a9d6ccd7a53fc8fdccda05168581a99115ffacd7beb834d816e2ab2ee6e7",
"cni.projectcalico.org/podIP": "0.0.0.0/0",
"cni.projectcalico.org/podIPs": "0.0.0.0/0"
},
"containers": [
{
"args": [
"mysqld",
"--general-log=1",
"--general-log-file=/var/log/mysql/mysql.log",
"--slow-query-log=1",
"--slow-query-log-file=/var/log/mysql/mysql-slow.log"
],
"containerID": "containerd://6b87d5769493be45af8a48e97f5bab7ae7cfe8cc4e39d7d2b15ebda3a79da2eb",
"environmentVariables": {
"MYSQL_PASSWORD_FILE": "/temp-secret/COCKTAIL_DB_PASSWORD",
"MYSQL_ROOT_PASSWORD_FILE": "/temp-secret/DB_ROOT_PASSWORD",
"MYSQL_USER": "{\"key\":\"COCKTAIL_DB_USER\",\"name\":\"cocktail-api-cmdb\"}"
},
"image": "101.55.69.30/library/api-cmdb:4.7.4-release.20230413",
"imageID": "101.55.69.30/library/api-cmdb@sha256:30eea53896de7b26d9f9e8e6903d3706ddbe77ceda5b2bb6807f1da10e231c63",
"imagePullPolicy": "Always",
"lastState": "{}",
"name": "api-cmdb",
"ready": true,
"resources": {
"cpu": {
"limit": "1",
"request": "500m"
},
"memory": {
"limit": "2Gi",
"request": "1Gi"
}
},
"restartCount": 0,
"startTime": "2023-05-01 09:20:19",
"state": "{\"running\":{\"startedAt\":\"2023-05-01T09:20:19.000000Z\"}}",
"volumeMounts": {
"config": "{\"mountPath\":\"/usr/sbin/ping.sh\",\"name\":\"config\",\"subPath\":\"ping.sh\"}",
"kube-api-access-cts42": "{\"mountPath\":\"/var/run/secrets/kubernetes.io/serviceaccount\",\"name\":\"kube-api-access-cts42\",\"readOnly\":true}",
"log": "{\"mountPath\":\"/var/log/mysql\",\"name\":\"log\",\"subPath\":\"api-cmdb\"}",
"log-rotate": "{\"mountPath\":\"/etc/cron.d/mysql-server-crond\",\"name\":\"log-rotate\",\"subPath\":\"mysql-server-crond\"}",
"mysqldata": "{\"mountPath\":\"/var/lib/mysql/\",\"name\":\"mysqldata\",\"subPath\":\"data\"}",
"temp-secret": "{\"mountPath\":\"/temp-secret\",\"name\":\"temp-secret\"}"
}
}
],
"creationTimestamp": "2023-05-01 09:20:09",
"hostname": "cocktail-api-cmdb-0",
"initContainers": [
{
"commands": [
"/usr/sbin/init_api_cmdb.sh"
],
"containerID": "containerd://9e5d154acc5e85e9db8b829266afe37c2c36a3e0b707187f0905e98769eab07f",
"image": "101.55.69.30/library/api-cmdb:4.7.4-release.20230413",
"imageID": "101.55.69.30/library/api-cmdb@sha256:30eea53896de7b26d9f9e8e6903d3706ddbe77ceda5b2bb6807f1da10e231c63",
"imagePullPolicy": "Always",
"lastState": "{}",
"name": "init",
"ready": true,
"resources": {
"cpu": {
"limit": "20m",
"request": "20m"
},
"memory": {
"limit": "50Mi",
"request": "50Mi"
}
},
"restartCount": 0,
"startTime": "2023-05-01 09:20:16",
"state": "{\"terminated\":{\"containerID\":\"containerd://9e5d154acc5e85e9db8b829266afe37c2c36a3e0b707187f0905e98769eab07f\",\"exitCode\":0,\"finishedAt\":\"2023-05-01T09:20:18.000000Z\",\"reason\":\"Completed\",\"startedAt\":\"2023-05-01T09:20:16.000000Z\"}}",
"volumeMounts": {
"cocktail-secret": "{\"mountPath\":\"/cocktail-secret\",\"name\":\"cocktail-secret\"}",
"init": "{\"mountPath\":\"/usr/sbin\",\"name\":\"init\"}",
"kube-api-access-cts42": "{\"mountPath\":\"/var/run/secrets/kubernetes.io/serviceaccount\",\"name\":\"kube-api-access-cts42\",\"readOnly\":true}",
"log": "{\"mountPath\":\"/var/log/mysql\",\"name\":\"log\",\"subPath\":\"api-cmdb\"}",
"temp-secret": "{\"mountPath\":\"/temp-secret\",\"name\":\"temp-secret\"}"
}
}
],
"labels": {
"app": "api-cmdb",
"app.kubernetes.io/instance": "cocktail",
"app.kubernetes.io/managed-by": "Helm"
},
"namespace": "cocktail-system",
"nodeName": "apps-gpu-v100",
"ownerReferences": [
{
"apiVersion": "apps/v1",
"blockOwnerDeletion": true,
"controller": true,
"kind": "StatefulSet",
"name": "cocktail-api-cmdb",
"uid": "cd832df7-397a-4f17-9e38-0fc0f3f5baa0"
}
],
"podIP": "0.0.0.0",
"podName": "cocktail-api-cmdb-0",
"podStatus": "Running",
"qosClass": "Burstable",
"restartPolicy": "Always",
"serviceAccountName": "default",
"startTime": "2023-05-01 09:20:09",
"terminationGracePeriodSeconds": 60,
"tolerations": [
{
"effect": "NoExecute",
"key": "node.kubernetes.io/not-ready",
"operator": "Exists",
"tolerationSeconds": 30
}
]
},
"namespace": "cocktail-system",
"nodeName": "apps-gpu-v100",
"podName": "cocktail-api-cmdb-0",
"podStatus": "Running",
"restartCnt": 0,
"startTime": "2023-05-01 09:20:09"
}
]