0

In Docker we can see the full command used to run a container using

docker ps --no-trunc

In case of containers inside pods in a Kubernetes cluster, how to find this same info?

I also tried to describe a pod using kubectl describe pods test-77f45b7bd7-hqvqh -n somenp but it doesn't show that information:

Containers:
  data-exploration:
    Container ID:   docker://XXXXXXXXXXXXXXXXXXXXXXXXXX
    Image:          docker_uri
    Image ID:       docker-pullable://docker_uri
    Port:           3002/TCP
    Host Port:      0/TCP
    State:          Running
      Started:      Fri, 22 Dec 2023 10:37:25 +0000
    Ready:          True
    Restart Count:  0
    Limits:
      cpu:     1
      memory:  5Gi
    Requests:
      cpu:     500m
      memory:  1Gi
    Environment:

1 Answer 1

0

Kubernetes by default runs the command specified in container image. You can override that command using command and args in pod spec (see doc).

So the only way to find the command is either to exec into the pod or inspect the container image.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.