'Keep container up in the pod - kubenetes
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
Solution 1:[1]
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.
- Edit the yaml manifest and apply.
- Use
kubectl edit <deployment-name>on the deployment resource in your cluster. - Use
kubectl patchon 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
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |
