Created
July 19, 2022 18:22
-
-
Save acmlira/a8f2536c5a7ff4d8646ba0d2903ea3bf to your computer and use it in GitHub Desktop.
How to connect to a k8s cluster
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
export K8S_USER="my-user" | |
export K8S_CLUSTER="my-cluster" | |
export K8S_TOKEN="my-token" | |
kubectl config set-cluster ${K8S_CLUSTER} --server=https://api.${K8S_CLUSTER} --insecure-skip-tls-verify=true | |
kubectl config set-context ${K8S_USER}-${K8S_CLUSTER} --cluster=${K8S_CLUSTER} --user=${K8S_USER} | |
kubectl config use-context ${K8S_USER}-${K8S_CLUSTER} | |
kubectl config set-credentials ${K8S_USER} -- ${K8S_TOKEN} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment