首页 > 解决方案 > 如何向 kubernetes ManagedCertificate 添加新的子域?

问题描述

我正在使用 K8s ManagedCertificate 在 GCE 上创建证书。我想在我的证书中添加一个新的子域,所以更新 yaml 文件并应用 kubectl。我试图描述我的证书以查看是否一切正常但发现错误

Warning  BackendError  16m (x144 over 36h)  managed-certificate-controller  googleapi: Error 400: The ssl_certificate resource '< redated >' is already being used by '< redated >', resourceInUseByAnotherResource

同样在描述中,我没有看到我尝试添加为活动的新子域。

Spec:
  Domains:
    web.sub1.domain1.com
    web.sub1.domain2.com
    web.newsub.domain2.com
    web.sub2.domain2.com
    web.sub1.domain3.com
Status:
  Certificate Name:    < redated >
  Certificate Status:  Active
  Domain Status:
    Domain:     web.sub1.domain1.com
    Status:     Active
    Domain:     web.sub1.domain2.com
    Status:     Active
    Domain:     web.sub2.domain2.com
    Status:     Active
    Domain:     web.sub1.domain3.com
    Status:     Active
  Expire Time:  2021-07-30T00:54:02.000-07:00

标签: kubernetesgoogle-compute-enginegoogle-kubernetes-engine

解决方案


正如 John Hanley 提到的,您无法更新 SSL 证书。Google API for SSL 证书没有更新方法。所以删除了资源使用kubectl delete -f <cert>.yaml并再次创建它kubectl apply -f <cert>.yaml并且它工作


推荐阅读