Skip to content

Commit f1ef63e

Browse files
authored
helm(v4): Split fluent-operator-crds chart into separate charts for fluentd and fluent-bit CRDs (#1929)
1 parent 1c4c86b commit f1ef63e

37 files changed

Lines changed: 354 additions & 230 deletions

Makefile

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

README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -174,17 +174,20 @@ kubectl apply --server-side --force-conflicts -f fluent-operator/crds/
174174
helm upgrade fluent-operator fluent/fluent-operator -n fluent
175175
```
176176

177-
**Advanced installation** — full Helm lifecycle management of CRDs via the separate `fluent-operator-crds` chart:
177+
**Advanced installation** — full Helm lifecycle management of CRDs via the separate `fluent-operator-fluent-bit-crds` and `fluent-operator-fluentd-crds` charts:
178178

179179
```shell
180-
# Step 1: install CRDs as a separately managed release
181-
helm install fluent-operator-crds fluent/fluent-operator-crds -n fluent --create-namespace
180+
# Step 1: install Fluent Bit CRDs as a separately managed release
181+
helm install fluent-operator-fluent-bit-crds fluent/fluent-operator-fluent-bit-crds -n fluent --create-namespace
182182

183-
# Step 2: install the operator, skipping CRDs (already installed above)
183+
# Step 2: install Fluentd CRDs as a separately managed release (optional)
184+
helm install fluent-operator-fluentd-crds fluent/fluent-operator-fluentd-crds -n fluent
185+
186+
# Step 3: install the operator, skipping CRDs (already installed above)
184187
helm install fluent-operator fluent/fluent-operator -n fluent --skip-crds
185188
```
186189

187-
With this approach, CRDs are upgraded with `helm upgrade fluent-operator-crds` and can be protected from deletion with `--set additionalAnnotations."helm\.sh/resource-policy"=keep`.
190+
With this approach, CRDs are upgraded with `helm upgrade fluent-operator-fluent-bit-crds` / `helm upgrade fluent-operator-fluentd-crds` and can be protected from deletion with `--set additionalAnnotations."helm\.sh/resource-policy"=keep`.
188191

189192
See the [MIGRATION-v4.md](charts/fluent-operator/MIGRATION-v4.md) guide for more information on upgrading from v3.x.
190193

charts/fluent-operator-crds/_docs.md

Lines changed: 0 additions & 44 deletions
This file was deleted.
File renamed without changes.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Fluent Operator CRDs (Fluent Bit) Helm Chart Changelog
2+
3+
> [!NOTE]
4+
> All notable changes to this project will be documented in this file; the format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
5+
6+
<!--
7+
### Added - For new features.
8+
### Changed - For changes in existing functionality.
9+
### Deprecated - For soon-to-be removed features.
10+
### Removed - For now removed features.
11+
### Fixed - For any bug fixes.
12+
### Security - In case of vulnerabilities.
13+
-->
14+
15+
## [UNRELEASED]
16+
17+
## [v4.0.0] - 2026-04-19
18+
19+
### Changed
20+
21+
- Initial release of v4 chart
22+
23+
<!--
24+
RELEASE LINKS
25+
-->
26+
[UNRELEASED]: https://github.com/fluent/helm-charts/tree/main/charts/fluent-operator-crds-fluent-bit
27+
[v4.0.0]: https://github.com/fluent/helm-charts/releases/tag/fluent-operator-crds-fluent-bit-4.0.0
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
apiVersion: v2
2+
name: fluent-operator-fluent-bit-crds
3+
description: Custom Resource Definitions (CRDs) for Fluent Bit. Provides full Helm lifecycle management for all Fluent Bit CRDs used by Fluent Operator.
4+
type: application
5+
version: 0.0.0-dev.0 # This is a development chart which gets released and versioned in the fluent/helm-charts repo
6+
# renovate: datasource=docker depName=ghcr.io/fluent/fluent-operator/fluent-operator
7+
appVersion: 3.7.0
8+
keywords:
9+
- logging
10+
- fluent-bit
11+
- fluent-operator
12+
- crds
13+
home: https://github.com/fluent/fluent-operator
14+
icon: https://raw.githubusercontent.com/fluent/fluent-operator/master/docs/images/fluent-operator-icon.svg
15+
sources:
16+
- https://github.com/fluent/fluent-operator/tree/master/charts/fluent-operator-fluent-bit-crds
17+
maintainers:
18+
- name: wenchajun
19+
email: dehaocheng@kubesphere.io
20+
- name: marcofranssen
21+
email: marco.franssen@gmail.com
22+
url: https://marcofranssen.nl
23+
- name: joshuabaird
24+
email: joshbaird@gmail.com
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
## Installation
2+
3+
### Install Fluent Bit CRDs
4+
5+
```bash
6+
helm install fluent-operator-crds-fluent-bit fluent/fluent-operator-crds-fluent-bit
7+
```
8+
9+
## Protecting CRDs from Deletion
10+
11+
To prevent CRDs from being deleted on `helm uninstall`:
12+
13+
```bash
14+
helm install fluent-operator-crds-fluent-bit fluent/fluent-operator-crds-fluent-bit \
15+
--set additionalAnnotations."helm\.sh/resource-policy"=keep
16+
```
17+
18+
With this annotation, Helm will preserve the CRDs even if the chart is uninstalled.
19+
20+
## Using with fluent-operator
21+
22+
After installing the CRDs with this chart, install the operator with `--skip-crds`:
23+
24+
```bash
25+
# Step 1: Install Fluent Bit CRDs
26+
helm install fluent-operator-crds-fluent-bit fluent/fluent-operator-crds-fluent-bit
27+
28+
# Step 2: Install operator (skip CRDs since already installed)
29+
helm install fluent-operator fluent/fluent-operator --skip-crds
30+
```

charts/fluent-operator-crds/templates/fluent-bit/fluentbit.fluent.io_clusterfilters.yaml renamed to charts/fluent-operator-fluent-bit-crds/templates/fluentbit.fluent.io_clusterfilters.yaml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
{{- if .Values.fluentbit.enabled }}
21
apiVersion: apiextensions.k8s.io/v1
32
kind: CustomResourceDefinition
43
metadata:
4+
{{- with .Values.additionalAnnotations }}
55
annotations:
6-
{{- with .Values.additionalAnnotations }}
7-
{{- toYaml . | nindent 4 }}
8-
{{- end }}
6+
{{- toYaml . | nindent 4 }}
7+
{{- end }}
98
name: clusterfilters.fluentbit.fluent.io
109
spec:
1110
group: fluentbit.fluent.io
@@ -976,4 +975,3 @@ spec:
976975
type: object
977976
served: true
978977
storage: true
979-
{{- end }}

charts/fluent-operator-crds/templates/fluent-bit/fluentbit.fluent.io_clusterfluentbitconfigs.yaml renamed to charts/fluent-operator-fluent-bit-crds/templates/fluentbit.fluent.io_clusterfluentbitconfigs.yaml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
{{- if .Values.fluentbit.enabled }}
21
apiVersion: apiextensions.k8s.io/v1
32
kind: CustomResourceDefinition
43
metadata:
4+
{{- with .Values.additionalAnnotations }}
55
annotations:
6-
{{- with .Values.additionalAnnotations }}
7-
{{- toYaml . | nindent 4 }}
8-
{{- end }}
6+
{{- toYaml . | nindent 4 }}
7+
{{- end }}
98
name: clusterfluentbitconfigs.fluentbit.fluent.io
109
spec:
1110
group: fluentbit.fluent.io
@@ -451,4 +450,3 @@ spec:
451450
type: object
452451
served: true
453452
storage: true
454-
{{- end }}

charts/fluent-operator-crds/templates/fluent-bit/fluentbit.fluent.io_clusterinputs.yaml renamed to charts/fluent-operator-fluent-bit-crds/templates/fluentbit.fluent.io_clusterinputs.yaml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
{{- if .Values.fluentbit.enabled }}
21
apiVersion: apiextensions.k8s.io/v1
32
kind: CustomResourceDefinition
43
metadata:
4+
{{- with .Values.additionalAnnotations }}
55
annotations:
6-
{{- with .Values.additionalAnnotations }}
7-
{{- toYaml . | nindent 4 }}
8-
{{- end }}
6+
{{- toYaml . | nindent 4 }}
7+
{{- end }}
98
name: clusterinputs.fluentbit.fluent.io
109
spec:
1110
group: fluentbit.fluent.io
@@ -1017,4 +1016,3 @@ spec:
10171016
type: object
10181017
served: true
10191018
storage: true
1020-
{{- end }}

0 commit comments

Comments
 (0)