Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update helm chart version and clarify helm-related docs #1378

Merged
merged 3 commits into from
Oct 17, 2024
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
41 changes: 10 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,48 +152,27 @@ kubectl apply -f https://raw.githubusercontent.com/fluent/fluentbit-operator/mas

#### Deploy Fluent Operator with Helm

> Note: For the helm based install, Helm v3.2.1 or higher is needed.
> NOTE: For the helm based install, Helm v3.2.1 or higher is needed.

The Fluent Bit section of the Fluent Operator supports different CRI `docker`, `containerd`, and `CRI-O`.
`containerd` and `CRI-O` use the `CRI Log` format which is different with `docker`, they requires additional parser to parse JSON application logs. You should set different `containerRuntime` depending on your container runtime.

The default runtime is docker, you can choose other runtimes as follows.

If your container runtime is `containerd` or `cri-o`, you can set the `containerRuntime` parameter to `containerd` or `crio`. e.g.
To install or upgrade Fluent Operator using Helm:

```shell
helm install fluent-operator --create-namespace -n fluent charts/fluent-operator/ --set containerRuntime=containerd
```

Install through the online chart link:
export FLUENT_OPERATOR_CONTAINER_RUNTIME="containerd" # or "cri-o", "docker" depending on the container runtime being used (see `values.yaml`)

```shell
helm install fluent-operator --create-namespace -n fluent https://github.com/fluent/fluent-operator/releases/download/< version >/fluent-operator.tgz
helm repo add fluent https://fluent.github.io/helm-charts
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Use the fluent/helm-charts repo as a source for the Helm chart installation rather than a local copy of the chart.

helm upgrade --install fluent-operator fluent/fluent-operator \
--create-namespace \
--set containerRuntime=${FLUENT_OPERATOR_CONTAINER_RUNTIME}
```

> Please replace < version > with a actual version like v1.0.0

Fluent Operator CRDs will be installed by default when running a helm install for the chart. But if the CRD already exists, it will be skipped with a warning. So make sure you install the CRDs by yourself if you upgrade your Fluent Operator version.

By default the installation with Helm create all the CRDs (fluent-bit and fluentd ones).
If you do not intent to use one of the two components, it is possible to skip its CRDs and also to not start the controllers for it in the operator.
To achieve that `operator.disableComponentControllers` and `(fluent-bit/fluentd).crdsEnable` parameters can be provided:
By default, all CRDs required for Fluent Operator will be installed. To prevent `helm install` from installing CRDs, you can set `fluent-bit.crdsEnable` or `fluentd.crdsEnable` to `false`.

```shell
helm install fluent-operator --create-namespace -n fluent charts/fluent-operator/ --set operator.disableComponentControllers=fluent-bit,fluent-bit.crdsEnable=false
```
Helm [does not manage the lifecycle of CRDs](https://helm.sh/docs/chart_best_practices/custom_resource_definitions/), so if the Fluent Operator CRDs already exist, subsequent
chart upgrades will not add or remove CRDs even if they have changed. During upgrades, users should manually update CRDs:

> Note: During the upgrade process, if a CRD was previously created using the create operation, an error will occur during the apply operation. Using apply here allows the CRD to be replaced and created in its entirety in a single operation.

To replace the CRDs pull the current helm chart:
```
wget https://github.com/fluent/fluent-operator/releases/download/<version>/fluent-operator.tgz
Copy link
Collaborator

Choose a reason for hiding this comment

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

should we change here to the helm chart repo too?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Honestly, I think ultimately we should split the CRDs out into their own chart (eg, fluent-operator-crds) and include the CRDs as "templates" so that they can be upgraded just by doing a helm upgrade --install fluent fluent-operator-crds). This is a workaround that others are using to manage CRD updates/upgrades using Helm.

tar -xf fluent-operator.tgz
```

To update the CRDs, run the following command:

```shell
kubectl replace -f fluent-operator/crds
```

Expand Down
7 changes: 7 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,3 +118,10 @@ Finally, create a new release:
- Add file `setup.yaml` from `manifests/setup/setup.yaml` and then click "Publish release".

For patch releases, cherry-pick the commits from the release branch into the master branch.

### Publish updated Helm chart

This repo includes a "development" chart in the [charts/](./charts/fluent-operator/) directory. For each release, this chart must be published to the [fluent/helm-charts](https://github.com/fluent/helm-charts/tree/main/charts/fluent-operator/) repository which is where Fluent Operators install the chart from. This is currently a manual process. Follow these instructions to update and publish the chart:

* Bump `version` and `appVersion` in the [charts/fluet-operator/Chart.yaml](./charts/fluent-operator/Chart.yaml) file in this repo
* Manually "sync" (copy, open a PR) the local [chart](./charts/fluent-operator) to [fluent/helm-charts](https://github.com/fluent/helm-charts/tree/main/charts/fluent-operator/)
1 change: 1 addition & 0 deletions charts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +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.
45 changes: 20 additions & 25 deletions charts/fluent-operator/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,31 +1,26 @@
apiVersion: v2
name: fluent-operator
description: A Helm chart for Kubernetes

# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
# type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 3.1.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
appVersion: 3.1.0

description: Fluent Operator provides great flexibility in building a logging layer based on Fluent Bit and Fluentd.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

keywords:
- logging
- fluent-bit
- fluentd
- operator
version: 3.2.0
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Bumped version here.

appVersion: 3.2.0
icon: https://raw.githubusercontent.com/fluent/fluent-operator/master/docs/images/fluent-operator-icon.svg
home: https://www.fluentd.org/
sources:
- https://github.com/fluent/fluent-operator
maintainers:
- name: wenchajun
email: [email protected]
dependencies:
- name: fluent-bit-crds
repository: fluent-bit-crds
repository: "file://charts/fluent-bit-crds"
version: 3.2.0
condition: fluentbit.crdsEnable
- name: fluentd-crds
repository: fluentd-crds
condition: fluentd.crdsEnable
repository: "file://charts/fluentd-crds"
version: 3.2.0
condition: fluentd.crdsEnable