Sign inSign up

neutralize/kubectl

By neutralize

•Updated over 2 years ago

Kubernetes command-line tool.

Image
Integration & delivery
Developer tools
1

179

neutralize/kubectl repository overview

⁠Overview

This repository provides a Docker image based on Ubuntu 20.04 that installs kubectl, the Kubernetes command-line tool. The image is designed to be lightweight and includes only the necessary components to run kubectl. This can be particularly useful for CI/CD pipelines, administrative tasks, or any situation where you need to interact with a Kubernetes cluster from within a containerized environment.

⁠Features

  • Base Image: Ubuntu 20.04
  • Installed Software: curl and kubectl
  • Automatic Download of Latest kubectl: The image fetches the latest stable version of kubectl at build time.
  • Configurable KUBECONFIG: Environment variable KUBECONFIG is set to ./config, allowing for flexible configuration management.

⁠Usage

⁠Pulling the Image

To pull the image from the repository, use the following command:

docker pull neutralize/kubectl:latest
⁠Running the Container

To run the container and check the kubectl version, use:

docker run --rm neutralize/kubectl:latest
⁠Configuring Kubernetes Access

You can mount your Kubernetes configuration file into the container to use kubectl with your cluster:

docker run --rm -v /path/to/your/kubeconfig:/config neutralize/kubectl:latest

Replace /path/to/your/kubeconfig with the path to your Kubernetes configuration file.

⁠Example Commands

List all Kubernetes nodes:

docker run --rm -v /path/to/your/kubeconfig:/config neutralize/kubectl:latest get nodes

Apply a Kubernetes configuration:

docker run --rm -v /path/to/your/kubeconfig:/config -v /path/to/your/k8s-config:/k8s-config neutralize/kubectl:latest apply -f /k8s-config

⁠Building the Image

If you want to build the image locally, clone this repository and run:

docker build -t neutralize/kubectl:latest .

⁠Environment Variables

  • KUBECONFIG: Path to the Kubernetes configuration file (default is ./config).

Tag summary

Content type

Image

Digest

sha256:1e33ae613…

Size

113.2 MB

Last updated

over 2 years ago

docker pull neutralize/kubectl