Small tools for shell to make k8s admin life easier. Most solutions tested with Ubuntu and Git Bash for Windows.
-
Checkout this repo into ~/tgruenert-dotfiles.
-
Define auto startup
Add
source ~/tgruenert-dotfiles/startdotfiles.sh
at end of your ~/.bashrc
- Use it
Start a new shell and use it. See separate chapters for functions.
Config files in a directory will collected and added to $KUBECONFIG at startup shell. So adding and removing file is enough. No more merge of "master-config" needed. Credits to https://github.com/GeertJohan/kube-multi-config
Tools will create ~/.kube-multi
directory. Put your cluster configfiles into this directory and restart your shell. kubectl will recognize the new files. To remove config-files just remove it from this directory. kubectl will recognize this immediately.
If you use Lens
- go to File > Preferences > Kubernetes
- press "Sync folder(s)
- select
~/.kube
and~/.kube-multi
Now Lens can detect all your config files.
For a shared directory of kubectl configs also directory ~/.kube-shared
is supported.
'k' set as alias for kubectl and enable bash completion with 'tab'
Most of thees snippets are collected from other authors.