Skip to content

Instantly share code, notes, and snippets.

@valentin2105
Created February 19, 2024 23:02
Show Gist options
  • Save valentin2105/28f3f4ebf0016a78e3cfdfb8fc092578 to your computer and use it in GitHub Desktop.
Save valentin2105/28f3f4ebf0016a78e3cfdfb8fc092578 to your computer and use it in GitHub Desktop.
curl Kube-API from a pod via service-account
curl https://${KUBERNETES_SERVICE_HOST} \
--header "Authorization: Bearer $(cat /var/run/secrets/kubernetes.io/serviceaccount/token)" \
--cacert /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment