Small tools for shell to make k8s admin life easier. Most solutions tested with Ubuntu and Git Bash for Windows.
-
Checkout this repo into ~/dotfiles.
-
Define auto startup
Add
source ~/dotfiles/startdotfiles.sh
at end of your ~/.bashrc
- Use it
Start a new shell and use it. See separate chapters for functions.
- installed brew
brew install bash-completion
add to ~/.basrc
if [ -f $(brew --prefix)/etc/bash_completion ]; then
. $(brew --prefix)/etc/bash_completion
fi
- installed brew
brew install zsh-completion
Config files in a directory will be 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 ~/.kube-shared
directory exists theese file will also merged into $KUBECONFIG environemnt variable. This can be used to share configs with other team members seperated from private config files.
Config files must name *.yaml or *.yml.
'k' set as alias for kubectl and enable bash completion with 'tab'
Needs installed python3.
Rename contexts and clusters in a kubectl config file. See kubefix -h
for details.
This CLI dont work under Windows git bash for login. See hashicorp/vault#4946 (comment) for a hack. This is integrated in theese dot-files.
Most of thees snippets are collected from other authors.