Skip to content

Instantly share code, notes, and snippets.

@JanHolger
Created July 7, 2020 14:41
Show Gist options
  • Save JanHolger/006f86f9dda8bf94af25b28166d2a965 to your computer and use it in GitHub Desktop.
Save JanHolger/006f86f9dda8bf94af25b28166d2a965 to your computer and use it in GitHub Desktop.
Merges Kubernetes Configs from ~/.kube/config.d into ~/.kube/config for use with kubectx
#!/bin/bash
FILES="nonexistent"
for f in ~/.kube/config.d/*
do
FILES="${FILES}:${f}"
done
KUBECONFIG=$FILES kubectl config view --merge --flatten > ~/.kube/config
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment