kubeconf
Lightweight Python module for creating, manipulating, and editing kubeconfig files
Why not use or wrap kubectl config?
kubectl config is great and writing a Python wrapper is a fine solution. However, kubectl config is quite limited in functionality. I wanted more control over my kubernetes config. kubeconfig gives me that control. It doesn't use kubectl at all. Rather, it reads, edits, and writes config files entirely on its own.
Getting starting
Install this package using pip:
pip install kubeconf
Basic Usage
from kubeconf import KubeConf
k = KubeConf(path='path/to/config')
# Open the file
k.open()
# Add a cluster
k.add_cluster(
name='mycluster',
server='...',
certificate_authority_data='...',
)
# Add a user for that cluster
k.add_user(
user='me'
)
# Add a context to map the user to the cluster
k.add_context(
name='mycontext',
cluster_name='mycluster',
user_name='me'
)
# Commit change to the file.
k.close()
Developing
Download and install this repo from source, and move into the base directory.
git clone https://github.com/Zsailer/kubeconf
cd kubeconf
If you use pipenv, you can install a developement version:
pipenv install --dev
Otherwise you can install a development version using pip
pip install -e .
Licensing
The code in this project is licensed under MIT license.
Metadata
Release files for kubeconf 0.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| kubeconf-0.0.5.tar.gz | 4.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| kubeconf-0.0.5-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details |
Total release size: 9.9 kB
Release files / kubeconf-0.0.5.tar.gz
| Download URL | kubeconf-0.0.5.tar.gz |
|---|---|
| Size | 4.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7e04dfe796512902a6fc37a70a6fdb9158027bde7320d53ca1ead191b7e5aace
|
|
BLAKE2b-256 checksum How to use checksums |
4921021449dc75f145e9b8ffce774e5af2fd0a6da926745633ee0884c53a6c13
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.6.5
|
Release files / kubeconf-0.0.5-py2.py3-none-any.whl
| Download URL | kubeconf-0.0.5-py2.py3-none-any.whl |
|---|---|
| Size | 5.5 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
36b82db238738f4bb33f14abe4f59459df2c26574a2a26ac875f12511c0d653f
|
|
BLAKE2b-256 checksum How to use checksums |
436e8ca3f89ddf94a27b7162f4c1728bb6cb3d03ff89ac033c311cd8581ad9a0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.6.5
|