说明(腾讯云域名请看另一篇文章)
- 使用官方阿里云dns插件:https://github.com/pragkent/alidns-webhook(安装比较慢请耐心等待)
- 也可以使用其他开发者使用的:https://gitee.com/StephenEvenson/cert-manager-alidns-webhook?_from=gitee_search(安装比较慢请耐心等待)
- dns-01方式支持泛域名解析https证书
- 查看cert-manager支持的DNS厂商:https://cert-manager.io/docs/configuration/acme/dns01/
获取阿里云授权信息
- 登录阿里云点击头像accessKey管理
- 复制access-key和secret-key后续用的到
安装alidns-webhook
- 尽量安装在和cert-manager一个namespace
- 基本什么都不需要改,下一步直接安装
创建配置文件(Secret)
- 在namespace创建配置文件将阿里云得access-key和secret-key填入
创建集群签发机构(clusterIssuer.yaml)
apiVersion: cert-manager.io/v1alpha2
kind: ClusterIssuer
metadata:
name: letsencrypt-staging
spec:
acme:
email: certmaster@example.com
server: https://acme-v02.api.letsencrypt.org/directory
privateKeySecretRef:
name: letsencrypt-staging-account-key
solvers:
- dns01:
webhook:
groupName: acme.yourcompany.com
solverName: alidns
config:
region: "beijing"
accessKeySecretRef:
name: alidns-secret
key: access-key
secretKeySecretRef:
name: alidns-secret
key: secret-key
kubectl apply -f clusterIssuer.yaml
kubectl get ClusterIssuer--all-namespaces
生成证书(certificate.yaml)
apiVersion: cert-manager.io/v1alpha2
kind: Certificate
metadata:
name: example-tls
namespace: docs
spec:
secretName: example-com-tls
dnsNames:
- example.com
- "*.example.com"
issuerRef:
name: letsencrypt-staging
kind: ClusterIssuer
kubectl apply -f certificate.yaml
kubectl get certificate--all-namespaces
使用证书
|