Skip to content

[rollout-operator] add deployment annotations + allow not to create crds#4133

Open
DrFaust92 wants to merge 4 commits intografana:mainfrom
DrFaust92:main
Open

[rollout-operator] add deployment annotations + allow not to create crds#4133
DrFaust92 wants to merge 4 commits intografana:mainfrom
DrFaust92:main

Conversation

@DrFaust92
Copy link
Copy Markdown
Contributor

add deployment annotations + allow not to create crds

for clusters with instances of rollout operator, manage CRDs once

@DrFaust92 DrFaust92 requested a review from a team as a code owner February 20, 2026 18:31
…e configuration

Signed-off-by: drfaust92 <ilia.lazebnik@gmail.com>
…e configuration

Signed-off-by: drfaust92 <ilia.lazebnik@gmail.com>
…e configuration

Signed-off-by: drfaust92 <ilia.lazebnik@gmail.com>
Signed-off-by: Ilia Lazebnik <Ilia.lazebnik@gmail.com>
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think there might be some extra spaces in front of annotations

@tcp13equals2
Copy link
Copy Markdown
Contributor

hey @DrFaust92 ... could you double check on this PR. I don't think helm allows you add templating to the files in the crds directory.

See https://helm.sh/docs/chart_best_practices/custom_resource_definitions/

With the arrival of Helm 3, we removed the old crd-install hooks for a more simple methodology. There is now a special directory called crds that you can create in your chart to hold your CRDs. These CRDs are not templated, but will be installed by default when running a helm install for the chart. If the CRD already exists, it will be skipped with a warning. If you wish to skip the CRD installation step, you can pass the --skip-crds flag.

The challenge with the crds is that if you move them into the templates folder then helm has ordering problems, as the crds need to be installed first.

@DrFaust92
Copy link
Copy Markdown
Contributor Author

Good point! You're right that Helm doesn't template files in the crds/ directory.

However, a common pattern used by other charts (e.g., kube-prometheus-stack) is to use a CRDs subchart that:

  1. Keeps plain CRD YAMLs in crds/crds/ for initial install (no templating)
  2. Uses a pre-upgrade Job in crds/templates/upgrade/ to handle CRD updates on subsequent upgrades

I can refactor this PR to follow a similar approach — moving the CRDs into templates/ with the conditional flag, or adopting the subchart pattern. What would you prefer?

@tcp13equals2
Copy link
Copy Markdown
Contributor

Good point! You're right that Helm doesn't template files in the crds/ directory.

However, a common pattern used by other charts (e.g., kube-prometheus-stack) is to use a CRDs subchart that:

  1. Keeps plain CRD YAMLs in crds/crds/ for initial install (no templating)
  2. Uses a pre-upgrade Job in crds/templates/upgrade/ to handle CRD updates on subsequent upgrades

I can refactor this PR to follow a similar approach — moving the CRDs into templates/ with the conditional flag, or adopting the subchart pattern. What would you prefer?

Hi @DrFaust92 - sorry for a delayed reply. Re your suggested refactor, sure I would be interested in seeing how this looks. Thank you!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants