apiVersion: certmanager.k8s.io/v1alpha1 kind: ClusterIssuer metadata: name: letsencrypt-prod spec: acme: # The ACME server URL server: https://acme-v02.api.letsencrypt.org/directory # Email address used for ACME registration email: youremail@yourdomain.com # Name of a secret used to store the ACME account private key privateKeySecretRef: name: letsencrypt-prod # Enable the HTTP-01 challenge provider http01: {}
配置DNS
获取nginx-ingress-controller的IP
1
kubectl get svc -n default
output:
1 2 3 4
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE kubernetes ClusterIP 10.64.0.1 <none> 443/TCP 64m nginx-ingress-controller LoadBalancer 10.64.11.170 35.188.93.188 80:30393/TCP,443:30515/TCP 59m nginx-ingress-default-backend ClusterIP 10.64.5.162 <none> 80/TCP 59m
apiVersion: extensions/v1beta1 kind: Ingress metadata: name: name-virtual-host-ingress annotations: kubernetes.io/ingress.class: nginx certmanager.k8s.io/cluster-issuer: letsencrypt-prod nginx.ingress.kubernetes.io/ssl-redirect: "true" spec: tls: # < placing a host in the TLS config will indicate a cert should be created - hosts: - demo.w2x.me secretName: letsencrypt-prod rules:
Optional. The name of the database to authenticate if the connection string includes authentication credentials in the form of username:password@. If /database is not specified and the connection string includes credentials, the driver will authenticate to the admin database. See also authSource.