Skip to content

credctl is a simple command line application designed to exemplify how to build custom Kubernetes clients in Python.

Notifications You must be signed in to change notification settings

deepshore/credctl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

credctl

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.

Installation

Get credctl's code like this:

git clone https://github.com/deepshore/credctl.git

Enter the project folder, create venv and activate it:

python3 -m venv venv
source venv/bin/activate

Make sure you have the latest version of build installed:

pip install --upgrade build

Build the package like this:

python -m build

Install the package like this:

pip install dist/credctl-0.0.1.tar.gz

Alternatively, 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:

credctl

How to use credctl

Create secrets

Create a Kubernetes secret containing credentials like this (you can optionally specify the namespace):

credctl create my-creds my-username my-password -n default

List secrets

List all of the Kubernetes secrets managed by credctl like this:

credctl list

Delete secrets

You can delete secrets managed by credctl like this:

credctl delete my-creds

If 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

About

credctl is a simple command line application designed to exemplify how to build custom Kubernetes clients in Python.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages