Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save swamibluedata/7414c6741a70265422a79cf8ab74df09 to your computer and use it in GitHub Desktop.
Save swamibluedata/7414c6741a70265422a79cf8ab74df09 to your computer and use it in GitHub Desktop.
SERVICE_ACCOUNT=hpecp-bootstrap
SECRET=$(kubectl -n hpecp-bootstrap get serviceaccount ${SERVICE_ACCOUNT} -o jsonpath='{.secrets[].name}')
TOKEN=$(kubectl -n hpecp-bootstrap get secret ${SECRET} -o jsonpath={.data.token} | base64 -d)
kubectl -n hpecp-bootstrap get secret ${SECRET} -o jsonpath='{.data.ca\.crt}' | base64 -d > /tmp/ca.crt
# Set this to the apiserver endpoint
APISERVER=""
curl $APISERVER/api/v1/nodes?limit=1000 --header "Authorization: Bearer $TOKEN" --cacert /tmp/ca.crt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment