Home

Awesome

Kubectl in a docker

The prupose of this tool is to have a subset of commands totally portable to operate a k8s cluster. This is heavily inspired by the kubectl-container

What does it include

The default container image includes the follwing tools:

Bash completion:

Bash completion is available for:

Bash PS1

To have a better visibility when handling you k8s cluster kube_ps1 is also used for your prompt.

How to build it

Use your favorite docker image builder (in the example buildah)

 buildah bud --format docker -t docker.io/localregistry/kubectl-container:$(date "+%Y%m%d") Dockerfile

How to use it

Just use your favorite container orchestrator (in the example podman)

podman run --rm --name kubectl$(basename $(tty)) --tty=true --interactive --volume ~/.aws:/root/.aws --volume ~/.kube:/root/.kube docker.io/localregistry/kubectl-container:20220913