Skip to content

bug: Collector CRD ignores storageClassName when generating StatefulSet volumeClaimTemplates #1962

@acidroper

Description

@acidroper

Describe the issue

When deploying the Collector custom resource with a custom storageClassName defined in spec.pvc.spec, the generated StatefulSet's volumeClaimTemplates has an empty/nil storageClassName.

As a result, the PVC is created with the cluster's default StorageClass.

This is highly identical to the older issue #798 ("storageClassName field not taken into account"), which was fixed by PR #799 for daemonsets.

To Reproduce

  1. Apply the following Collector manifest:
apiVersion: fluentbit.fluent.io/v1alpha2
kind: Collector
metadata:
  name: test-collector
  namespace: default
spec:
  image: ghcr.io/fluent/fluent-operator/fluent-bit:3.2.5
  fluentBitConfigName: test-config
  replicas: 1
  pvc:
    spec:
      accessModes:
        - ReadWriteOnce
      storageClassName: network-hdd
      resources:
        requests:
          storage: 1Gi
  1. Inspect the generated StatefulSet using kubectl get sts test-collector -o yaml:
    Under spec.volumeClaimTemplates[0].spec, the storageClassName field is completely missing.

Expected behavior

The generated StatefulSet's volumeClaimTemplates should preserve and apply the configured storageClassName.

Your Environment

- Fluent Operator version: v3.4.0 (reproducible on `master` branch as well)
- Container Runtime: containerd://2.2.0
- Operating system: Debian 12
- Kernel version: 6.1.0-22-amd64

How did you install fluent operator?

Installed using official Helm Chart (v3.4.0) with custom values to enable FluentBit CRDs:

helm upgrade --install fluent-operator charts/fluent-operator \
  --namespace fluent-operator \
  --create-namespace \
  --set containerRuntime=containerd \
  --set fluentbit.crdsEnable=true \
  --set fluentbit.enable=false

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions