Skip to content

Commit d40aa13

Browse files
authored
helm(v4): Breaks fluentd-crds out into separate top-level chart (#1790)
* Generate and mutate manifests. Signed-off-by: Josh Baird <[email protected]> * Add fluentd-crds chart. Signed-off-by: Josh Baird <[email protected]> * Remove legacy fluentd-crd sub-chart. Signed-off-by: Josh Baird <[email protected]> * Update Migration docs. Signed-off-by: Josh Baird <[email protected]> * Add dep. Signed-off-by: Josh Baird <[email protected]> * Markdownlint. Signed-off-by: Josh Baird <[email protected]> * Update MIGRATION. Signed-off-by: Josh Baird <[email protected]> * Reorg. Signed-off-by: Josh Baird <[email protected]> --------- Signed-off-by: Josh Baird <[email protected]>
1 parent 5f11733 commit d40aa13

21 files changed

+175
-33
lines changed

Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,10 @@ manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and Cust
5757
$(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=manager-role webhook paths="./apis/fluentbit/..." output:crd:artifacts:config=config/crd/bases
5858
$(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=manager-role webhook paths="./apis/fluentd/..." output:crd:artifacts:config=config/crd/bases
5959
$(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=manager-role webhook paths="./apis/fluentbit/..." output:crd:artifacts:config=charts/fluent-operator/charts/fluent-bit-crds/crds
60-
$(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=manager-role webhook paths="./apis/fluentd/..." output:crd:artifacts:config=charts/fluent-operator/charts/fluentd-crds/crds
60+
$(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=manager-role webhook paths="./apis/fluentd/..." output:crd:artifacts:config=charts/fluentd-crds/templates
6161
kubectl kustomize config/crd/bases/ | sed -e '/creationTimestamp/d' > manifests/setup/fluent-operator-crd.yaml
6262
kubectl kustomize manifests/setup/ | sed -e '/creationTimestamp/d' > manifests/setup/setup.yaml
63+
hack/mutate-crds.sh
6364

6465
.PHONY: generate
6566
generate: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
@@ -384,3 +385,7 @@ helm-e2e: ginkgo # make helm e2e tests
384385

385386
update-helm-package: # update helm repo
386387
./hack/update-helm-package.sh
388+
389+
.PHONY: helm-docs
390+
helm-docs:
391+
cd charts/fluentd-crds && helm-docs

charts/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
The Helm charts in this directory are considered "development" and are [synced](../RELEASE.md) to the [fluent/helm-charts](https://github.com/fluent/helm-charts/tree/main/charts/fluent-operator/) repository for each release. Users are instructed to install the Fluent Operator Helm chart from the [fluent/helm-charts](https://github.com/fluent/helm-charts/tree/main/charts/fluent-operator/) repo.
1+
The Helm charts in this directory are considered "development" and are [synced](../RELEASE.md) to the [fluent/helm-charts](https://github.com/fluent/helm-charts/tree/main/charts/fluent-operator/) repository for each release. Users are instructed to install the Fluent Operator Helm chart from the [fluent/helm-charts](https://github.com/fluent/helm-charts/tree/main/charts/fluent-operator/) repo.

charts/fluent-operator/Chart.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@ dependencies:
2727
version: 3.5.0
2828
condition: fluentbit.crdsEnable
2929
- name: fluentd-crds
30-
repository: "file://charts/fluentd-crds"
31-
version: 3.5.0
32-
condition: fluentd.crdsEnable
30+
repository: https://fluent.github.io/helm-charts
31+
condition: fluentd.enable && fluentd.crdsEnable
32+
version: 0.1.0

charts/fluent-operator/MIGRATION-v4.md

Lines changed: 53 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22

33
## Overview
44

5-
v4.0 simplifies container runtime configuration by removing dynamic detection for the `docker` runtime via initContainers and adopting static, configuration-based paths. The `docker` runtime has not been used widely since Kubernetes v1.24 (2022) and modern Kubernetes distributions now use the `containerd` runtime.
5+
Major changes/themes for v4.0:
6+
7+
1. **Container Runtime Simplification**: Removes dynamic detection for the `docker` runtime via initContainers and adopts static, configuration-based paths. The `docker` runtime has not been used widely since Kubernetes v1.24 (2022) and modern Kubernetes distributions now use the `containerd` runtime.
8+
9+
2. **fluentd-crd lifecycle changes**: Fluentd CRDs have been moved from an embedded sub-chart to a separate, independently versioned `fluentd-crds` chart hosted in the Fluent Helm repository. CRDs are now in the `templates/` directory, enabling automatic upgrades via `helm upgrade`. **Important:** CRDs will now be deleted on `helm uninstall` unless protected with the `helm.sh/resource-policy: keep` annotation (see below for details).
610

711
## Breaking Changes
812

@@ -25,7 +29,6 @@ v4.0 simplifies container runtime configuration by removing dynamic detection fo
2529

2630
**Migration:**
2731

28-
2932
The containerRuntime now defaults to `containerd`. In `v3.x` the implicit default was `docker`. Use `containerRuntime: docker` to maintain `v3.x` behavior.
3033

3134
```diff
@@ -102,7 +105,7 @@ v4.0 uses the following default paths based on the configured `containerRuntime`
102105

103106
## Migration Scenarios
104107

105-
### Scenario 1: Using Containerd (Default) - No Changes Needed
108+
### Scenario 1: Using Containerd (Default) - No Changes Needed
106109

107110
```yaml
108111
# v3.x
@@ -140,6 +143,53 @@ containerRuntime: docker
140143
# to use the standard path
141144
```
142145

146+
## Fluentd CRDs Moved to Separate Chart with Automatic Upgrades
147+
148+
**What Changed:**
149+
150+
- Fluentd CRDs moved from embedded sub-chart to separate `fluentd-crds` chart in the Fluent Helm repository
151+
- CRDs relocated from `crds/` directory to `templates/` directory, changing their lifecycle behavior
152+
153+
**Impact:**
154+
155+
- **CRDs now upgrade automatically** with `helm upgrade` (previously required manual upgrade)
156+
- **CRDs will be deleted on `helm uninstall`** (previously they were preserved).
157+
158+
**Who Is Affected:**
159+
160+
- All users who use Fluentd with the fluent-operator
161+
- Users who rely on CRDs and custom resources persisting after chart uninstall
162+
163+
**Migration:**
164+
165+
Before installing or upgrading, ensure the Fluent Helm repository is added:
166+
167+
```bash
168+
# Add the Fluent Helm repository (required for the dependency)
169+
helm repo add fluent https://fluent.github.io/helm-charts
170+
helm repo update
171+
172+
# Install or upgrade fluent-operator (CRDs installed automatically via dependency)
173+
helm upgrade --install fluent-operator fluent/fluent-operator \
174+
--version 4.0.0 \
175+
--set fluentd.enable=true
176+
```
177+
178+
**Note:** Helm will automatically manage the `fluentd-crds` dependency when `fluentd.enable=true` and `fluentd.crdsEnable=true` (default).
179+
180+
**Protecting CRDs from Deletion:**
181+
182+
To prevent CRDs from being deleted when the `fluentd-crds` chart is uninstalled, add the `helm.sh/resource-policy: keep` annotation:
183+
184+
```bash
185+
helm upgrade --install fluent-operator fluent/fluent-operator \
186+
--version 4.0.0 \
187+
--set fluentd.enable=true \
188+
--set fluentd-crds.additionalAnnotations."helm\.sh/resource-policy"=keep
189+
```
190+
191+
With this annotation, Helm will preserve the CRDs and all Fluentd custom resources even if the chart is uninstalled.
192+
143193
## Forward Looking: Planned Changes in v5.0
144194

145195
**Future Change (v5.0):**

charts/fluent-operator/charts/fluentd-crds/Chart.yaml

Lines changed: 0 additions & 24 deletions
This file was deleted.

charts/fluent-operator/charts/fluentd-crds/values.yaml

Lines changed: 0 additions & 1 deletion
This file was deleted.

charts/fluentd-crds/Chart.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
apiVersion: v2
2+
name: fluentd-crds
3+
description: A helm chart for Fluentd custom resource definitions (CRDs) used by fluent-operator.
4+
type: application
5+
version: 0.1.0
6+
appVersion: 0.1.0
7+
keywords:
8+
- logging
9+
- fluentd
10+
- fluent-bit
11+
- fluent-operator
12+
home: https://github.com/fluent/fluent-operator
13+
icon: https://raw.githubusercontent.com/fluent/fluent-operator/master/docs/images/fluent-operator-icon.svg
14+
sources:
15+
- https://github.com/fluent/fluent-operator/tree/master/charts/fluentd-crds
16+
maintainers:
17+
- name: cw-guo
18+
- name: marcofranssen
19+
20+
url: https://marcofranssen.nl
21+
- name: joshuabaird
22+

charts/fluentd-crds/README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# fluentd-crds
2+
3+
![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.1.0](https://img.shields.io/badge/AppVersion-0.1.0-informational?style=flat-square)
4+
5+
A helm chart for Fluentd custom resource definitions (CRDs) used by fluent-operator.
6+
7+
**Homepage:** <https://github.com/fluent/fluent-operator>
8+
9+
## Maintainers
10+
11+
| Name | Email | Url |
12+
| ---- | ------ | --- |
13+
| cw-guo | | |
14+
| marcofranssen | <[email protected]> | <https://marcofranssen.nl> |
15+
| joshuabaird | <[email protected]> | |
16+
17+
## Source Code
18+
19+
* <https://github.com/fluent/fluent-operator/tree/master/charts/fluentd-crds>
20+
21+
## Values
22+
23+
| Key | Type | Default | Description |
24+
|-----|------|---------|-------------|
25+
| additionalAnnotations | object | `{}` | Additional annotations for the custom resource definitions. |
26+
27+
----------------------------------------------
28+
29+
Autogenerated from chart metadata using [helm-docs](https://github.com/norwoodj/helm-docs/).
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{{ template "chart.header" . }}
2+
{{ template "chart.deprecationWarning" . }}
3+
4+
{{ template "chart.badgesSection" . }}
5+
6+
{{ template "chart.description" . }}
7+
8+
{{ template "chart.homepageLine" . }}
9+
10+
{{ template "chart.maintainersSection" . }}
11+
12+
{{ template "chart.sourcesSection" . }}
13+
14+
{{ template "chart.requirementsSection" . }}
15+
16+
{{ template "chart.valuesSection" . }}
17+
18+
----------------------------------------------
19+
20+
Autogenerated from chart metadata using [helm-docs](https://github.com/norwoodj/helm-docs/).

0 commit comments

Comments
 (0)