Error configuring TLS error: secret xxx does not exist

I am using “Traefik”, “cert-mangaer”, and “Let’s Encrypt”.

Here is my ClusterIssuer file

apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
  name: production-lets-encrypt-issuer
  namespace: production-hm-cert-manager
spec:
  acme:
    email: [email protected]
    server: https://acme-v02.api.letsencrypt.org/directory
    privateKeySecretRef:
      name: production-lets-encrypt-issuer-account-secret
    solvers:
      - http01:
          ingress:
            ingressClassName: traefik

Here is my Ingress file

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: hm-airbyte-ingress
  namespace: production-hm-airbyte
  annotations:
    kubernetes.io/ingress.class: traefik
    traefik.ingress.kubernetes.io/router.entrypoints: websecure
    traefik.ingress.kubernetes.io/router.tls: "true"
    cert-manager.io/cluster-issuer: production-lets-encrypt-issuer
  labels:
    app.kubernetes.io/name: hm-airbyte-ingress
    app.kubernetes.io/part-of: production-hm-airbyte
spec:
  rules:
    - host: hm-airbyte.example.com
      http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: hm-airbyte-airbyte-webapp-svc
                port:
                  number: 80
  tls:
    - hosts:
        - hm-airbyte.example.com
      secretName: hm-airbyte-ingress-tls

My Traefik pod shows error

“2024-06-27T06:35:45Z ERR Error configuring TLS error=”secret production-hm-airbyte/hm-airbyte-ingress-tls does not exist” ingress=hm-airbyte-ingress namespace=production-hm-airbyte providerName=kubernetes”

But I found I actually have a secret Secret: hm-airbyte-ingress-tls-7w9z7 inside namespace production-hm-airbyte. Note it has a random suffix.

I searched online

  • https://github.com/cert-manager/cert-manager/issues/3283
  • https://github.com/cert-manager/cert-manager/issues/3300

This issue seems having 4 years, but unfortunately there is no solution.

After a lot of experiments, I found if I add acme.cert-manager.io/http01-edit-in-place: "true" annotation, it helps resolve the issue.

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: hm-airbyte-ingress
  namespace: production-hm-airbyte
  annotations:
    kubernetes.io/ingress.class: traefik
    traefik.ingress.kubernetes.io/router.entrypoints: websecure
    traefik.ingress.kubernetes.io/router.tls: "true"
    cert-manager.io/cluster-issuer: production-lets-encrypt-issuer
    acme.cert-manager.io/http01-edit-in-place: "true"  # <- Added this
  labels:
    app.kubernetes.io/name: hm-airbyte-ingress
    app.kubernetes.io/part-of: production-hm-airbyte
spec:
  rules:
    - host: hm-airbyte.example.com
      http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: hm-airbyte-airbyte-webapp-svc
                port:
                  number: 80
  tls:
    - hosts:
        - hm-airbyte.example.com
      secretName: hm-airbyte-ingress-tls

So now here is what happens after I apply this Ingress file

  1. A temporary Secret: hm-airbyte-ingress-tls-7w9z7 with random suffix will be created
  2. After about half minute, a Secret: hm-airbyte-ingress-tls without suffix will be created
  3. The one will suffix will be automatically deleted.

This is the Secret: hm-airbyte-ingress-tls without suffix, you can see the difference between the temporary secret I posted in the question.

Without this annotation, based on my experiment, it will be stuck at step 1 forever.

Here is the explanation of this annotation:

acme.cert-manager.io/http01-edit-in-place: “true”: this controls whether the ingress is modified ‘in-place’, or a new one is created specifically for the HTTP01 challenge. If present, and set to “true”, the existing ingress will be modified. Any other value, or the absence of the annotation assumes “false”. This annotation will also add the annotation “cert-manager.io/issue-temporary-certificate”: “true” onto created certificates which will cause a temporary certificate to be set on the resulting Secret until the final signed certificate has been returned. This is useful for keeping compatibility with the ingress-gce component.

P.S. I cannot explain why this annotation helps resolve the issue. Because I actually expect if with this annotation, the temporary secret will not be created at all. Hope someone can further explain in future, thanks!

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật