web-dev-qa-db-fra.com

Mise à niveau de Helm stable / cert-manager vers jetstack / cert-manager

Nous avons un cluster de production AKS qui a un stable/cert-manager graphique de barre installé pour permettre l'utilisation des certificats Let's Encrypt. La version actuelle installée est cert-manager-v0.6.0 dans le kube-system espace de noms.

Let's Encrypt consiste à arrêter la prise en charge du trafic à partir de la version pré-8.0 de cert-manager à partir du 1er novembre 2019.

Je voudrais mettre à niveau mais la dernière version de graphique stable disponible est v0.6.7. Il semble que la voie à suivre consiste à passer à jetstack/cert-manager.

Comment est-ce que j'approche le mieux cela? Dois-je désinstaller la version actuelle de stable/cert-manager graphique et installation à partir de zéro avec le jetstack/cert-manager? Toute ressource sur la façon de résoudre ce problème sans interruption de la production serait très appréciée. Veuillez me faire savoir si je peux fournir plus de détails.

6
RVid

Pour tous ceux qui posent la même question, j'ai essayé d'effectuer une installation propre sur mon cluster de test et cela semblait fonctionner assez bien. J'ai trouvé le nom de ma version de la barre en exécutant helm list

j'ai ensuite effectué les étapes suivantes:

1. Sauvegarde :

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

Source

2.Effacer :

# 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

décrit à l'étape 2 ici

3.Installez une nouvelle version de 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

décrit ici

4.Restaurer :

J'ai essayé de courir

kubectl apply -f cert-manager-backup.yaml

comme décrit ici mais cette étape n'a pas vraiment fonctionné pour moi. Les émetteurs ont été créés (auto-signés et CA) mais je n'ai pas pu recréer les Certificates et ClusterIssuer. Ce sont les erreurs que j'ai reçues:

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

J'avais mes fichiers yaml d'origine et j'ai pu créer les ClusterIssuer et Certificate en les appliquant

2
RVid

Je peux confirmer que ce qui précède fonctionne. (Réponse @RVid)

Cependant, j'ai mis à niveau 0.5.0 à 0.9.1 et j'ai dû créer un espace de noms séparé pour avoir une mise à niveau sans interruption.

#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

La nouvelle instance du gestionnaire de certificats commencera à synchroniser tous les certificats que vous avez sans détruire les secrets. Finalement, tous les certificats seront renouvelés avec un nouveau gestionnaire de cert.

À votre santé.

1
bzumby