kubectlkubectl is a CLI tool to control a cluster Kubernetes.
$ docker run --rm ctdc/kubectl:latest
The recommended way to get this Kubectl Docker Image is to pull the prebuilt image from the Docker Hub Registry.
$ docker pull ctdc/kubectl:latest
To use a specific version, you can pull a versioned tag. You can view the list of available versions in the Docker Hub Registry.
$ docker pull ctdc/kubectl:[TAG]
If you wish, you can also build the image yourself.
$ docker build -t ctdc/kubectl:latest 'https://github.com/bug-c/kubectl-docker.git#master'
To run commands inside this container you can use docker run, for example to execute kubectl --version you can follow the example below:
$ docker run --rm --name kubectl ctdc/kubectl:latest -- --version
Consult the Kubectl Reference Documentation to find the completed list of commands available.
It's possible to load your own configuration, which is useful if you want to connect to a remote cluster:
$ docker run --rm --name kubectl -v /path/to/your/kube/config:/.kube/config -e="KUBECONFIG=/.kube/config" ctdc/kubectl:latest
If you need to change kube config but you don't want the changes to persist:
$ docker run --rm --name kubectl --mount type=tmpfs,destination=/.kube -v /path/to/your/kube/config:/.kube/config -e="KUBECONFIG=/.kube/config" ctdc/kubectl:latest
Example of running a custom script:
$ docker run --rm --name kubectl -v /path/to/your/kube/config:/.kube/config -v /path/to/your/script:/src -w="/src" -e="KUBECONFIG=/.kube/config" --entrypoint="/src/deploy.sh" ctdc/kubectl $SCRIPT_ARGS
You can request new features by creating an issue, or submit a pull request with your contribution.
If you encountered a problem running this container, you can file an issue. To provide better support, be sure to include the following information in your issue:
docker version)docker infoThanks to https://github.com/BuoyantIO/kubectl
Thanks to https://github.com/roffe/docker-kubectl
Thanks to https://github.com/bitnami/bitnami-docker-kubectl
Content type
Image
Digest
Size
29.4 MB
Last updated
over 6 years ago
docker pull ctdc/kubectl