The purpose of this tool is to have a fully portable kubectl
command line tool with a few convinience utilities.
Quick testing of a cluster with well-known/customized kubectl
setup.
There are two images, one for bash shell and one for zsh.
kubectl
v 1.17.2, bash/zsh completionzsh-autosuggestions
for zsh shellk9s
cluster monitoring tool- popular tools:
curl, wget, git
- useful .bashrc/.zshrc aliases
After running docker container, all the clusters running on the localhost should be available for kubectl
command.
-
zsh docker pull piotrzan/kubectl-comp:zsh Dockerfile
-
bash docker pull piotrzan/kubectl-comp Dockerfile
docker build --rm -f "Dockerfile" -t piotrzan/kubectl-comp "."
docker build --rm -f "Dockerfile" -t piotrzan/kubectl-comp:zsh "."
Use run.ps1
or run.sh
for windows or linux respectivels.
Alternatively use docker-compose.yaml, this works by mounting a volume on the $HOME/.kube folder on the host.
Another option is running make
(defaults to content of run script). Make
can be run from root directory and will run images depending on the tasks. Linux has make
installed by default, for Windows please install first Make for Windows.
ZSH container will be ran by default.
Run contianer with passthrough to local network
docker run -d --network=host --name=kubectl-host --rm -it piotrzan/kubectl-comp
Generate raw config from kubeclt on localhost and copy the config to the container
kubeclt config view --raw > config docker cp ./config kubectl-host:./root/.kube
Attach back to the contianer with kubeconfig file containing info about clusters running on localhost
docker attach kubectl-host
If you would like to add your own customization, you can easily do it and use docker commit
to create your own version of the image.