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

bug: storageClassName field in Fluentd buffer instance not taken into account #798

Closed
antrema opened this issue Jun 19, 2023 · 0 comments · Fixed by #799
Closed

bug: storageClassName field in Fluentd buffer instance not taken into account #798

antrema opened this issue Jun 19, 2023 · 0 comments · Fixed by #799
Labels
good first issue Good for newcomers

Comments

@antrema
Copy link
Collaborator

antrema commented Jun 19, 2023

Describe the issue

When creating an instance of Fluentd specifying a storageClassName for the buffer, this information is not taken into account

To Reproduce

Create a Fluentd instance with below manifest

---
apiVersion: fluentd.fluent.io/v1alpha1
kind: Fluentd
metadata:
  labels:
    app.kubernetes.io/name: fluentd
  name: fluentd
  namespace: fluent
spec:
  buffer:
    pvc:
      apiVersion: v1
      kind: PersistentVolumeClaim
      spec:
        accessModes:
        - ReadWriteOnce
        resources:
          requests:
            storage: 1Gi
        storageClassName: sata-0a
  fluentdCfgSelector:
    matchLabels:
      config.fluentd.fluent.io/enabled: "true"
  globalInputs:
  - forward:
      bind: 0.0.0.0
      port: 24224
  image: kubesphere/fluentd:v1.15.3
  replicas: 2
  resources:
    limits:
      cpu: 2000m
      memory: 2000Mi
    requests:
      cpu: 100m
      memory: 128Mi

The generated StatefulSet is as follow
kubectl get sts fluentd -n fluent -o yaml

apiVersion: apps/v1
kind: StatefulSet
metadata:
  labels:
    app.kubernetes.io/component: fluentd
    app.kubernetes.io/instance: fluentd
    app.kubernetes.io/name: fluentd
  name: fluentd
  namespace: fluent
  ownerReferences:
  - apiVersion: fluentd.fluent.io/v1alpha1
    blockOwnerDeletion: true
    controller: true
    kind: Fluentd
    name: fluentd
spec:
  podManagementPolicy: OrderedReady
  replicas: 2
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      app.kubernetes.io/component: fluentd
      app.kubernetes.io/instance: fluentd
      app.kubernetes.io/name: fluentd
  serviceName: ""
  template:
    metadata:
      labels:
        app.kubernetes.io/component: fluentd
        app.kubernetes.io/instance: fluentd
        app.kubernetes.io/name: fluentd
      name: fluentd
      namespace: fluent
    spec:
      containers:
      - env:
        - name: BUFFER_PATH
          value: /buffers
        image: kubesphere/fluentd:v1.15.3
        imagePullPolicy: IfNotPresent
        name: fluentd
        ports:
        - containerPort: 2021
          name: metrics
          protocol: TCP
        - containerPort: 24224
          name: forward
          protocol: TCP
        resources:
          limits:
            cpu: "2"
            memory: 2000Mi
          requests:
            cpu: 100m
            memory: 128Mi
        terminationMessagePath: /dev/termination-log
        terminationMessagePolicy: File
        volumeMounts:
        - mountPath: /fluentd/etc
          name: config
          readOnly: true
        - mountPath: /buffers
          name: fluentd-buffer-pvc
      dnsPolicy: ClusterFirst
      restartPolicy: Always
      schedulerName: default-scheduler
      securityContext: {}
      serviceAccount: fluentd
      serviceAccountName: fluentd
      terminationGracePeriodSeconds: 30
      volumes:
      - name: config
        secret:
          defaultMode: 420
          secretName: fluentd-config
  updateStrategy:
    rollingUpdate:
      partition: 0
    type: RollingUpdate
  volumeClaimTemplates:
  - apiVersion: v1
    kind: PersistentVolumeClaim
    metadata:
      creationTimestamp: null
      labels:
        app.kubernetes.io/component: fluentd
        app.kubernetes.io/instance: fluentd
        app.kubernetes.io/name: fluentd
      name: fluentd-buffer-pvc
      namespace: fluent
    spec:
      accessModes:
      - ReadWriteOnce
      resources:
        requests:
          storage: 1Gi
      volumeMode: Filesystem
    status:
      phase: Pending

The storageClassName specification is missing in generated StatefulSet

Expected behavior

Expecting to have a storageClassName specification in volumeClaimTemplates section

Your Environment

- Fluent Operator version: v2.2.0
- Container Runtime: containerd://1.6.15
- Operating system: Ubuntu 22.04.1 LTS
- Kernel version: 5.15.0-46-generic

How did you install fluent operator?

kubectl create ns fluent
kubectl apply -f https://raw.githubusercontent.com/fluent/fluent-operator/release-2.2/manifests/setup/setup.yaml

Additional context

No response

@benjaminhuo benjaminhuo added the good first issue Good for newcomers label Jun 19, 2023
antrema added a commit to antrema/fluent-operator that referenced this issue Jun 19, 2023
Signed-off-by: Anthony TREUILLIER <anthony.treuillier@gmail.com>
benjaminhuo added a commit that referenced this issue Jun 19, 2023
Fixes #798 storageClassName field not taken into account
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants