Skip to content

Remove zoekt-dynamic-indexserver. Release 1.0.0

Dmitry Gruzd requested to merge remove-dynamic-indexserver into main

What does this MR do and why?

This MR removes zoekt-dynamic-indexserver. This is a breaking change because k8s refuses to update volumeClaimTemplates

Error: UPGRADE FAILED: cannot patch "gitlab-zoekt" with kind StatefulSet: StatefulSet.apps "gitlab-zoekt" is invalid: spec: Forbidden: updates to statefulset spec for fields other than 'replicas', 'ordinals', 'template', 'updateStrategy', 'persistentVolumeClaimRetentionPolicy' and 'minReadySeconds' are forbidden

Important

Before this MR is released in the main helm chart, we have to execute kubectl delete StatefulSet gitlab-zoekt --cascade=orphan to allow the upgrade to happen during the next deploy. This will be done without any downtime since the original Pods and PersistentVolumeClaims will be kept (due to --cascade=orphan).

How to set up and validate locally

  1. Checkout the main branch
    git checkout main
  2. Uninstall the chart if it's installed
    helm uninstall gitlab-zoekt --wait &> /dev/null
  3. Install the chart
    helm install gitlab-zoekt . --set replicas=2 --wait > /dev/null
  4. Check out the names of the containers in the stateful set
    kubectl get po gitlab-zoekt-0 -o yaml | yq -P '.spec.containers[].name'
  5. Check out the branch of this MR
    git checkout remove-dynamic-indexserver
  6. Attempt to upgrade the chart
    helm upgrade gitlab-zoekt . --reuse-values --wait > /dev/null
  7. It should fail with the invalid StatefulSet error
  8. Delete the stateful set manually, but keep the pods around
    kubectl delete StatefulSet gitlab-zoekt --cascade=orphan
  9. Upgrade the chart again
    helm upgrade gitlab-zoekt . --reuse-values --wait > /dev/null
  10. Check out the names of the containers in the stateful set. This time you shouldn't see zoekt-dynamic-indexserver
    kubectl get po gitlab-zoekt-0 -o yaml | yq -P '.spec.containers[].name'
  11. Clean up the PVC's that were used by zoekt-dynamic-indexserver
    kubectl delete pvc zoekt-data-gitlab-zoekt-0 zoekt-data-gitlab-zoekt-1

demo

Edited by Jason Plum

Merge request reports

Loading