You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/book/src/plugins/available/helm-v1-alpha.md
+25Lines changed: 25 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -50,6 +50,31 @@ under the [testdata][testdata] directory on the root directory of the Kubebuilde
50
50
under `dist/chart/values.yaml`, and the `templates/manager/manager.yaml`, you will need to manually reapply your customizations on top
51
51
of the latest changes after regenerating the Helm chart.
52
52
53
+
<asideclass="note">
54
+
<H1> Why CRDs are added under templates? </H1>
55
+
56
+
Although [Helm best practices](https://helm.sh/docs/chart_best_practices/custom_resource_definitions/#method-1-let-helm-do-it-for-you) recommend placing CRDs under a top-level `crds/` directory, the Kubebuilder Helm plugin intentionally places them under `templates/crd`.
57
+
58
+
The rationale is tied to how Helm itself handles CRDs.
59
+
By default, Helm will install CRDs once during the initial release,
60
+
but it will **ignore CRD changes** on subsequent upgrades.
61
+
62
+
This can lead to surprising behavior where chart upgrades silently
63
+
skip CRD updates, leaving clusters out of sync.
64
+
65
+
To avoid endorsing this behavior, the Kubebuilder plugin follows the approach of packaging
66
+
CRDs inside `templates/`. In this mode, Helm treats CRDs like
67
+
any other resource, ensuring they are applied and upgraded as expected.
68
+
While this prevents mixing CRDs and CRs of the same type in a single chart (since Helm cannot wait between creation steps), it ensures predictable and explicit lifecycle management of CRDs.
69
+
70
+
In short:
71
+
-**Helm `crds/` directory** → one-time install only, no upgrades.
72
+
-**Kubebuilder `templates/crd`** → CRDs managed like other manifests, upgrades included.
73
+
74
+
This design choice prioritizes correctness and maintainability over Helm's default convention,
75
+
while leaving room for future improvements (such as scaffolding separate charts for APIs and controllers).
Copy file name to clipboardExpand all lines: docs/book/src/plugins/available/helm-v2-alpha.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -116,7 +116,7 @@ The plugin creates a chart layout that matches your `config/`:
116
116
└── servicemonitor.yaml
117
117
```
118
118
119
-
<aside>
119
+
<asideclass="note">
120
120
<H1> Why CRDs are added under templates? </H1>
121
121
122
122
Although [Helm best practices](https://helm.sh/docs/chart_best_practices/custom_resource_definitions/#method-1-let-helm-do-it-for-you) recommend placing CRDs under a top-level `crds/` directory, the Kubebuilder Helm plugin intentionally places them under `templates/crd`.
@@ -137,7 +137,7 @@ In short:
137
137
-**Helm `crds/` directory** → one-time install only, no upgrades.
138
138
-**Kubebuilder `templates/crd`** → CRDs managed like other manifests, upgrades included.
139
139
140
-
This design choice prioritizes correctness and maintainability over Helm’s default convention,
140
+
This design choice prioritizes correctness and maintainability over Helm's default convention,
141
141
while leaving room for future improvements (such as scaffolding separate charts for APIs and controllers).
0 commit comments