kconf

command module
v1.12.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 8, 2022 License: MIT Imports: 1 Imported by: 0

README

kconf

An opinionated command line tool for managing multiple kubeconfigs.

Release Test Status

Description

kconf works by storing all kubeconfig information in a single file ($HOME/.kube/config). This file is looked at by default when using kubectl.

Usage

Add in a new kubeconfig file:
kconf add /path/to/kubeconfig.conf

or

kconf add /path/to/kubeconfig.conf --context-name=myContext
Remove an existing kubeconfig:
kconf rm myContext
List all saved contexts in the kubeconfig:
kconf ls
View and print a single context's kubeconfig (you can pipe or export to a file):
kconf view myContext
Switch to an existing context:
kconf use myContext
Set a preferred namespace
kconf use myContext -n my-namespace

or

kconf ns my-namespace

Why?

I was previously managing my kubeconfigs using the $KUBECONFIG environment variable. However, in order to automate this process, you have to do something like this in your rc files:

KUBECONFIG=$(find $HOME/.kube -type f -name '*.conf' 2> /dev/null | sed ':a;N;$!ba;s/\n/:/g')

... that gets you a $KUBECONFIG variable with all your kubeconfigs separated by colons. The problem is that if you're frequently working with new/modified kubeconfigs, you'd have to trigger this command each time something changed.

With the kconf command, there's no need for $KUBECONFIG since kubectl already looks at $HOME/.kube/config by default. Additionally, as soon as you have a new kubeconfig, you can add it pretty easily and quickly.

Known Issues

Check out the Issues section or specifically issues created by me

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL