pod

[!NOTE|label:pod phase]

VALUE
DESCRIPTION

Pending

The Pod has been accepted by the Kubernetes cluster, but one or more of the containers has not been set up and made ready to run

Running

The Pod has been bound to a node, and all of the containers have been created

Succeeded

All containers in the Pod have terminated in success, and will not be restarted.

Failed

All containers in the Pod have terminated, and at least one container has terminated in failure

Unknown

For some reason the state of the Pod could not be obtained

list all Failed pods

filter via Node Name

  • filter all pods running in particular node

  • filter all pods running in particular node via --template

list pod details for failure pods

sorting pods by nodeName

sort pods by restartCount

sort by restart count

sort via start time

get the oldest pod

-1: means the last in the list

sort via created time

run & create

pod

deploy

svc

list

watch pods with timestamp

[!NOTE|label:references:]

list pod status with timestamp

[!NOTE|label:references:]

  • via evnets

  • via pod json

list pod with nodename

[!NOTE|label:references]

list and delete all error status pods

list running images

list running pods

  • specific nodes

  • all nodes

    • via label filter

    • via API

list all containers

[!NOTE|label:references:]

  • list container names

  • list container image by pod

get port enabled in pod

get the first deploy name in namespace

get all deploy names

item.metadata.name

  • list via jsonpath={.items..metadata.name}

    • or

output

-o name

--template

  • or

custom-columns

  • Name:.metadata.name

  • NODE:.spec.nodeName

  • IPS:status.podIPs

  • PHASE:.status.phase

  • RESTARTS:RESTART:.status.containerStatuses[0].restartCount

  • IMAGE:.spec.containers[0].image

  • CREATED:.metadata.creationTimestamp

  • LABELS:.metadata.labels

  • QOS-CLASS:.status.qosClass

list all images running in particular namespace

  • list all images exclude 'k8s.gcr.io/coredns:1.6.2'

list via -o custom-columns=":metadata.name"

QOS

management

execute in pod

restart po

reference:

  • result

    • or

resource managemenet

troubleshooting

[!NOTE|label:references:]

debug svc

[!NOTE|labels:referencds:]

Last updated

Was this helpful?