Migrating from Helm v2 to Helm v3
You can use Helm 2to3 plugin to migrate Helm 2 GitLab releases to Helm 3:
helm 2to3 convert YOUR-GITLAB-RELEASE
Known Issues
After migration the subsequent upgrades may fail with an error similar to the following:
Error: UPGRADE FAILED: cannot patch "..." with kind Deployment: Deployment.apps "..." is invalid: spec.selector:
Invalid value: v1.LabelSelector{...}: field is immutable
or
Error: UPGRADE FAILED: cannot patch "..." with kind StatefulSet: StatefulSet.apps "..." is invalid:
spec: Forbidden: updates to statefulset spec for fields other than 'replicas', 'template', and 'updateStrategy' are forbidden
This is due to known issues with Helm 2 to 3 migration in Cert Manager
and Redis dependencies. In a nutshell, the heritage label
on some Deployments and StatefulSets are immutable and can not be changed from Tiller (set by Helm 2) to Helm
(set by Helm 3). So they must be replaced forcefully.
To work around this use the following instructions:
- Replace cert-manager Deployments (when enabled).
kubectl get deployments -l app=cert-manager -o yaml | sed "s/Tiller/Helm/g" | kubectl replace --force=true -f -
kubectl get deployments -l app=cainjector -o yaml | sed "s/Tiller/Helm/g" | kubectl replace --force=true -f -
- (Optional) Set
persistentVolumeReclaimPolicytoRetainon the PV that is claimed by Redis StatefulSet. This is to ensure that the PV won’t be deleted inadvertently.
kubectl patch pv <PV-NAME> -p '{"spec":{"persistentVolumeReclaimPolicy":"Retain"}}'
- Set
heritagelabel of the existing Redis PVC toHelm.
kubectl label pvc -l app=redis --overwrite heritage=Helm
- Replace Redis StatefulSet without cascading.
kubectl get statefulsets.apps -l app=redis -o yaml | sed "s/Tiller/Helm/g" | kubectl replace --force=true --cascade=false -f -