Last active
March 1, 2023 07:53
-
-
Save longtian/c0dc4d31a4b50364e20e3e3a345d58b4 to your computer and use it in GitHub Desktop.
kubernetes 导出 pkcs12 证书的脚本
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
CONFIG="/root/.kube/config" | |
echo -n $(cat $CONFIG | grep certificate-authority-data | cut -d: -f2) | base64 -d > my-ca-cert.crt | |
echo -n $(cat $CONFIG | grep client-certificate-data | cut -d: -f2) | base64 -d > my-client.crt | |
echo -n $(cat $CONFIG | grep client-key-data | cut -d: -f2) | base64 -d > my-client.key | |
openssl pkcs12 -export -out k8s.pfx -inkey my-client.key -in my-client.crt -certfile my-ca-cert.crt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment