Skip to content

ArgoCD detects constant drift on StatefulSet volumeClaimTemplate #608

@gianvetter

Description

@gianvetter

Bug Description

ArgoCD continuously detects drift and attempts to sync StatefulSet resources (alertmanager, compactor, ingester, store-gateway) due to missing apiVersion and kind fields in volumeClaimTemplates.

Problem

When deploying the Cortex Helm chart, Kubernetes automatically populates the apiVersion: v1 and kind: PersistentVolumeClaim fields in the StatefulSet's volumeClaimTemplates during resource creation. However, the Helm templates don't include these fields, causing ArgoCD to detect a constant difference between:

  • Desired state (from Helm): volumeClaimTemplates without apiVersion/kind
  • Actual state (in cluster): volumeClaimTemplates with apiVersion/kind

This results in ArgoCD sync flapping, constantly trying to "fix" a difference that reappears immediately.

Expected Behavior

StatefulSet templates should explicitly include apiVersion and kind fields in volumeClaimTemplates to match the actual cluster state and prevent ArgoCD drift detection.

Affected Components

  • templates/alertmanager/alertmanager-statefulset.yaml
  • templates/compactor/compactor-statefulset.yaml
  • templates/ingester/ingester-statefulset.yaml
  • templates/store-gateway/store-gateway-statefulset.yaml

Reference

The Grafana Loki Helm chart uses this pattern successfully: https://github.com/grafana/loki/blob/main/production/helm/loki/templates/ingester/statefulset-ingester.yaml#L83-L85

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions