Last active
June 14, 2017 07:41
-
-
Save stuart-warren/491425983f79d50cd8778c320f093d70 to your computer and use it in GitHub Desktop.
Check kubernetes api server from inside a pod
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 | |
/usr/bin/curl -sf -H "Authorization: Bearer $(</var/run/secrets/kubernetes.io/serviceaccount/token)" \ | |
--cacert "/var/run/secrets/kubernetes.io/serviceaccount/ca.crt" \ | |
"https://${KUBERNETES_PORT_443_TCP_ADDR}/version" | |
# OR | |
/usr/bin/nc -w3 -z ${KUBERNETES_SERVICE_HOST} ${KUBERNETES_SERVICE_PORT} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment