Zalando Kubectl
Description
Kubernetes CLI (kubectl) wrapper in Python with OAuth token authentication.
This wrapper script zkubectl serves as a drop-in replacement for the
kubectl binary:
- it downloads the current
kubectlbinary from Google - it generates a new
~/.kube/configwith an OAuth Bearer token acquired via zign. - it passes through commands to the
kubectlbinary
User Facing documentation
- https://cloud.docs.zalando.net/reference/zkubectl/
- https://cloud.docs.zalando.net/howtos/install-tools/
Contribute
Setup project
- It's recommended to use uv for the project.
Go to the project dir and install dependencies with uv
$ cd <project-path>
$ uv sync
- [Optional] install pre-commit hooks
$ pre-commit install
- [Optional] The project uses ruff for code formatting, configure your editor to use it.
Unit Tests
Run unit tests with Docker:
docker build --build-arg PYTHON_VERSION=3.10 --build-arg PACKAGE_NAME=zalando_kubectl -f Dockerfile.test .
docker build --build-arg PYTHON_VERSION=3.11 --build-arg PACKAGE_NAME=zalando_kubectl -f Dockerfile.test .
docker build --build-arg PYTHON_VERSION=3.12 --build-arg PACKAGE_NAME=zalando_kubectl --build-arg DEBIAN_DISTRO=bullseye -f Dockerfile.test .
docker build --build-arg PYTHON_VERSION=3.13 --build-arg PACKAGE_NAME=zalando_kubectl --build-arg DEBIAN_DISTRO=bullseye -f Dockerfile.test .
Run Locally
via uv
$ uv run zkubectl
Or first activate the virtualenv
$ source .venv/bin/activate
$ zkubectl login playground
Use as kubectl plugin
The project exposes scripts that use the kubectl plugin format
You can see which ones are available in the scripts section of pyproject.toml
In order for kubectl to detect the subcommands provided by the script, they must be in the PATH, so you need first to activate the virtualenv
$ source .venv/bin/activate
$ kubectl login playground
Release files for zalando-kubectl 1.36.3.426
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| zalando_kubectl-1.36.3.426.tar.gz | 50.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| zalando_kubectl-1.36.3.426-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 102.0 kB
Release files / zalando_kubectl-1.36.3.426.tar.gz
| Download URL | zalando_kubectl-1.36.3.426.tar.gz |
|---|---|
| Size | 50.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1e7dbe47e08b9f2a1bfc4ef2058c683f0f6eb4e2fa8b7e3487e97f115a20c7e5
|
|
BLAKE2b-256 checksum How to use checksums |
9affd34c9eb7530cd68ce304193ff251d4e15fab2bd0f613237d8c0881080cd0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.33 {"installer":{"name":"uv","version":"0.11.33","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / zalando_kubectl-1.36.3.426-py3-none-any.whl
| Download URL | zalando_kubectl-1.36.3.426-py3-none-any.whl |
|---|---|
| Size | 51.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9915ac76a1730c6062ccef210710a806164db8b8a36d1ca516be2f639120764d
|
|
BLAKE2b-256 checksum How to use checksums |
3e4ce626e0b4169216a7de661265cbd2961aee646ce0f8a8d36f7459a8dc08c4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.33 {"installer":{"name":"uv","version":"0.11.33","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|