Reputation: 83
One of the container in the pod is going down. To debug, i have to be able to login to the container which is going down.
In docker, we had an option to use below
docker run -d sleep infinity
But what about kubenetes? The container is one of the 3 containers in the POD. How can i bring it up and use sleep infinity or anything similar.
Thank you in advance
Upvotes: 0
Views: 309
Reputation: 20547
You can do the same. Make the command of the container sleep infinity and then exec into it.
You can do the same in serval ways.
kubectl edit <deployment-name>
on the deployment resource in your cluster.kubectl patch
on the deployment resource in your cluster.You can exec into the specifc container by using the --container
or short -c
flag.
kubectl exec <pod> --container <container> -ti -- sh
Upvotes: 1