Skip to content

Instantly share code, notes, and snippets.

@malikperang
Last active May 22, 2023 13:59
Show Gist options
  • Save malikperang/82db3f21ac0fde6ab1752ce329f782e5 to your computer and use it in GitHub Desktop.
Save malikperang/82db3f21ac0fde6ab1752ce329f782e5 to your computer and use it in GitHub Desktop.
Example Multiple Kube Config files merging
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
alias k="kubectl"
alias microk="microk8s kubectl"
alias getktoken="microk8s kubectl create token default"
#On Prem K8s
export CONFIG_MICROK8S=$HOME/.kube/config
#Cloud K8s
export CONFIG_DO=$HOME/.kube/do-k8s-01-kubeconfig
export CONFIG_AWS=$HOME/.kube/aws-cluster-01
#Merge all the configs
export KUBECONFIG=$CONFIG_MICROK8S:$CONFIG_DO:$CONFIG_AWS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment