Skip to content

Instantly share code, notes, and snippets.

@sc3p73r-it
Created September 3, 2025 08:51
Show Gist options
  • Select an option

  • Save sc3p73r-it/f982cb00541433c3163dbdf827cf36e2 to your computer and use it in GitHub Desktop.

Select an option

Save sc3p73r-it/f982cb00541433c3163dbdf827cf36e2 to your computer and use it in GitHub Desktop.
#!/bin/bash
# usage: kubeadd new_kubeconfig_file
cp ~/.kube/config ~/.kube/config.$(date +%F)
KUBECONFIG=~/.kube/config:$1 kubectl config view --flatten > /tmp/config
mv /tmp/config ~/.kube/config
chmod 600 ~/.kube/config
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment