helm-charts icon indicating copy to clipboard operation
helm-charts copied to clipboard

fluent-operator: missing dependencies for enabling/disabling CRD installation in Chart.yaml

Open sharkeyl opened this issue 1 year ago • 0 comments

Hi everyone!

Context

I'm trying to use the fluent-operator chart to install the operator with fluent-bit enabled and fluentd disabled.

The issue

I've found that the chart in this repository will install the fluentd CRDs even if fluentd.crdsEnable=false.

The chart in fluent/fluent-operator contains local charts which contain the CRDs for fluent-bit and fluentd, respectively, and can be enabled/disabled as needed. This functionality appears to be provided by the dependencies in the Chart.yaml file.

It appears these dependencies are missing from the chart in the fluent/helm-charts repository - (Chart.yaml here). I've had a look at adding the dependencies and raising a PR, but I can't find the remote chart repository to reference in the dependencies.

Reproducing the issue

Cloning via SSH in the below examples.

fluent/fluent-operator chart

  1. Clone the repository :
    git clone [email protected]:fluent/fluent-operator.git
    
  2. Change directory to chart directory:
    cd fluent-operator/charts/fluent-operator
    
  3. Template the chart, including CRDs, with fluentd CRDs disabled:
    helm template fluent-operator . --set fluentd.crdsEnable=false --include-crds
    
    The --include-crds is required, otherwise CRDs will not be included in the template.

[!IMPORTANT] The Helm template produced by this command doesn't contain CRDs that are part of the fluentd.fluent.io group.

To confirm the flag is working, you can remove it:

helm template fluent-operator . --include-crds

The Helm template from this command does contain the fluentd CRDs.

fluent/helm-charts chart

  1. Clone the repository:
    git clone [email protected]:fluent/helm-charts.git
    
  2. Change directory to chart directory:
    cd helm-charts/charts/fluent-operator
    
  3. Template the chart, including CRDs, with fluentd CRDs disabled:
    helm template fluent-operator . --set fluentd.crdsEnable=false --include-crds
    
    The --include-crds is required, otherwise CRDs will not be included in the template.

[!IMPORTANT] The Helm template produced by this command does contain CRDs that are part of the fluentd.fluent.io group.

Proposed solutions

I think there are two possible solutions:

  1. Follow a similar approach to fluent/fluent-operator chart with local sub-charts.
  2. Publish the CRD charts to a remote repository, versioned, and reference the URL in the dependency.

I'm happy to raise a PR to address this, but looking for guidance on what you think the best approach is.

sharkeyl avatar Aug 25 '23 09:08 sharkeyl