Skip to content

Instantly share code, notes, and snippets.

@stand-sure
Created December 20, 2022 13:50
Show Gist options
  • Save stand-sure/6fb979bdc84b11db163d490135268be0 to your computer and use it in GitHub Desktop.
Save stand-sure/6fb979bdc84b11db163d490135268be0 to your computer and use it in GitHub Desktop.
#! /bin/bash
# Make a copy of your existing config
cp ~/.kube/config ~/.kube/config.bak
# Merge the two config files together into a new config file
KUBECONFIG=~/.kube/config:/path/to/new/config kubectl config view --flatten > /tmp/config
# TEST
# Replace your old config with the new merged config
#mv /tmp/config ~/.kube/config
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment