gpt4 book ai didi

ssl - 带有 nginx 入口和证书管理器的 ArgoCD 无法正常工作

转载 作者:行者123 更新时间:2023-12-04 22:41:45 32 4
gpt4 key购买 nike

我正在尝试在 GKE 集群(版本 1.21.5-gke.1302)中使用入口和证书管理器公开 ArgoCD,但未颁发证书。
重现步骤:

  • 安装 cert-manager 申请 this yaml
  • 在 helm 运行的情况下安装 nginx ingress-controller:helm install my-release nginx-stable/nginx-ingress
  • 创建 clusterIssuer 应用以下内容:
  • apiVersion: cert-manager.io/v1
    kind: ClusterIssuer
    metadata:
    name: letsencrypt-cluster-issuer
    spec:
    acme:
    email: example@email.com
    server: https://acme-v02.api.letsencrypt.org/directory
    privateKeySecretRef:
    name: letsencrypt-cluster-issuer-key
    solvers:
    - http01:
    ingress:
    class: nginx
  • 使用 this 应用入口指南和文件:
  • apiVersion: networking.k8s.io/v1
    kind: Ingress
    metadata:
    name: argocd-server-ingress
    namespace: argocd
    annotations:
    cert-manager.io/cluster-issuer: letsencrypt-prod
    kubernetes.io/ingress.class: nginx
    kubernetes.io/tls-acme: "true"
    nginx.ingress.kubernetes.io/ssl-passthrough: "true"
    # If you encounter a redirect loop or are getting a 307 response code
    # then you need to force the nginx ingress to connect to the backend using HTTPS.
    #
    nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"
    spec:
    rules:
    - host: argocd.example.com
    http:
    paths:
    - path: /
    pathType: Prefix
    backend:
    service:
    name: argocd-server
    port:
    name: https
    tls:
    - hosts:
    - argocd.example.com
    secretName: argocd-secret # do not change, this is provided by Argo CD
  • 将 ingress-controller 的 ip 映射到您的主机名。

  • 预期行为 :我期待证书成功创建并可以访问该应用程序。
    当前状态:
    证书描述给了我这个:
      Conditions:
    Last Transition Time: 2022-01-18T14:10:14Z
    Message: Existing issued Secret is not up to date for spec: [spec.dnsNames]
    Observed Generation: 3
    Reason: SecretMismatch
    Status: False
    Type: Ready
    Last Transition Time: 2022-01-18T14:10:14Z
    Message: Issuing certificate as Secret was previously issued by Issuer.cert-manager.io/
    Observed Generation: 1
    Reason: IncorrectIssuer
    Status: True
    Type: Issuing
    Next Private Key Secret Name: argocd-secret-ccjtv
    Not After: 2023-01-18T13:39:24Z
    Not Before: 2022-01-18T13:39:24Z
    Renewal Time: 2022-09-18T21:39:24Z
    Events:
    Type Reason Age From Message
    ---- ------ ---- ---- -------
    Normal Requested 16m cert-manager Created new CertificateRequest resource "argocd-secret-qm469"
    Normal Requested 15m cert-manager Created new CertificateRequest resource "argocd-secret-9ctn4"
    Normal Reused 7m19s (x2 over 45h) cert-manager Reusing private key stored in existing Secret resource "argocd-secret"
    最后,我可以通过挑战访问提供的 url,但状态处于等待状态,原因如下: Waiting for HTTP-01 challenge propagation: failed to perform self check GET request有谁知道可能出了什么问题?将不胜感激。
    谢谢!

    最佳答案

    我认为您需要指定:

    apiVersion: cert-manager.io/v1
    kind: ClusterIssuer
    metadata:
    name: letsencrypt-cluster-issuer
    spec:
    acme:
    email: example@email.com
    server: https://acme-v02.api.letsencrypt.org/directory
    privateKeySecretRef:
    name: argocd-secret # HERE use secrets created by ArgoCD
    solvers:
    - http01:
    ingress:
    class: nginx

    关于ssl - 带有 nginx 入口和证书管理器的 ArgoCD 无法正常工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70785585/

    32 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com