Bootstrap

证书解密及转换

获取加密的key和证书

kubectl -n 名称空间 get secret secret名称 -o yaml

apiVersion: v1
data:
  server.crt: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUZTRENDQkRDZ0F3SUJBZ0lTQk1ndkQ3SVdhb1lpSmhzVnRSM1V2SDFHTUEwR0NTcUdTSWIzRFFFQkN3VUEKTURJeEN6QUpCZ05WQkFZVEFsVlRNUll3RkFZRFZRUUtFdzFNWlhRbmN5QkZibU55ZVhCME1Rc3dDUVlEVlFRRApFd0pTTXpBZUZ3MHlNekEwTWpBd056UXpNRGhhRncweU16QTNNVGt3TnpRek1EZGFNQ0F
  server.key: LS0tLS1CRUdJTiBQUklWQVRFIEtFWS0tLS0tCk1JSUV2Z0lCQURBTkJna3Foa2lHOXcwQkFRRUZBQVNDQktnd2dnU2tBZ0VBQW9JQkFRQ3FYenRYWmp3Q25ReU4KUmNUTW5BV0h0TlFuZzUvS0ErWlBhK3pjQVU0YVlrT0tQeFFFYVBvTHBjWDJyWGRlZnpDazUyQityL2ExRWlHdApsb3NjcitvOWxTTlFqVlAyNUFreDJRUnZDZHZScEhucTVIS3AwUDZPV0NqSjNOc0tCK
kind: Secret
metadata:
  name: secret名称
  namespace: 名称空间
type: Opaque

解密

echo 证书加密串|base64 -d > server.crt
echo key加密串|base64 -d > server.key

生成Client P12认证文件cert.pfx

openssl pkcs12 -export -out ./cert.pfx -inkey ./server.key -in ./server.crt -certfile ./ca.crt
;