Last active
April 1, 2024 16:14
-
-
Save tshabatyn/398c4fba97070e82a8289d1284031254 to your computer and use it in GitHub Desktop.
Adding context to k8s
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
# Outputs current value of KUBECONFIG | |
echo $KUBECONFIG | |
# Adding PATH of all the context files separated with semicolon | |
export KUBECONFIG=~/Downloads/dev-cluster-kubeconfig.yaml:~/Downloads/qa-cluster-kubeconfig.yaml | |
# Outputs merged configuration of the joined context files | |
kubectl config view --flatten | |
# Save the merged configuration to the default kube config location | |
kubectl config view --flatten > ~/.kube/config | |
# Outputs all the context's with the current context marked with * | |
kubectl config get-contexts | |
# Switch to the context of the new cluster | |
kubectl config use-context qa-cluster | |
# Set the namespace for the current context | |
kubectl config set-context --current --namespace=my-app |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment