@@ -263,8 +263,13 @@ When upgrading, manually apply CRD updates before upgrading the chart:
263263helm repo update
264264
265265# Extract and apply CRD updates
266+ # Note: --server-side --force-conflicts is required:
267+ # - --server-side: the v4 CRDs exceed the 262144-byte annotation limit of
268+ # client-side apply.
269+ # - --force-conflicts: Helm owns the existing CRD fields; kubectl must take
270+ # over management to apply the v4 schema changes.
266271helm pull fluent/fluent-operator --version 4.0.0 --untar
267- kubectl apply -f fluent-operator/crds/
272+ kubectl apply --server-side --force-conflicts - f fluent-operator/crds/
268273
269274# Then upgrade the chart
270275helm upgrade fluent-operator fluent/fluent-operator --version 4.0.0
@@ -341,15 +346,30 @@ helm upgrade fluent-operator fluent/fluent-operator --version 4.0.0
341346
342347### Migrating to Helm-Managed CRDs
343348
344- If you want to switch to full Helm management of CRDs:
349+ If you want to switch to full Helm lifecycle management of CRDs after upgrading to v4.0 :
345350
346351``` bash
347- # Step 1: Install the new CRDs chart (existing CRDs will be adopted)
352+ # Step 1: Apply v4 CRDs manually (see Upgrading Standard Installation above)
353+ kubectl apply --server-side --force-conflicts -f fluent-operator/crds/
354+
355+ # Step 2: Add Helm ownership metadata to all existing fluent.io CRDs.
356+ # Helm cannot adopt pre-existing cluster resources without this metadata.
357+ NAMESPACE=fluent # set to your release namespace
358+ kubectl get crds -o name | grep ' \.fluent\.io' | while read crd; do
359+ kubectl label " $crd " app.kubernetes.io/managed-by=Helm --overwrite
360+ kubectl annotate " $crd " \
361+ meta.helm.sh/release-name=fluent-operator-crds \
362+ meta.helm.sh/release-namespace=" ${NAMESPACE} " --overwrite
363+ done
364+
365+ # Step 3: Install the CRDs chart — it will adopt the annotated CRDs
348366helm install fluent-operator-crds fluent/fluent-operator-crds \
367+ --namespace " ${NAMESPACE} " \
349368 --set additionalAnnotations." helm\.sh/resource-policy" =keep
350369
351- # Step 2: Upgrade operator to v4.0 with --skip-crds
352- helm upgrade fluent-operator fluent/fluent-operator --version 4.0.0 --skip-crds
370+ # Step 4: Upgrade operator to v4.0 with --skip-crds
371+ helm upgrade fluent-operator fluent/fluent-operator --version 4.0.0 \
372+ --namespace " ${NAMESPACE} " --skip-crds
353373```
354374
355375### Fresh v4.0 Installation
0 commit comments