【发布时间】:2022-04-23 18:08:36
【问题描述】:
我正在尝试在 GKE 集群(版本 1.21.5-gke.1302)中使用 ingress 和 cert-manager 公开 ArgoCD,但未颁发证书。
重现步骤:
-
安装证书管理器应用thisyaml
-
在 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
有人知道可能出了什么问题吗?将不胜感激。
谢谢!
【问题讨论】:
-
你好,你用的是什么k8s集群?哪个版本? AFAIK 在 k8s 1.22+ 中有一些更改,可能需要进行一些调整。
-
您好,感谢您的回复,我使用的是 GKE,版本 1.21.5-gke.1302
-
我在堆栈上找到了一个answer,其中包含针对此类错误的故障排除步骤。您能否按照这些故障排除步骤验证 http 质询是否设置为正确的域?
-
感谢您的链接,我已经尝试了这些步骤,输出如上。我认为 Nginx 有问题,特别是因为我安装了 kong 并且一切都按预期工作。
标签: ssl kubernetes-ingress nginx-ingress cert-manager argocd