Skip to main content

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

ksns-0.0.5.tar.gz (16.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ksns-0.0.5-py3-none-any.whl (16.7 kB view details)

Uploaded Python 3

File details

Details for the file ksns-0.0.5.tar.gz.

File metadata

  • Download URL: ksns-0.0.5.tar.gz
  • Upload date:
  • Size: 16.1 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

Hashes for ksns-0.0.5.tar.gz
Algorithm Hash digest
SHA256 6eca8ec1764ac50dd9c31c93a4193e0b8a2a82f7393ff82c2d597a2f59646395
MD5 e16edc7276c3d7a23236ab3e9dfa0e4f
BLAKE2b-256 246c9e74f3e053c5d4d306cf1766a4cad1a3c26cbb667436457ea1d6c7d45ef0

See more details on using hashes here.

File details

Details for the file ksns-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: ksns-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 16.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

Hashes for ksns-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 7c590053452f48d07dd8dbb6b848930cb3e44171a774e7ffe24b78a156a38bee
MD5 8af244cd6041f64c6c688e6fce7cf598
BLAKE2b-256 f164afebffc3fc8ba4fe90b099c415ea0a050448946e3ed1ff06cdcb8f5db279

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page