Created
October 31, 2021 18:38
-
-
Save majorsilence/f06342fb5724b9df97ddf372cceac5ae to your computer and use it in GitHub Desktop.
kubernetes use curl with TLS keys example
This file contains hidden or 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
| 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