创建 ManagedCertificate 结果 "Status: FailedNotVisible"

Creating a ManagedCertificate results in "Status: FailedNotVisible"

使用 Kubernetes 1.12.6-gke.7 或更高版本可以创建一个 ManagedCertificate,然后从向 Internet 公开服务的入口资源引用该证书。

运行 kubectl describe managedcertificate certificate-name first表示证书处于Provisioning状态,但最终进入FailedNotVisible。

尽管使用静态 IP 和 DNS 可以很好地解析上述服务的 http 版本,但所有 ManagedCertificate 最终都处于 "Status: FailedNotVisible" 状态。

我在做什么的概要:

  1. 生成保留(静态)外部 IP 地址

  2. 将 CloudDNS 中的 DNS A 记录配置为 subdomain.domain.com 从步骤 1 生成的 IP 地址。

  3. 使用 kubectl apply -f 创建名为 "subdomain-domain-certificate" 的 ManagedCertificate,其中 spec:domains 包含与步骤 2 中的 subdomain.domain.com DNS 记录相对应的单个域。
  4. 创建一个简单的部署并公开它的服务
  5. 正在创建引用第 4 步中默认服务后端的 Ingress 资源以及第 1 步中创建的静态 ip 和第 3 步中生成的托管证书的注释。
  6. 确认 Ingress 已创建并分配了静态 IP
  7. 访问 http://subdomain.domain.com 提供第 4 步部署中创建的 pod 的输出

过了一会儿

kubectl describe managedcertificate subdomain-domain-certificate

结果为 "Status: FailedNotVisible"。

Name:         subdomain-domain-certificate
Namespace:    default
Labels:       <none>
Annotations:  <none>
API Version:  networking.gke.io/v1beta1
Kind:         ManagedCertificate
Metadata:
  Creation Timestamp:  2019-04-15T17:35:22Z
  Generation:          1
  Resource Version:    52637
  Self Link:           /apis/networking.gke.io/v1beta1/namespaces/default/managedcertificates/subdomain-domain-certificate
  UID:                 d8e5a0a4-5fa4-11e9-984e-42010a84001c
Spec:
  Domains:
    subdomain.domain.com
Status:
  Certificate Name:    mcrt-ac63730e-c271-4826-9154-c198d654f9f8
  Certificate Status:  Provisioning
  Domain Status:
    Domain:  subdomain.domain.com
    Status:  FailedNotVisible
Events:
  Type    Reason  Age   From                            Message
  ----    ------  ----  ----                            -------
  Normal  Create  56m   managed-certificate-controller  Create SslCertificate mcrt-ac63730e-c271-4826-9154-c198d654f9f8

根据我的理解,如果负载平衡器配置正确(在 ManagedCertificate 资源的后台完成)并且 DNS(可以很好地解析到非 https 端点)检查证书应该进入状态:活动状态?

我的问题的根本原因最终是 DNSSEC 配置错误。在 运行 通过 https://dnssec-analyzer.verisignlabs.com/ DNS 后,我能够识别并解决问题。

您需要确保域名解析为您的 GKE Ingress 的 IP 地址,完全按照“creating an Ingress with a managed certificate”的说明进行操作。

有关详细信息,请参阅 Google 云负载平衡文档。来自 https://cloud.google.com/load-balancing/docs/ssl-certificates#domain-status:

"The status FAILED_NOT_VISIBLE indicates that certificate provisioning failed for a domain because of a problem with DNS or the load balancing configuration. Make sure that DNS is configured so that the certificate's domain resolves to the IP address of the load balancer."

DNSSEC 确实没有为我的域启用,但在配置之后,ManagedCertificate configuration was still not going through and I had no clue what was going on. Deleting and re-applying the ManagedCertificate and Ingress manifests did not do the trick. But issuing the command gcloud beta compute ssl-certificates list showed several unused managed certificates hanging around and deleting them with cloud compute ssl-certificates delete NAME ...,然后重新启动配置过程就可以解决我的问题。

我刚 运行 在设置新服务时遇到了这个问题,我的 8 个外部 IP 的限额用完了。

trouble shooting guide之后,我检查了是否有443端口到我入口的转发规则。 没有。 当我尝试手动设置它时,出现错误提示我用完了 8 个魔法地址。 我删除了不需要的转发规则,瞧!

现在,为什么为同一个入口成功设置了端口 80 的转发规则让我无法理解。

我 运行 遇到了同样的错误,发现我在错误的 Kubernetes 命名空间中创建了 managedCertificate。将 managedCertificate 放入正确的命名空间后,一切正常。