Skip to main content

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 .

Metadata

Release files for ksns 0.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ksns 0.0.5
File Size Uploaded
ksns-0.0.5.tar.gz 16.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ksns 0.0.5
File Interpreter ABI Platform
ksns-0.0.5-py3-none-any.whl Python 3 none any Details

Total release size: 32.8 kB

Release files / ksns-0.0.5.tar.gz

Download URL ksns-0.0.5.tar.gz
Size 16.1 kB
Tags Source
SHA-256 checksum
How to use checksums
6eca8ec1764ac50dd9c31c93a4193e0b8a2a82f7393ff82c2d597a2f59646395
BLAKE2b-256 checksum
How to use checksums
246c9e74f3e053c5d4d306cf1766a4cad1a3c26cbb667436457ea1d6c7d45ef0
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / ksns-0.0.5-py3-none-any.whl

Download URL ksns-0.0.5-py3-none-any.whl
Size 16.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7c590053452f48d07dd8dbb6b848930cb3e44171a774e7ffe24b78a156a38bee
BLAKE2b-256 checksum
How to use checksums
f164afebffc3fc8ba4fe90b099c415ea0a050448946e3ed1ff06cdcb8f5db279
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

0.0.5 This release

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page