Skip to content

Conversation

@yuvalcohenrise
Copy link

@yuvalcohenrise yuvalcohenrise commented Sep 29, 2025

Summary

This PR adds several enhancements to the fluentd chart, primarily focused on improving StatefulSet deployments:

New Features

  1. Headless Service Support

    • Added new headlessService configuration to enable headless services for StatefulSet deployments
    • Enables direct pod DNS resolution (e.g., pod-0.fluentd-headless.namespace.svc.cluster.local)
    • Configurable annotations and additional ports
  2. PersistentVolumeClaimRetentionPolicy Support

    • Added persistentVolumeClaimRetentionPolicy configuration for StatefulSets
    • Allows control over PVC retention when pods are deleted or scaled down
  3. PodDisruptionBudget (PDB) Support

    • Added new pdb.yaml template
    • Configurable minAvailable and maxUnavailable settings
    • Helps ensure availability during voluntary disruptions
  4. HPA Support for StatefulSet

    • Extended HorizontalPodAutoscaler to work with StatefulSet (previously only Deployment)
    • Dynamic kind reference based on .Values.kind
  5. Conditional Replicas for StatefulSet

    • StatefulSet replicas field is now only set when autoscaling is disabled
    • Prevents conflicts between HPA and static replica count

Changed Files

File Change
charts/fluentd/values.yaml Added persistentVolumeClaimRetentionPolicy, podDisruptionBudget, and headlessService configurations
charts/fluentd/templates/statefulset.yaml Added conditional replicas and persistentVolumeClaimRetentionPolicy support
charts/fluentd/templates/hpa.yaml Extended to support both Deployment and StatefulSet kinds
charts/fluentd/templates/pdb.yaml New template for PodDisruptionBudget
charts/fluentd/templates/headless-service.yaml New template for headless service
charts/fluentd/README.md Added documentation for headless service

Example Usage

# Enable headless service for StatefulSet
headlessService:
  enabled: true
  annotations: {}
  ports:
    - name: "forwarder"
      protocol: TCP
      containerPort: 24224

# Configure PVC retention policy
persistentVolumeClaimRetentionPolicy:
  whenDeleted: Delete
  whenScaled: Delete

# Enable PodDisruptionBudget
podDisruptionBudget:
  enabled: true
  minAvailable: 1

# Enable HPA for StatefulSet
kind: StatefulSet
autoscaling:
  enabled: true
  minReplicas: 2
  maxReplicas: 10
  targetCPUUtilizationPercentage: 80

add support for HPA when kind is StatefulSet
add support for PodDisruptionBudget

Signed-off-by: yuvalcohenrise <[email protected]>
@yuvalcohenrise yuvalcohenrise changed the title add support for persistentVolumeClaimRetentionPolicy, PDB and HPA for StatefulSet feat(fluentd): add support for persistentVolumeClaimRetentionPolicy, PDB and HPA for StatefulSet Sep 29, 2025
@yuvalcohenrise yuvalcohenrise changed the title feat(fluentd): add support for persistentVolumeClaimRetentionPolicy, PDB and HPA for StatefulSet feat(fluentd): add StatefulSet enhancements and headless service support Jan 4, 2026
Signed-off-by: yuvalcohenrise <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant