k8ss
v1.9.0
Published
k8s switcher
Readme
k8ss
k8s cluster and namespace switcher
Prerequisites
nodejsinstalled (tested in version 12)kubectlinstalledk8s-configfolder in home directory, for example:
~
|-- k8s-config
|-- hangzhou
|-- config
|-- beijing
|-- configInstallation
npm install k8ss --globalUsage
List all configured clusters
k8ss listSwitch to cluster or namespace
# full usage:
k8ss switch --cluster=hangzhou --namespace=test
# switch namespace only without change cluster:
k8ss s --namespace=stageLogin
k8ss loginHow
- move the related
configfile into~/.kube - execute
kubectl config set-context $(kubectl config current-context) --namespace=<namespace>
FAQ
npm WARN checkPermissions Missing write access to /usr/local/nvm/versions/node/v12.13.1/lib/node_modulesThen you can install it locally by
npm i k8ssand then run it as./node_modules/.bin/k8ss switch --namespace=xxx.
