HTTPS證書通過cert-manager自動獲取,部署,續期
阿新 • • 發佈:2020-07-04
HTTP-01驗證和DNS-01驗證
使用cert-manager給阿里雲的DNS域名授權SSL證書
第一步:安裝cert-manager 配置 CRD kubectl apply -f https://raw.githubusercontent.com/jetstack/cert-manager/release-0.6/deploy/manifests/00-crds.yaml
阿里雲DNS的api的AK:
AccessKey ID LTAI4Fo9z3cp4xxxxxxx
AccessKeySecret yjdMSSsN6xxxxxxx
第二步:安裝阿里雲Webhook
$ git clone https://github.com/kevinniu666/cert-manager-webhook-alidns.git $ cd cert-manager-webhook-alidns $ helm install --name cert-manager-webhook-alidns --namespace=cert-manager ./deploy/webhook-alidns #檢視webhook $ kubectl get po -n cert-manager
第三步:配置Issuer
$ kubectl -n cert-manager create secret generic alidns-credentials --from-literal=accessKeySecret='yjdMSSsN6Qm2xxxxxx'
$ kubectl apply -f letsencrypt-clusterissuer.yaml # 這個申請的是
$ kubectl apply -f letsencrypt-cert.yaml
helm repo add appscode https://charts.appscode.com/stable/ helm repo update kubectl --namespace=kube-system get deployments -l "release=kubed, app=kubed"\n kubectl annotate secret rexxxx-com-crt -n cert-manager kubed.appscode.com/sync="app=kubed" kubectl label namespace default app=kubed kubectl -n default get secret xxxxxx-com-crt
第四步:全域性設定http強制跳轉https。在nginx ingress配置force-ssl-redirect: 'true' (控制檯網頁》應用配置》配置項》nginx-configuration》編輯)