查询Pod详细信息
更新时间:2025-08-05
接口描述
查询Pod的详细信息。 |
请求结构
Plain Text
1GET /api/v1/{namespace}/pods/{name} HTTP/1.1
2Host: bec.bdcloudapi.com
3Content-Type: application/json; charset=utf-8
4Authorization: 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. | 非必须 |
响应头域
除公共头域外,无其它特殊头域。
响应参数
响应参数的详细描述请参见 数据结构 表
错误码
请参照前文的网关错误码和平台错误码。
请求示例
Plain Text
1GET /api/v1/namespaces/test-namespace/pods/test-pod HTTP/1.1
2Host: bec.bdcloudapi.com
3Content-Type: application/json; charset=utf-8
4Authorization: bce-auth-v1/318857a8f08b11e9845ca7e54775a0c2/2019-10-17T03:07:21Z/1800/host/212eef8cfe1ac94be56c4afedb9360bba621ef646c3c8288971d36801d70501a
响应示例
Plain Text
1{
2 "apiVersion": "v1",
3 "kind": "Pod",
4 "metadata": {
5 "annotations": {
6 "cni": "calico",
7 "io.kubernetes.cri.untrusted-workload": "true",
8 "multi-ip-preferences": "{\n \"multi_entry\": 0,\n \"ips\": {\n \"\": {\n \"ip\": \"\",\n \"interface\": \"\"\n }\n }\n }\n"
9 },
10 "clusterName": null,
11 "creationTimestamp": 1575549352000,
12 "deletionGracePeriodSeconds": null,
13 "deletionTimestamp": null,
14 "finalizers": null,
15 "generateName": "sts-flidttua-1-t-",
16 "generation": null,
17 "initializers": null,
18 "labels": {
19 "app": "sts-flidttua-1-t",
20 "controller-revision-hash": "sts-flidttua-1-t-77bbbd5bdd",
21 "service": "s-flidttua",
22 "statefulset.kubernetes.io/pod-name": "sts-flidttua-1-t-0"
23 },
24 "name": "sts-flidttua-1-t-0",
25 "namespace": "bec-user-ns-rgzafffd",
26 "ownerReferences": [
27 {
28 "apiVersion": "apps/v1",
29 "blockOwnerDeletion": true,
30 "controller": true,
31 "kind": "StatefulSet",
32 "name": "sts-flidttua-1-t",
33 "uid": "c678c415-175b-11ea-8ca4-6c92bfc7c326"
34 }
35 ],
36 "resourceVersion": "48626155",
37 "selfLink": "/api/v1/namespaces/bec-user-ns-rgzafffd/pods/sts-flidttua-1-t-0",
38 "uid": "c67ae5bb-175b-11ea-8ba8-6c92bfc7bdb6"
39 },
40 "spec": {
41 "activeDeadlineSeconds": null,
42 "affinity": null,
43 "automountServiceAccountToken": null,
44 "containers": [
45 {
46 "args": null,
47 "command": null,
48 "env": null,
49 "envFrom": null,
50 "image": "centos:centos7",
51 "imagePullPolicy": "IfNotPresent",
52 "lifecycle": null,
53 "livenessProbe": null,
54 "name": "container01",
55 "ports": null,
56 "readinessProbe": null,
57 "resources": {
58 "limits": {
59 "cpu": {
60 "number": 4,
61 "format": "DECIMAL_SI"
62 },
63 "memory": {
64 "number": 8589934592,
65 "format": "DECIMAL_SI"
66 }
67 },
68 "requests": {
69 "cpu": {
70 "number": 4,
71 "format": "DECIMAL_SI"
72 },
73 "memory": {
74 "number": 8589934592,
75 "format": "DECIMAL_SI"
76 }
77 }
78 },
79 "securityContext": null,
80 "stdin": null,
81 "stdinOnce": null,
82 "terminationMessagePath": "/dev/termination-log",
83 "terminationMessagePolicy": "File",
84 "tty": null,
85 "volumeDevices": null,
86 "volumeMounts": [
87 {
88 "mountPath": "/var/run/secrets/kubernetes.io/serviceaccount",
89 "mountPropagation": null,
90 "name": "default-token-k6tpx",
91 "readOnly": true,
92 "subPath": null
93 }
94 ],
95 "workingDir": null
96 }
97 ],
98 "dnsConfig": null,
99 "dnsPolicy": "ClusterFirst",
100 "enableServiceLinks": true,
101 "hostAliases": null,
102 "hostIPC": null,
103 "hostNetwork": null,
104 "hostPID": null,
105 "hostname": "sts-flidttua-1-t-0",
106 "imagePullSecrets": null,
107 "initContainers": null,
108 "nodeName": "121.227.168.8",
109 "nodeSelector": null,
110 "priority": 0,
111 "priorityClassName": null,
112 "readinessGates": null,
113 "restartPolicy": "Always",
114 "runtimeClassName": null,
115 "schedulerName": "default-scheduler",
116 "securityContext": {
117 "fsGroup": null,
118 "runAsGroup": null,
119 "runAsNonRoot": null,
120 "runAsUser": null,
121 "seLinuxOptions": null,
122 "supplementalGroups": null,
123 "sysctls": null
124 },
125 "serviceAccount": "default",
126 "serviceAccountName": "default",
127 "shareProcessNamespace": null,
128 "subdomain": "sts-flidttua-1-t",
129 "terminationGracePeriodSeconds": 10,
130 "tolerations": [
131 {
132 "effect": "NoExecute",
133 "key": "node.kubernetes.io/not-ready",
134 "operator": "Exists",
135 "tolerationSeconds": 300,
136 "value": null
137 },
138 {
139 "effect": "NoExecute",
140 "key": "node.kubernetes.io/unreachable",
141 "operator": "Exists",
142 "tolerationSeconds": 300,
143 "value": null
144 }
145 ],
146 "volumes": [
147 {
148 "awsElasticBlockStore": null,
149 "azureDisk": null,
150 "azureFile": null,
151 "cephfs": null,
152 "cinder": null,
153 "configMap": null,
154 "downwardAPI": null,
155 "emptyDir": null,
156 "fc": null,
157 "flexVolume": null,
158 "flocker": null,
159 "gcePersistentDisk": null,
160 "gitRepo": null,
161 "glusterfs": null,
162 "hostPath": null,
163 "iscsi": null,
164 "name": "default-token-k6tpx",
165 "nfs": null,
166 "persistentVolumeClaim": null,
167 "photonPersistentDisk": null,
168 "portworxVolume": null,
169 "projected": null,
170 "quobyte": null,
171 "rbd": null,
172 "scaleIO": null,
173 "secret": {
174 "defaultMode": 420,
175 "items": null,
176 "optional": null,
177 "secretName": "default-token-k6tpx"
178 },
179 "storageos": null,
180 "vsphereVolume": null
181 }
182 ]
183 },
184 "status": {
185 "conditions": [
186 {
187 "lastProbeTime": null,
188 "lastTransitionTime": 1575549353000,
189 "message": null,
190 "reason": null,
191 "status": "True",
192 "type": "Initialized"
193 },
194 {
195 "lastProbeTime": null,
196 "lastTransitionTime": 1575549375000,
197 "message": null,
198 "reason": null,
199 "status": "True",
200 "type": "Ready"
201 },
202 {
203 "lastProbeTime": null,
204 "lastTransitionTime": 1575549375000,
205 "message": null,
206 "reason": null,
207 "status": "True",
208 "type": "ContainersReady"
209 },
210 {
211 "lastProbeTime": null,
212 "lastTransitionTime": 1575549353000,
213 "message": null,
214 "reason": null,
215 "status": "True",
216 "type": "PodScheduled"
217 }
218 ],
219 "containerStatuses": [
220 {
221 "containerID": "containerd://71405312ee08f4157bd3379021fd4d3cd461de1e2780c7b895f525647b8798ee",
222 "image": "docker.io/library/centos:centos7",
223 "imageID": "docker.io/library/centos@sha256:4a701376d03f6b39b8c2a8f4a8e499441b0d567f9ab9d58e4991de4472fb813c",
224 "lastState": {
225 "running": null,
226 "terminated": null,
227 "waiting": null
228 },
229 "name": "container01",
230 "ready": true,
231 "restartCount": 0,
232 "state": {
233 "running": {
234 "startedAt": 1575549374000
235 },
236 "terminated": null,
237 "waiting": null
238 }
239 }
240 ],
241 "hostIP": "121.227.168.8",
242 "initContainerStatuses": null,
243 "message": null,
244 "nominatedNodeName": null,
245 "phase": "Running",
246 "podIP": "10.244.1.27",
247 "qosClass": "Guaranteed",
248 "reason": null,
249 "startTime": 1575549353000
250 }
251}
