Kubernetes / kubectl – “A container name must be specified” but seems like it is?

If a pod has more than 1 containers then you need to provide the name of the specific container.

in your case, There is a pod (postgres-operator-49202276-bjtf4) which has 2 containers (apiserver and postgres-operator ).
following commands will provide logs for the specific containers

kubectl logs deployment/postgres-operator -c apiserver


kubectl logs deployment/postgres-operator -c postgres-operator

Leave a Comment

tech