Tuesday, March 26, 2019

How to view kubernetes container/pod logs in an istio installed k8s cluster

Error

$ kubectl logs -f <pod name>

Error from server (BadRequest): a container name must be specified for pod <pod name>, choose one of: [<pod name> istio-proxy] or one of the init containers: [istio-init]

Solution

$ kubectl logs -f <pod name> -c <container name>


*** Most of the time container name is same as the pod name without hash value.

1 comment: