Skip to content

Conversation

nmanoogian
Copy link
Contributor

The DKO Helm chart automatically generates the doppler-operator-system namespace during installation. We'd like to start respecting the Helm installation namespace in v2 of the operator but if we simply drop the doppler-operator-system namespace manifest from our chart, it'll be destroyed from user installations (along with any DopplerSecret resources and secrets inside).

We're adding helm.sh/resource-policy: keep to allow future versions of the chart to be upgraded or uninstalled without destroying the doppler-operator-system namespace.

# Inject 'helm.sh/resource-policy: keep' into doppler-operator-system namespace to prevent it from being destroyed if chart is uninstalled.
# This will also allow future versions of the chart to remove this resource entirely.
$(YQ) e 'select(.kind == "Namespace") | .metadata.annotations."helm.sh/resource-policy" = "keep"' dist/recommended.yaml > $(CHART_DIR)/templates/namespace.yaml
$(YQ) e 'select(.kind != "CustomResourceDefinition" and .kind != "Namespace")' dist/recommended.yaml > $(CHART_DIR)/templates/all.yaml
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check/question: With the removal of the Namespace from all.yaml, will we need to do anything else for helm users (new and existing) to pick up the new namespace.yaml file?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question! The filenames in our helm chart should not matter. Helm will render all of the templates and send the manifests to Kubernetes (where they'll be updated in-place). In my testing, upgrading to this version simply adds the new annotation.

@seslattery, can you confirm my understanding?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants