自签名证书:
生成私钥:
openssl genrsa -out rest.key 2048
生成证书:
openssl req -new -x509 -key rest.key -out rest.crt -subj /C=CN/ST=Beijing/L=Biejing/O=DevOpes/CN=restapi.test.com
创建secret
通过rancher 创建:
查看:
通过kubectl创建:
kubectl create secret tls --cert=rest.crt --key=rest.key
查看:
kubectl get secret -n restapi
NAME TYPE DATA AGE
default-token-r95c4 kubernetes.io/service-account-token 3 5h
rest-tls kubernetes.io/tls 2 2m