Switch kubernetes namespace
Project description
ksns
Kubernetes CLI wrapper in Python for switching and listing namespaces. It does not require kubectl to work.
Developed by Ratul (c) 2021
Installation
Requires Python 3.6+.
pip3 install ksns
Usage
You need to Set the KUBECONFIG environment variable or ~/.kube/config will be considered.
ratul ➤ ksns --help
Usage: python -m ksns [OPTIONS] COMMAND [ARGS]...
NOTE: Set the KUBECONFIG environment variable or ~/.kube/config will be
considered
USAGE:
1. list namespaces : ksns list
2. switch namespaces: ksns ns <namespace_name>
Options:
--help Show this message and exit.
Commands:
list List of namespaces in context
ns Switch to another namespace: <namespace_name>
The current namespace color you are in will be yellow in the output of list namespace.
List namespaces
ratul ➤ ksns list
default
demo
kube-node-lease
kube-public
kube-system
kubernetes-dashboard
monitoring
note: using config: /home/ubuntu/config
Switch Namespace
ratul ➤ ksns ns monitoring
switched to monitoring namespace
note: using config: /home/ubuntu/config
Local Changes
It’s recommended to have a virtualenv for the project.
Go to the project dir and install dependencies
cd <project-path>
pip3 install -r requirements.txt
pip3 install --editable .
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ksns-0.0.4.tar.gz.
File metadata
- Download URL: ksns-0.0.4.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
02e6e41a3962a930d44bbe03127963559bcce23f2c8f876d3f375399754b6177
|
|
| MD5 |
83dc386ee34b505d7051372d445c69db
|
|
| BLAKE2b-256 |
1bb0c93fabdb3779e9be7842cc2165d428dd09568f70cbb4941e463b5a0c670c
|
File details
Details for the file ksns-0.0.4-py3-none-any.whl.
File metadata
- Download URL: ksns-0.0.4-py3-none-any.whl
- Upload date:
- Size: 4.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c923c5a859a66f95d074bf69980553059bd15b5f16d840de56ab9c7aa256dd50
|
|
| MD5 |
35239a86d24e0fcd04d8b66aeff39976
|
|
| BLAKE2b-256 |
daa6e47edd0fd09d74a1388419c589b096add73bc7933f95739aae9e50523bea
|