从 Helm stable/cert-manager 升级到 jetstack/cert-manager

Upgrading from Helm stable/cert-manager to jetstack/cert-manager

我们有一个生产 AKS 集群,其中安装了 stable/cert-manager helm chart 以允许使用 Let's Encrypt 证书。当前安装的版本是 kube-system 命名空间中的 cert-manager-v0.6.0

Let's Encrypt 将从 2019 年 11 月 1 日起停止支持来自 cert-manager pre 8.0 版本的流量。

我想升级,但最新可用的 stable 图表版本是 v0.6.7。似乎要走的路是切换到 jetstack/cert-manager.

我该如何最好地解决这个问题?我应该卸载当前的 stable/cert-manager 图表并使用 jetstack/cert-manager 从头开始​​安装吗?非常感谢任何有关如何在生产中不停机的情况下解决此问题的资源。如果我可以提供更多详细信息,请告诉我。

对于提出相同问题的任何人,我已尝试在我的测试集群上执行全新安装,这似乎工作得相当顺利。我通过 运行 helm list

找到了我的 helm 版本的名称

然后我执行了以下步骤:

1.Backup:

kubectl get -o yaml \
   --all-namespaces \
   issuer,clusterissuer,certificates,orders,challenges > cert-manager-backup.yaml

Source

2.Delete:

# Uninstall the Helm chart
helm delete --purge <your release name here>

# Ensure the cert-manager CustomResourceDefinition resources do not exist:
kubectl delete crd \
    certificates.certmanager.k8s.io \
    issuers.certmanager.k8s.io \
    clusterissuers.certmanager.k8s.io

在步骤 2 中描述here

3.Install 一个新的 jetstack 版本:

# Install the CustomResourceDefinition resources separately
kubectl apply -f https://raw.githubusercontent.com/jetstack/cert-manager/release-0.9/deploy/manifests/00-crds.yaml

# Create the namespace for cert-manager
kubectl create namespace cert-manager

# Label the cert-manager namespace to disable resource validation
kubectl label namespace cert-manager certmanager.k8s.io/disable-validation=true

# Add the Jetstack Helm repository
helm repo add jetstack https://charts.jetstack.io

# Update your local Helm chart repository cache
helm repo update

# Install the cert-manager Helm chart
helm install --name <your release name here> --namespace cert-manager --version v0.9.1 jetstack/cert-manager

描述here

4.Restore:

我试过了运行

kubectl apply -f cert-manager-backup.yaml

here所述,但这一步实际上对我来说并不完全有效。发行人已创建(自签名和 CA),但我无法重新创建 CertificatesClusterIssuer。这些是我收到的错误:

Error from server (InternalError): Internal error occurred: failed calling webhook "clusterissuers.admission.certmanager.k8s.io": the server is currently unable to handle the request
Error from server (InternalError): Internal error occurred: failed calling webhook "certificates.admission.certmanager.k8s.io": the server is currently unable to handle the request

我有我的原始 yaml 文件,并且能够通过应用它们来创建 ClusterIssuerCertificate

我可以确认以上内容有效。 (@RVid 回答)

不过,我已经将 0.5.0 升级到 0.9.1,并且必须创建一个单独的命名空间才能进行 'no-downtime' 升级。

#1 delete old CRDs
kubectl delete crd \
    certificates.certmanager.k8s.io \
    issuers.certmanager.k8s.io \
    clusterissuers.certmanager.k8s.io

#2 create SEPARATE namespace
$ kubectl create namespace cert-manager-new

#3 install new CRDs that corresponds to the new version of cert-manager

$ kubectl apply \
    -f https://raw.githubusercontent.com/jetstack/cert-manager/<VERSION>/deploy/manifests/00-crds.yaml


#4 ensure the NEW namespace has an additional label on it in order for the deployment to succeed
$ kubectl label namespace cert-manager-new certmanager.k8s.io/disable-validation="true"

#5 copy secrets to cert-manager-new namespace (For DNS, HTTP and Let's Encrypt account)

## Install the cert-manager helm chart
#  jetstack/cert-manager
$ helm install --name cert-manager-new --namespace cert-manager-new jetstack/cert-manager --values <your values file>

#6 apply ClusterIssuer with kubectl apply -f <file.yaml> 
Use config from: https://docs.cert-manager.io/en/latest/reference/issuers.html

证书管理器的新实例将开始同步您拥有的所有证书,而不会破坏机密。 最终,所有证书都将使用新的证书管理器进行更新。

干杯。