install

kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/v1.8.0/cert-manager.yaml

ClusterIssuer

apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
  name: letsencrypt-prod-http01
  namespace: testest
spec:
  acme:
    server: https://acme-v02.api.letsencrypt.org/directory
    email: my@email.com
    privateKeySecretRef:
      name: letsencrypt-http01
    solvers:
    - http01: 
        ingress:
          class: nginx

ingress

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: ingress-www
  namespace: testest
  annotations:
    kubernetes.io/ingress.class: "nginx" # 自动签发开关
    cert-manager.io/cluster-issuer: "letsencrypt-prod-http01"   # 自动签发开关
spec:
  tls:
  - hosts:
    - www.testest.com        
    secretName: ingress-tls-www # 需要修改
  rules:
  - host: www.testest.com    
    http:
      paths:
      - path: /
        backend:
          service:
            name: go-www
            port: 
              number: 8081
        pathType: ImplementationSpecific

发表回复

您的电子邮箱地址不会被公开。

Captcha Code