Last active
June 3, 2022 10:48
-
-
Save tanelmae/ac3b9c9fb8ecf801b009eb21d2040c3e to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env bash | |
# When you really need kubeconfig file inside the pod | |
cat << EOF | |
apiVersion: v1 | |
clusters: | |
- cluster: | |
certificate-authority-data: $(base64 -w 0 /var/run/secrets/kubernetes.io/serviceaccount/ca.crt) | |
server: https://$KUBERNETES_SERVICE_HOST:$KUBERNETES_SERVICE_PORT | |
name: local | |
contexts: | |
- context: | |
cluster: local | |
user: local | |
name: local | |
current-context: local | |
kind: Config | |
preferences: {} | |
users: | |
- name: local | |
user: | |
token: $(cat /var/run/secrets/kubernetes.io/serviceaccount/token) | |
EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment