Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,10 @@ manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and Cust
$(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=manager-role webhook paths="./apis/fluentbit/..." output:crd:artifacts:config=config/crd/bases
$(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=manager-role webhook paths="./apis/fluentd/..." output:crd:artifacts:config=config/crd/bases
$(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=manager-role webhook paths="./apis/fluentbit/..." output:crd:artifacts:config=charts/fluent-operator/charts/fluent-bit-crds/crds
$(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=manager-role webhook paths="./apis/fluentd/..." output:crd:artifacts:config=charts/fluent-operator/charts/fluentd-crds/crds
$(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=manager-role webhook paths="./apis/fluentd/..." output:crd:artifacts:config=charts/fluentd-crds/templates
kubectl kustomize config/crd/bases/ | sed -e '/creationTimestamp/d' > manifests/setup/fluent-operator-crd.yaml
kubectl kustomize manifests/setup/ | sed -e '/creationTimestamp/d' > manifests/setup/setup.yaml
hack/mutate-crds.sh

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

update-helm-package: # update helm repo
./hack/update-helm-package.sh

.PHONY: helm-docs
helm-docs:
cd charts/fluentd-crds && helm-docs
2 changes: 1 addition & 1 deletion charts/README.md
Original file line number Diff line number Diff line change
@@ -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.
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.
6 changes: 3 additions & 3 deletions charts/fluent-operator/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ dependencies:
version: 3.5.0
condition: fluentbit.crdsEnable
- name: fluentd-crds
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added fluentd-crds as a dependency to the main chart. Instead of file:// references, we're pointing to the published chart and pinning to a specific version.

repository: "file://charts/fluentd-crds"
version: 3.5.0
condition: fluentd.crdsEnable
repository: https://fluent.github.io/helm-charts
condition: fluentd.enable && fluentd.crdsEnable
version: 0.1.0
56 changes: 53 additions & 3 deletions charts/fluent-operator/MIGRATION-v4.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@

## Overview

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.
Major changes/themes for v4.0:

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.

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).

## Breaking Changes

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

**Migration:**


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

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

## Migration Scenarios

### Scenario 1: Using Containerd (Default) - No Changes Needed
### Scenario 1: Using Containerd (Default) - No Changes Needed

```yaml
# v3.x
Expand Down Expand Up @@ -140,6 +143,53 @@ containerRuntime: docker
# to use the standard path
```

## Fluentd CRDs Moved to Separate Chart with Automatic Upgrades

**What Changed:**

- Fluentd CRDs moved from embedded sub-chart to separate `fluentd-crds` chart in the Fluent Helm repository
- CRDs relocated from `crds/` directory to `templates/` directory, changing their lifecycle behavior

**Impact:**

- **CRDs now upgrade automatically** with `helm upgrade` (previously required manual upgrade)
- **CRDs will be deleted on `helm uninstall`** (previously they were preserved).

**Who Is Affected:**

- All users who use Fluentd with the fluent-operator
- Users who rely on CRDs and custom resources persisting after chart uninstall

**Migration:**

Before installing or upgrading, ensure the Fluent Helm repository is added:

```bash
# Add the Fluent Helm repository (required for the dependency)
helm repo add fluent https://fluent.github.io/helm-charts
helm repo update

# Install or upgrade fluent-operator (CRDs installed automatically via dependency)
helm upgrade --install fluent-operator fluent/fluent-operator \
--version 4.0.0 \
--set fluentd.enable=true
```

**Note:** Helm will automatically manage the `fluentd-crds` dependency when `fluentd.enable=true` and `fluentd.crdsEnable=true` (default).

**Protecting CRDs from Deletion:**

To prevent CRDs from being deleted when the `fluentd-crds` chart is uninstalled, add the `helm.sh/resource-policy: keep` annotation:

```bash
helm upgrade --install fluent-operator fluent/fluent-operator \
--version 4.0.0 \
--set fluentd.enable=true \
--set fluentd-crds.additionalAnnotations."helm\.sh/resource-policy"=keep
```

With this annotation, Helm will preserve the CRDs and all Fluentd custom resources even if the chart is uninstalled.

## Forward Looking: Planned Changes in v5.0

**Future Change (v5.0):**
Expand Down
24 changes: 0 additions & 24 deletions charts/fluent-operator/charts/fluentd-crds/Chart.yaml

This file was deleted.

1 change: 0 additions & 1 deletion charts/fluent-operator/charts/fluentd-crds/values.yaml

This file was deleted.

22 changes: 22 additions & 0 deletions charts/fluentd-crds/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
apiVersion: v2
name: fluentd-crds
description: A helm chart for Fluentd custom resource definitions (CRDs) used by fluent-operator.
type: application
version: 0.1.0
appVersion: 0.1.0
keywords:
- logging
- fluentd
- fluent-bit
- fluent-operator
home: https://github.com/fluent/fluent-operator
icon: https://raw.githubusercontent.com/fluent/fluent-operator/master/docs/images/fluent-operator-icon.svg
sources:
- https://github.com/fluent/fluent-operator/tree/master/charts/fluentd-crds
maintainers:
- name: cw-guo
- name: marcofranssen
email: [email protected]
url: https://marcofranssen.nl
- name: joshuabaird
email: [email protected]
29 changes: 29 additions & 0 deletions charts/fluentd-crds/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# fluentd-crds

![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)

A helm chart for Fluentd custom resource definitions (CRDs) used by fluent-operator.

**Homepage:** <https://github.com/fluent/fluent-operator>

## Maintainers

| Name | Email | Url |
| ---- | ------ | --- |
| cw-guo | | |
| marcofranssen | <[email protected]> | <https://marcofranssen.nl> |
| joshuabaird | <[email protected]> | |

## Source Code

* <https://github.com/fluent/fluent-operator/tree/master/charts/fluentd-crds>

## Values

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| additionalAnnotations | object | `{}` | Additional annotations for the custom resource definitions. |

----------------------------------------------

Autogenerated from chart metadata using [helm-docs](https://github.com/norwoodj/helm-docs/).
20 changes: 20 additions & 0 deletions charts/fluentd-crds/README.md.gotmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{{ template "chart.header" . }}
{{ template "chart.deprecationWarning" . }}

{{ template "chart.badgesSection" . }}

{{ template "chart.description" . }}

{{ template "chart.homepageLine" . }}

{{ template "chart.maintainersSection" . }}

{{ template "chart.sourcesSection" . }}

{{ template "chart.requirementsSection" . }}

{{ template "chart.valuesSection" . }}

----------------------------------------------

Autogenerated from chart metadata using [helm-docs](https://github.com/norwoodj/helm-docs/).
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
{{- with .Values.additionalAnnotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
controller-gen.kubebuilder.io/version: v0.18.0
name: clusterfilters.fluentd.fluent.io
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
{{- with .Values.additionalAnnotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
controller-gen.kubebuilder.io/version: v0.18.0
name: clusterfluentdconfigs.fluentd.fluent.io
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
{{- with .Values.additionalAnnotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
controller-gen.kubebuilder.io/version: v0.18.0
name: clusterinputs.fluentd.fluent.io
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
{{- with .Values.additionalAnnotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
controller-gen.kubebuilder.io/version: v0.18.0
name: clusteroutputs.fluentd.fluent.io
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
{{- with .Values.additionalAnnotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
controller-gen.kubebuilder.io/version: v0.18.0
name: filters.fluentd.fluent.io
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
{{- with .Values.additionalAnnotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
controller-gen.kubebuilder.io/version: v0.18.0
name: fluentdconfigs.fluentd.fluent.io
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
{{- with .Values.additionalAnnotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
controller-gen.kubebuilder.io/version: v0.18.0
name: fluentds.fluentd.fluent.io
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
{{- with .Values.additionalAnnotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
controller-gen.kubebuilder.io/version: v0.18.0
name: inputs.fluentd.fluent.io
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
{{- with .Values.additionalAnnotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
controller-gen.kubebuilder.io/version: v0.18.0
name: outputs.fluentd.fluent.io
spec:
Expand Down
2 changes: 2 additions & 0 deletions charts/fluentd-crds/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# -- Additional annotations for the custom resource definitions.
additionalAnnotations: {}
12 changes: 12 additions & 0 deletions hack/mutate-crds.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash

# Support additional annotations for CRDs

CRDS=(
charts/fluentd-crds/templates/*.yaml
)
for CRD in "${CRDS[@]}"
do
[[ -f "$CRD" ]] || continue
awk '{print} / annotations:/ && !n {print " {{- with .Values.additionalAnnotations }}\n {{- toYaml . | nindent 4 }}\n {{- end }}"; n++}' "$CRD" > "$CRD.new" && mv "$CRD.new" "$CRD"
done
Loading