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:
kubectl
: k8s command lineawscli
: AWS command linekrew
: plugins manager for kubectl (with default plugins already setup)yq
: same asjq
but for YAML file (ex:kubectl get endpoints mongodb-staging-svc -o yaml | yq
)k9s
: k8s dashboarding toolsfzf
: Fuzzy searchhelm
: k8s package managervelero
: velero command linedirenv
: in case you would like to customized your${HOME}
Bash completion:
Bash completion is available for:
- kubectl
- fzf
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