HTTPS證書通過cert-manager自動獲取,部署,續期


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

在不同namespace同步證書

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》編輯)


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM