Skip to content

Helm Uninstall/Reinstall Refactor

Wesley Holman requested to merge aws-minio-helm-upgrade into aws-develop

The pipeline was always performing helm uninstall osdu-deploy followed by helm install osdu-deploy, when executing the stage to install to the EKS cluster. Doing install without uninstall resulted in conflicts in environments with previous deployments, and doing uninstall on fresh environments with no prior deployments also caused errors.

To remedy this, it was proposed to resolve minio and active-mq to support helm upgrade --install, but this was disqualified, because of the following documentation: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#label-selector-updates "Note: In API version apps/v1, a Deployment's label selector is immutable after it gets created."

Instead, we poll helm status for previous releases and check its exit code. If it finds at least one release (exit code 0), it prints to logs and performs the uninstall (failing on uninstall if it encounters other issues). If no releases are found (e.g. a clean environment), then a bare helm install with no uninstall is performed.

The old workaround of blindly masking helm uninstall every time was opaque- true helm uninstall errors should fail the pipeline, if and only if a prior release exists.

Merge request reports