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》編輯)
過手如登山,一步一重天