Last active
November 5, 2022 14:46
-
-
Save sakurai-youhei/429d53d338dbb6e6adfc0dbaf0dc38ac to your computer and use it in GitHub Desktop.
Aliases to start/end an isolated session on a temporal config for kubectl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias kcfork='install -m 600 $HOME/.kube/config $HOME/.kube/config-PID$$; export KUBECONFIG=$HOME/.kube/config-PID$$' | |
alias kcback='rm -f $HOME/.kube/config-PID$$; unset KUBECONFIG' | |
# You can start an isolated session on a temporal config by `kcfork`, do whatever you want like switching contexts, and end the session by `kcback`. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment