Is there a way to package scripts in a container to run for diagnostic purposes against kubernetes?

3/10/2020

The idea is instead of installing these scripts they can instead be applied via yaml perhaps and ran with access to kubectl and host tools to find potential issues with the running environment.

I figure the pod would need special elevated permissions, etc. I'm not quite sure if there is an example or even a better way of accomplishing the same idea.

Is there a way to package scripts in a container to run for diagnostic purposes against kubernetes?

-- lucidquiet
kubectl
kubernetes

1 Answer

3/10/2020

It's an Alpha feature and not recommended for production use, but check out the ephemeral containers system: https://kubernetes.io/docs/concepts/workloads/pods/ephemeral-containers/

It's designed for exactly this, having a bundle of debugging tools that you can connect in to an existing file/pid namespace. However the feature is still incomplete as it is being added incrementally.

-- coderanger
Source: StackOverflow