dnspod-webhook-values.yaml 示例如下:groupName: example.your.domain # 写一个标识 group 的名称,可以任意写secrets: # 将前面生成的 id 和 token 粘贴到下面apiID: "<ID>"apiToken: "<Token>"clusterIssuer:enabled: true # 自动创建出一个 ClusterIssueremail: your@email.com # 填写你的邮箱地址
git clone --depth 1 https://github.com/qqshfox/cert-manager-webhook-dnspod.githelm upgrade --install -n cert-manager -f dnspod-webhook-values.yaml cert-manager-webhook-dnspod ./cert-manager-webhook-dnspod/deploy/cert-manager-webhook-dnspod
Certificate 对象来签发免费证书:apiVersion: cert-manager.io/v1kind: Certificatemetadata:name: example-com-crtnamespace: istio-systemspec:secretName: example-com-crt-secret # 证书保存在这个 secret 中issuerRef:name: cert-manager-webhook-dnspod-cluster-issuer # 这里使用自动生成出来的 ClusterIssuerkind: ClusterIssuergroup: cert-manager.iodnsNames: # 填入需要签发证书的域名列表,确保域名是使用 dnspod 管理的- example.com- test.example.com
$ kubectl -n istio-system get certificates.cert-manager.ioNAME READY SECRET AGEexample-com-crt True example-com-crt-secret 25d
kubectl -n istio-system describe certificates.cert-manager.io example-com-crt
apiVersion: networking.k8s.io/v1beta1kind: Ingressmetadata:name: test-ingressannotations:kubernetes.io/ingress.class: nginxspec:rules:- host: test.example.comhttp:paths:- path: /backend:serviceName: webservicePort: 80tls:hosts:- test.example.comsecretName: example-com-crt-secret # 引用证书 secret
apiVersion: networking.istio.io/v1alpha3kind: Gatewaymetadata:name: example-gwnamespace: istio-systemspec:selector:app: istio-ingressgatewayistio: ingressgatewayservers:- port:number: 80name: HTTP-80protocol: HTTPhosts:- example.com- test.example.comtls:httpsRedirect: true # http 重定向 https (强制 https)- port:number: 443name: HTTPS-443protocol: HTTPShosts:- example.com- test.example.comtls:mode: SIMPLEcredentialName: example-com-crt-secret # 引用证书 secret---apiVersion: networking.istio.io/v1beta1kind: VirtualServicemetadata:name: example-vsnamespace: testspec:gateways:- istio-system/example-gw # 转发规则绑定到 ingressgateway,将服务暴露出去hosts:- 'test.example.com'http:- route:- destination:host: exampleport:number: 80
文档反馈