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.

Revisions

  1. sc3p73r-it created this gist Sep 3, 2025.
    7 changes: 7 additions & 0 deletions kubeadd
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    #!/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