Kubernetes Cert-Manager 만료된 인증서

Kubernetes Cert-Manager 만료된 인증서

저는 GKE Kubernetes 환경을 물려받았고 며칠 동안 이 문제를 해결하려고 노력했지만 안타깝게도 다음에 무엇을 시도해야 할지 모르겠습니다.

클러스터는 cert-manager(helm을 통해 설치)를 사용하여 Let's Encrypt 인증서를 클러스터에 적용하도록 설정되었습니다. 어떤 이유에서인지 이것은 2년 넘게 완벽하게 작동했지만 4월 16일부터 클러스터의 모든 메모에 대해 브라우저에 SSL 경고가 표시되기 시작했습니다.

실행하면 kubectl describe certificates site-cloud-tls인증서가 갱신된 것 같지만 수신 트래픽에는 적용되지 않습니다.

Name:         site-cloud-tls
Namespace:    cs
Labels:       <none>
Annotations:  <none>
API Version:  certmanager.k8s.io/v1alpha1
Kind:         Certificate
Metadata:
  Creation Timestamp:  2019-06-02T09:55:05Z
  Generation:          34
  Owner References:
    API Version:           extensions/v1beta1
    Block Owner Deletion:  true
    Controller:            true
    Kind:                  Ingress
    Name:                  cs-nginx
    UID:                   7f312326-851c-11e9-8bf0-4201ac10000c
  Resource Version:        541365011
  UID:                     7f36cc40-851c-11e9-8bf0-4201ac10000c
Spec:
  Dns Names:
    site.cloud (changed name but is correct)
  Issuer Ref:
    Kind:       ClusterIssuer
    Name:       letsencrypt-dns
  Secret Name:  site-cloud-tls
Status:
  Conditions:
    Last Transition Time:  2022-04-24T05:26:13Z
    Message:               Certificate is up to date and has not expired
    Reason:                Ready
    Status:                True
    Type:                  Ready
  Not After:               2022-06-15T17:01:48Z
Events:                    <none>
kubectl describe ingress
Name:             cs-nginx
Namespace:        cs
Address:          192.168.1.32
Default backend:  default-http-backend:80 (10.16.3.12:8080)
TLS:
  site-cloud-tls terminates site.cloud (changed naming but seems correct)
Rules:
  Host                       Path  Backends
  ----                       ----  --------
  site.cloud   
                             /   site:8080 (10.10.10.10:8080)

Annotations:                 certmanager.k8s.io/cluster-issuer: letsencrypt-dns
                             kubernetes.io/ingress.class: nginx
                             nginx.ingress.kubernetes.io/ssl-redirect: true
                             nginx.org/websocket-services: datahub
Events:                      <none>

스테이징 환경도 영향을 받았습니다. cert-manager를 다시 설치하고 nginx-ingress를 다시 설치하려고 시도했지만 불행히도 작업을 다시 시작하고 실행할 수 없었습니다(아마도 내가 만든 구성 오류로 인해).

3일 후에는 어느 쪽이 위로 올라가는지 모르고 다음에 무엇을 시도해야 할지 알 만큼 Kubernetes를 잘 알지 못합니다. 어떤 지침이 있습니까? 도움이 될 만한 추가 정보를 제공할 수 있나요?

감사합니다!

답변1

여기서 문제는 cluster-issuerIngress 정의에서 종류를 참조하고 있다는 것입니다.

Annotations:                 certmanager.k8s.io/cluster-issuer: letsencrypt-dns

그러나 정의한 객체는 Certificate종류입니다.

Name:         site-cloud-tls
Namespace:    cs
Labels:       <none>
Annotations:  <none>
API Version:  certmanager.k8s.io/v1alpha1
Kind:         Certificate

그렇기 때문에 Ingress에는 적용되지 않습니다. 당신에게 필요한 것은발급자인증서를 처리하기 위한 Kubernetes의 리소스입니다. 여기에서 기본 예제를 찾을 수 있습니다.절정 ClusterIssuer매니페스트 파일:

apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
  name: letsencrypt-staging
spec:
  acme:
    # You must replace this email address with your own.
    # Let's Encrypt will use this to contact you about expiring
    # certificates, and issues related to your account.
    email: [email protected]
    server: https://acme-staging-v02.api.letsencrypt.org/directory
    privateKeySecretRef:
      # Secret resource that will be used to store the account's private key.
      name: example-issuer-account-key
    # Add a single challenge solver, HTTP01 using nginx
    solvers:
    - http01:
        ingress:
          class: nginx

관련 정보