Skip to main content

Terminal kubectl namespace selector

Project description

kubens is a command line tool to interactively select and set Kubernetes namespaces.

~$ kubens
Current namespace: my-namespace
Pick your namespace:

=> default
   kube-system
   my-namespace
   another-namespace
   exit

Install

pip install kubens

Clone the repo:

$ git clone https://github.com/roubles/kubens
$ cd kubens
$ pip install .

Copy Code

Usage

usage: kubens [-h] [--list] [substring]


interactively pick a k8s namespace


positional arguments:
substring substring to filter namespaces (must match from the beginning)


optional arguments:
-h, --help show this help message and exit
-l, --list list namespaces instead of launching interactive menu

Examples

Selecting namespaces

To run kubens and select a namespace interactively:

$ kubens

To run kubens and set the namespace directly if there is an exact (or partial) match:

$ kubens my-namespace

If there are multiple matches, it will show a menu to select from.

Listing namespaces

To list namespaces:

$ kubens --list

To list namespaces with a filter:

$ kubens --list ku

This will list namespaces that start with “ku”.

Features

  • Interactively select a Kubernetes namespace from the terminal.

  • Displays the current namespace.

  • Sets the selected namespace as the current context.

  • Lists namespaces with the -l or --list argument.

  • Filters namespaces based on a substring that must match from the beginning.

Requirements

  • Python 2.7 or later

  • kubectl installed and configured

  • pick library (installed automatically with pip install kubens)

License

This project is licensed under the MIT license.

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

kubens-1.2.5.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

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

kubens-1.2.5-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file kubens-1.2.5.tar.gz.

File metadata

  • Download URL: kubens-1.2.5.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.5

File hashes

Hashes for kubens-1.2.5.tar.gz
Algorithm Hash digest
SHA256 9317929db7bc7db90fa4e1763c10b6cb53a5b098e9514c33c966779c90197e11
MD5 2999b8c1ec57b9d037593351837a833e
BLAKE2b-256 bc224158e3c12d9118d03da9c493cf05091961eb4ae7ebbc4fabf0e1c3d1bf6a

See more details on using hashes here.

File details

Details for the file kubens-1.2.5-py3-none-any.whl.

File metadata

  • Download URL: kubens-1.2.5-py3-none-any.whl
  • Upload date:
  • Size: 4.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.5

File hashes

Hashes for kubens-1.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 e3178f73f5fb128c593980510c0f0edca7a22dd90d4bf7c6917e80de49e1633c
MD5 75096de856e2e3422ae421c2b177b827
BLAKE2b-256 6395fd5faf30800b3d31e8bcd325f4d40c2320551c189e82aa73dec0c527d4d9

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