KubernetesでPodの詳細を確認する方法を紹介します。
以下のようにkubectlの「describe」コマンドを使用します。
1 |
kubectl describe pod ポッド名 |
試してみます。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
root@controlplane:~# kubectl describe pod nginx Name: nginx Namespace: default Priority: 0 Node: controlplane/10.14.241.6 Start Time: Sun, 06 Feb 2022 09:23:21 +0000 Labels: run=nginx Annotations: <none> Status: Running IP: 10.244.0.4 IPs: IP: 10.244.0.4 Containers: nginx: Container ID: docker://8175a05af577dd7342242988da4f336aa7dd189484f5b2ca3f32f3b202d4a780 Image: nginx Image ID: docker-pullable://nginx@sha256:2834dc507516af02784808c5f48b7cbe38b8ed5d0f4837f16e78d00deb7e7767 Port: <none> Host Port: <none> State: Running Started: Sun, 06 Feb 2022 09:23:31 +0000 Ready: True Restart Count: 0 Environment: <none> Mounts: /var/run/secrets/kubernetes.io/serviceaccount from default-token-pp8wl (ro) Conditions: Type Status Initialized True Ready True ContainersReady True PodScheduled True Volumes: default-token-pp8wl: Type: Secret (a volume populated by a Secret) SecretName: default-token-pp8wl Optional: false QoS Class: BestEffort Node-Selectors: <none> Tolerations: node.kubernetes.io/not-ready:NoExecute op=Exists for 300s node.kubernetes.io/unreachable:NoExecute op=Exists for 300s Events: Type Reason Age From Message ---- ------ ---- ---- ------- Normal Scheduled 83s default-scheduler Successfully assigned default/nginx to controlplane Normal Pulling 82s kubelet Pulling image "nginx" Normal Pulled 74s kubelet Successfully pulled image "nginx" in 7.984240839s Normal Created 73s kubelet Created container nginx Normal Started 73s kubelet Started container nginx root@controlplane:~# |