Obfuscates

This is a Dockerfile that builds out a container with tools I would typically use when troubleshooting issues in an Kubernetes environment. It contains DNS, Ping, python, yq, jq, unzip, kubectl, helm, vault, and some other misc items to make life easier. I build this with GitLab runners and post it to a image repository.

This is the manifest I used to deploy a static pod to a cluster. I typically assign obvious ID’s to the containers and disallow privilege escalation. There are some situations where escalation is explicitly disallowed as well as running as the root ID (0). The combination of the command and args are what is executed when the pod is initiated. In this case, it just tails out /dev/null which results in the pod running until deleted manually.

I like to create a profile script that contains most the commands i like to use. I think copy that to the container during the build process. This way, I exec into the container I can source the profile script and I have my normal aliases in place. Below is the command you’ll use to exec into the aforementioned pod. No namespace is specified. I’ve assumed you are already in the namespace you want to deploy this container too. If not, make sure to either specify it when applying the manifest or add a namespace: <yourNameSpace> to the metadata: stanza.

That will present you with a command prompt. That’s when you source the profile and fire away.