3 ms·
once in awhile i use 'kubectl exec ' to run some commands against my running prod containers to debug something or extract an environment variable. can i still
by 8n4vidtmkvmk 4y ago
once in awhile i use 'kubectl exec ' to run some commands against my running prod containers to debug something or extract an environment variable. can i still do that without a shell or anything?
- cmckn 4y agoYou can’t, no. One approach is a “debug sidecar” container in the Pod that has your desired tools. Linkerd, for example, will add such a container if an annotation is present on the Pod: https://linkerd.io/2.11/tasks/using-the-debug-container/ https://linkerd.io/2.11/tasks/using-the-debug-container/ I usually just include a shell, but to each their own.
- dmart 4y agok8s has first-class support for ephemeral debug containers that share process namespaces for this purpose. Pretty cool feature imo. https://kubernetes.io/docs/tasks/debug/debug-application/debug-running-pod/#ephemeral-container https://kubernetes.io/docs/tasks/debug/debug-application/deb...
- hdjrudni 4y agoThat sounds sweet! But I guess DigitalOcean doesn't support it? I'm getting "error: ephemeral containers are disabled for this cluster (error from server: "the server could not find the requested resource")."