查询Pod详细信息
更新时间:2020-01-03
接口描述
查询Pod的详细信息。 |
请求结构
GET /api/v1/{namespace}/pods/{name} HTTP/1.1
Host: bec.bdcloudapi.com
Content-Type: application/json; charset=utf-8
Authorization: authorization string
请求头域
除公共头域外,无其它特殊头域。
请求参数
表1 Path参数描述
参数 | 类型 | 参数位置 | 描述 | 是否必须 |
---|---|---|---|---|
name | String | URI参数 | Name of the Pod. | 必须 |
namespace | String | URI参数 | Object name and auth scope, such as for teams and projects. | 必须 |
表2 Query参数描述
参数 | 类型 | 描述 | 是否必须 |
---|---|---|---|
pretty | String | If 'true', then the output is pretty printed. | 非必须 |
exact | String | Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'. | 非必须 |
export | String | Should this value be exported. Export strips fields that a user cannot specify. | 非必须 |
响应头域
除公共头域外,无其它特殊头域。
响应参数
响应参数的详细描述请参见 数据结构 表
错误码
请参照前文的网关错误码和平台错误码。
请求示例
GET /api/v1/namespaces/test-namespace/pods/test-pod HTTP/1.1
Host: bec.bdcloudapi.com
Content-Type: application/json; charset=utf-8
Authorization: bce-auth-v1/318857a8f08b11e9845ca7e54775a0c2/2019-10-17T03:07:21Z/1800/host/212eef8cfe1ac94be56c4afedb9360bba621ef646c3c8288971d36801d70501a
响应示例
{
"apiVersion": "v1",
"kind": "Pod",
"metadata": {
"annotations": {
"cni": "calico",
"io.kubernetes.cri.untrusted-workload": "true",
"multi-ip-preferences": "{\n \"multi_entry\": 0,\n \"ips\": {\n \"\": {\n \"ip\": \"\",\n \"interface\": \"\"\n }\n }\n }\n"
},
"clusterName": null,
"creationTimestamp": 1575549352000,
"deletionGracePeriodSeconds": null,
"deletionTimestamp": null,
"finalizers": null,
"generateName": "sts-flidttua-1-t-",
"generation": null,
"initializers": null,
"labels": {
"app": "sts-flidttua-1-t",
"controller-revision-hash": "sts-flidttua-1-t-77bbbd5bdd",
"service": "s-flidttua",
"statefulset.kubernetes.io/pod-name": "sts-flidttua-1-t-0"
},
"name": "sts-flidttua-1-t-0",
"namespace": "bec-user-ns-rgzafffd",
"ownerReferences": [
{
"apiVersion": "apps/v1",
"blockOwnerDeletion": true,
"controller": true,
"kind": "StatefulSet",
"name": "sts-flidttua-1-t",
"uid": "c678c415-175b-11ea-8ca4-6c92bfc7c326"
}
],
"resourceVersion": "48626155",
"selfLink": "/api/v1/namespaces/bec-user-ns-rgzafffd/pods/sts-flidttua-1-t-0",
"uid": "c67ae5bb-175b-11ea-8ba8-6c92bfc7bdb6"
},
"spec": {
"activeDeadlineSeconds": null,
"affinity": null,
"automountServiceAccountToken": null,
"containers": [
{
"args": null,
"command": null,
"env": null,
"envFrom": null,
"image": "centos:centos7",
"imagePullPolicy": "IfNotPresent",
"lifecycle": null,
"livenessProbe": null,
"name": "container01",
"ports": null,
"readinessProbe": null,
"resources": {
"limits": {
"cpu": {
"number": 4,
"format": "DECIMAL_SI"
},
"memory": {
"number": 8589934592,
"format": "DECIMAL_SI"
}
},
"requests": {
"cpu": {
"number": 4,
"format": "DECIMAL_SI"
},
"memory": {
"number": 8589934592,
"format": "DECIMAL_SI"
}
}
},
"securityContext": null,
"stdin": null,
"stdinOnce": null,
"terminationMessagePath": "/dev/termination-log",
"terminationMessagePolicy": "File",
"tty": null,
"volumeDevices": null,
"volumeMounts": [
{
"mountPath": "/var/run/secrets/kubernetes.io/serviceaccount",
"mountPropagation": null,
"name": "default-token-k6tpx",
"readOnly": true,
"subPath": null
}
],
"workingDir": null
}
],
"dnsConfig": null,
"dnsPolicy": "ClusterFirst",
"enableServiceLinks": true,
"hostAliases": null,
"hostIPC": null,
"hostNetwork": null,
"hostPID": null,
"hostname": "sts-flidttua-1-t-0",
"imagePullSecrets": null,
"initContainers": null,
"nodeName": "121.227.168.8",
"nodeSelector": null,
"priority": 0,
"priorityClassName": null,
"readinessGates": null,
"restartPolicy": "Always",
"runtimeClassName": null,
"schedulerName": "default-scheduler",
"securityContext": {
"fsGroup": null,
"runAsGroup": null,
"runAsNonRoot": null,
"runAsUser": null,
"seLinuxOptions": null,
"supplementalGroups": null,
"sysctls": null
},
"serviceAccount": "default",
"serviceAccountName": "default",
"shareProcessNamespace": null,
"subdomain": "sts-flidttua-1-t",
"terminationGracePeriodSeconds": 10,
"tolerations": [
{
"effect": "NoExecute",
"key": "node.kubernetes.io/not-ready",
"operator": "Exists",
"tolerationSeconds": 300,
"value": null
},
{
"effect": "NoExecute",
"key": "node.kubernetes.io/unreachable",
"operator": "Exists",
"tolerationSeconds": 300,
"value": null
}
],
"volumes": [
{
"awsElasticBlockStore": null,
"azureDisk": null,
"azureFile": null,
"cephfs": null,
"cinder": null,
"configMap": null,
"downwardAPI": null,
"emptyDir": null,
"fc": null,
"flexVolume": null,
"flocker": null,
"gcePersistentDisk": null,
"gitRepo": null,
"glusterfs": null,
"hostPath": null,
"iscsi": null,
"name": "default-token-k6tpx",
"nfs": null,
"persistentVolumeClaim": null,
"photonPersistentDisk": null,
"portworxVolume": null,
"projected": null,
"quobyte": null,
"rbd": null,
"scaleIO": null,
"secret": {
"defaultMode": 420,
"items": null,
"optional": null,
"secretName": "default-token-k6tpx"
},
"storageos": null,
"vsphereVolume": null
}
]
},
"status": {
"conditions": [
{
"lastProbeTime": null,
"lastTransitionTime": 1575549353000,
"message": null,
"reason": null,
"status": "True",
"type": "Initialized"
},
{
"lastProbeTime": null,
"lastTransitionTime": 1575549375000,
"message": null,
"reason": null,
"status": "True",
"type": "Ready"
},
{
"lastProbeTime": null,
"lastTransitionTime": 1575549375000,
"message": null,
"reason": null,
"status": "True",
"type": "ContainersReady"
},
{
"lastProbeTime": null,
"lastTransitionTime": 1575549353000,
"message": null,
"reason": null,
"status": "True",
"type": "PodScheduled"
}
],
"containerStatuses": [
{
"containerID": "containerd://71405312ee08f4157bd3379021fd4d3cd461de1e2780c7b895f525647b8798ee",
"image": "docker.io/library/centos:centos7",
"imageID": "docker.io/library/centos@sha256:4a701376d03f6b39b8c2a8f4a8e499441b0d567f9ab9d58e4991de4472fb813c",
"lastState": {
"running": null,
"terminated": null,
"waiting": null
},
"name": "container01",
"ready": true,
"restartCount": 0,
"state": {
"running": {
"startedAt": 1575549374000
},
"terminated": null,
"waiting": null
}
}
],
"hostIP": "121.227.168.8",
"initContainerStatuses": null,
"message": null,
"nominatedNodeName": null,
"phase": "Running",
"podIP": "10.244.1.27",
"qosClass": "Guaranteed",
"reason": null,
"startTime": 1575549353000
}
}