Skip to content

Instantly share code, notes, and snippets.

@majorsilence
Created October 31, 2021 18:38
Show Gist options
  • Select an option

  • Save majorsilence/f06342fb5724b9df97ddf372cceac5ae to your computer and use it in GitHub Desktop.

Select an option

Save majorsilence/f06342fb5724b9df97ddf372cceac5ae to your computer and use it in GitHub Desktop.
kubernetes use curl with TLS keys example
export client=$(grep client-cert $HOME/.kube/config | cut -d" " -f 6)
export key=$(grep client-key-data $HOME/.kube/config | cut -d " " -f 6)
export auth=$(grep certificate-authority-data $HOME/.kube/config | cut -d " " -f 6)
cho $client | base64 -d - > ./client.pem
echo $key | base64 -d - > ./client-key.pem
echo $auth | base64 -d - > ./ca.pem
curl --cert ./client.pem \
--key ./client-key.pem \
--cacert ./ca.pem \
https://[IP or Host Address]/api/v1/pods
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment