Skip to content

Conversation

@joshuabaird
Copy link
Collaborator

@joshuabaird joshuabaird commented Nov 12, 2025

Fixes #1670 (in combination with PR #1773).

Because this PR contains breaking changes, it bumps the helm chart to v4.0.0-RC.1. There are additional changes we wish to make with v4.0 of the helm chart -- this is the first.

What?

This PR modernizes and simplifies the chart's process for configuring containerRuntime which influences how Fluentbit collects logs from nodes:

  • Changes the default for containerRuntime from docker to containerd -- support for the docker runtime was removed in Kubernetes v1.24 (2022) and modern distributions use containerd
  • Adds a CONTAINER_LOG_PATH environment variable to the fluent-operator Deployment which is used by Support setting CONTAINER_LOG_PATH via an environment variable #1773
  • Removes initContainers on the fluent-operator Deployment that were used to dynamically configure the the log location for the docker containerRuntime
  • Provides backwards compatibility with fluent-operator <=3.5 by providing a fluent-operator-env ConfigMap that exposes CONTAINER_ROOT_DIR as an environment variable which is mounted to the FluentBit container(s) as a file
  • Simplifies the configuration for container log paths
    • Deprecated: operator.logPath.containerd and operator.logPath.crio
    • Added: operator.containerLogPath for direct path specification
    • New helper function automatically sets sensible defaults:
      • containerd/var/log/containers
      • crio/var/log/containers
      • docker/var/lib/docker/containers
  • Updated documentation
  • Started a MIGRATION-v4 document which detailed migration instructions

Why?

The initContainers used a legacy and outdated vendored image which was difficult to maintain. Using files to provide the environment variable, while functional, was overly complex. Most of the complexity was because we were supporting custom log paths for the docker runtime. This runtime is no longer in use as of Kubernetes.

If users want to continue using the docker runtime and provide a custom log path, they can do so via the operator.containerLogPath value -- which is documented in the migration guide.

@cw-Guo cw-Guo added this to the v4.0.0 milestone Nov 12, 2025
@joshuabaird joshuabaird changed the title Chore/helm container runtime helm-chart(v4): Use env var for setting CONTAINER_ROOT_DIR, new default for containerRuntime Nov 12, 2025
@joshuabaird joshuabaird marked this pull request as ready for review November 12, 2025 20:29
@joshuabaird
Copy link
Collaborator Author

@cw-Guo @marcofranssen This is the first v4 helm-chart feature. I think the CRD re-factor being discussed in #1765 is another candidate. The changes here are compatible with fluent-operator <=3.5 as well.

@joshuabaird joshuabaird changed the title helm-chart(v4): Use env var for setting CONTAINER_ROOT_DIR, new default for containerRuntime helm-chart(v4): Use env var for setting CONTAINER_LOG_PATH, new default for containerRuntime Nov 12, 2025
Copy link
Collaborator

@marcofranssen marcofranssen left a comment

Choose a reason for hiding this comment

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

  1. Some Nits regarding docs clarity.
  2. Suggestion on the values.
  3. question on one of the macro functions.

Furthermore we also have to run helm-docs to update the README with updated values.

app.kubernetes.io/name: fluent-operator
data:
fluent-bit.env: |
CONTAINER_ROOT_DIR={{ include "fluent-operator.containerLogPath" . | trimSuffix "/containers" }}
Copy link
Collaborator

Choose a reason for hiding this comment

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

The trim suffix would only work if people don't customize the paths.

This makes me wonder if we should even allow people to configure the log paths. Why don't we just always default based on the containerRuntime? I guess it is very unlikely people will use customized log paths with any containerRuntime.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Allowing custom log paths was mainly for backwards compatibility for those users who may still be running the docker runtime with non standard log paths.

Do you think we should remove the option to configure custom paths?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah since we are doing a major version bump I don't think we need to support previous/deprecate things.

In case we want to do a more smooth migration we probably even want to do a 3.x release that only deprecates and falls back to old settings.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

See 8239036

joshuabaird and others added 10 commits November 14, 2025 15:43
Signed-off-by: Josh Baird <jbaird@galileo.io>
Signed-off-by: Josh Baird <jbaird@galileo.io>
Signed-off-by: Josh Baird <jbaird@galileo.io>
Signed-off-by: Josh Baird <jbaird@galileo.io>
Signed-off-by: Josh Baird <jbaird@galileo.io>
Signed-off-by: Josh Baird <jbaird@galileo.io>
Co-authored-by: Marco Franssen <marco.franssen@gmail.com>
Signed-off-by: Josh Baird <jbaird@galileo.io>
Co-authored-by: Marco Franssen <marco.franssen@gmail.com>
Signed-off-by: Josh Baird <jbaird@galileo.io>
Co-authored-by: Marco Franssen <marco.franssen@gmail.com>
Signed-off-by: Josh Baird <jbaird@galileo.io>
Co-authored-by: Marco Franssen <marco.franssen@gmail.com>
Signed-off-by: Josh Baird <jbaird@galileo.io>
@marcofranssen marcofranssen force-pushed the chore/helm-container-runtime branch from 0ccf1be to cb82377 Compare November 14, 2025 14:43
Signed-off-by: Josh Baird <jbaird@galileo.io>
Signed-off-by: Josh Baird <jbaird@galileo.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: docker init container should not be required when using other container engines (not docker)

3 participants