credctl is a simple command line application designed to exemplify how to build custom Kubernetes clients in Python.
It manages Kubernetes secrets, each of which contains credentials (username, password).
credctl is essentially based on the Python packages click and kubernetes.
Get credctl's code like this:
git clone https://github.com/deepshore/credctl.gitEnter the project folder, create venv and activate it:
python3 -m venv venv
source venv/bin/activateMake sure you have the latest version of build installed:
pip install --upgrade buildBuild the package like this:
python -m buildInstall the package like this:
pip install dist/credctl-0.0.1.tar.gzAlternatively, credctl can also be installed "editable":
pip install -e .Building the package is not necessary in this case.
Now the following command should be executable and show hints on how to use credctl:
credctlCreate a Kubernetes secret containing credentials like this (you can optionally specify the namespace):
credctl create my-creds my-username my-password -n defaultList all of the Kubernetes secrets managed by credctl like this:
credctl listYou can delete secrets managed by credctl like this:
credctl delete my-credsIf the secret is not managed by credctl, the deletion is canceled:
kubectl create secret generic not-managed-by-credctl --from-literal==my-key=my-value
credctl delete not-managed-by-credctl