EK Knowledge

Кубернетес

Справочник по k8s

Перечислить поды

Поды определённого пространства имён:

#> kubectl get pods -n my-namespace
NAME                                    READY   STATUS      RESTARTS   AGE
9h
scheduler-56798bd5bc-wjlhh              1/1     Running     0          9h
web-5cc8f955b6-qbjw4                    2/2     Running     0          5h5m
worker-77975dfb6b-7w7dp                 1/1     Running     0          9h
#>

Перечисление подов с выводом доп. информации:

#> kubectl get pods -n my-namespace -0 wide
NAME                                    READY   STATUS      RESTARTS   AGE    IP             NODE                      NOMINATED NODE   READINESS GATES
scheduler-56798bd5bc-wjlhh              1/1     Running     0          9h     10.108.0.215   web-scheduler-01-3oybmf   <none>           <none>
web-5cc8f955b6-qbjw4                    2/2     Running     0          5h9m   10.108.2.170   web-scheduler-01-3opdr4   <none>           <none>
worker-77975dfb6b-7w7dp                 1/1     Running     0          9h     10.108.4.104   worker-02-3opdtl          <none>           <none>
#>

Информация об определённом поде:

#> kubectl describe pod worker-77975dfb6b-7w7dp -n my-namespace
Name:             worker-77975dfb6b-7w7dp
Namespace:        my-namespace
Priority:         0
Service Account:  default
Node:             worker-02-3opdtl/10.114.0.23
Start Time:       Thu, 15 Oct 2026 15:13:28 +0200
Labels:           app=worker
                  pod-template-hash=77975dfb6b
Annotations:      kubectl.kubernetes.io/restartedAt: 2026-09-22T13:12:19+02:00
Status:           Running
IP:               10.108.4.104
IPs:
  IP:           10.108.4.104
Controlled By:  ReplicaSet/worker-77975dfb6b
Containers:
  worker:
    Container ID:   containerd://b887ba086f8996c6c8cf417bc9a68eadcaf593cde73f1f64edc6269c478185ac
    Image:          registry.digitalocean.com/hp-container-registry/hello-pine-worker@sha256:9d9f451b29c06c4ba037e078953df6f15c34b949286ecc8b0f49feeac3f18157
    Image ID:       registry.digitalocean.com/hp-container-registry/hello-pine-worker@sha256:9d9f451b29c06c4ba037e078953df6f15c34b949286ecc8b0f49feeac3f18157
    Port:           80/TCP
    Host Port:      0/TCP
    State:          Running
      Started:      Thu, 15 Oct 2026 15:13:39 +0200
    Ready:          True
    Restart Count:  0
    Limits:
      memory:  13Gi
    Requests:
      cpu:     1
      memory:  10Gi
    Liveness:  exec [test -e /tmp] delay=10s timeout=2s period=60s #success=1 #failure=3
    Environment Variables from:
      secret  Secret  Optional: false
    Environment:
      SKIP_SCHEDULER:  true
      APP_TYPE:        worker
      LOG_LEVEL:       info
    Mounts:
      /var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-nhps5 (ro)
Conditions:
  Type                        Status
  PodReadyToStartContainers   True 
  Initialized                 True 
  Ready                       True 
  ContainersReady             True 
  PodScheduled                True 
Volumes:
  kube-api-access-nhps5:
    Type:                    Projected (a volume that contains injected data from multiple sources)
    TokenExpirationSeconds:  3607
    ConfigMapName:           kube-root-ca.crt
    Optional:                false
    DownwardAPI:             true
QoS Class:                   Burstable
Node-Selectors:              type=worker
Tolerations:                 dedicated=highmem:NoSchedule
                             node.kubernetes.io/not-ready:NoExecute op=Exists for 300s
                             node.kubernetes.io/unreachable:NoExecute op=Exists for 300s
Events:                      <none>
#>