Skip to content

helm: Re-factor the way we handle CRDs in fluent-operator's helm chart(s) #1765

@joshuabaird

Description

@joshuabaird

Is your feature request related to a problem? Please describe.

How we currently handle CRDs:

  • We currently distribute fluent-operator's CRDs in two separate "sub-charts" which are dependencies of the "main" chart.
  • This makes it difficult to upgrade Helm releases when there are CRD changes, because CRDs (in crds/ directories) are not upgraded by default in Helm. Users have to manually fetch CRDs, run kubectl replace etc
  • The usage of file:// references in dependencies also causes duplicate CRDs in the release as reported here.

Describe the solution you'd like

I'd like to propose that we implement something similar to how Karpenter handles their Helm releases:

  • Include the fluentd and fluent-bit CRDs in the fluent-operator's "main" chart's crds/ folder.
    This will ensure all CRDs get installed during an initial helm install
  • Create a new "top-level" chart named fluent-operator-crds
  • Put CRDs in the templates/ directory of the fluent-operator-crds chart
  • Placing them in the templates/ directory will allow a user to helm upgrade the fluent-operator-crds chart to upgrade our CRDs instead instead of having to fetch them manually and kubectl replace etc
  • In this setup, we'll need to publish updated CRDs to two locations -- charts/fluent-operator/crds and charts/fluent-operator-crds/templates -- but this should be fairly simple with CI. (edited)

Additional context

I don't think this would introduce any breaking changes:

  • Currently, if a user wants to install fluent-operator without any CRDs, they can set fluentd.crdsEnable or fluentbit.crdsEnable to false
  • Moving forward, we would deprecate these two values, and a user could simply use helm install --skip-crds` if they want to prevent CRD installation

As part of this, we can also clarify and update our documentation for "installing" and "upgrading."

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions