I'm trying to get my head around Persistent Volumes in ArgoCD while using a StatefulSet in Kubernetes. I've been working with AWS EKS and I understand that if I create a custom storage class, like EBS CSI, and enable resizing, I can just update the PVC in my git repo, and ArgoCD will handle the resize for me without restarting my pods, assuming I'm using a supported filesystem like ext4.
My confusion lies with StatefulSets: if I want to resize a PVC, I'll have to patch the PVC manually, which won't reflect in my Git repository. Additionally, I'm curious about the storage class used by Helm charts that deploy PVCs, and how I should approach resizing those as well.
4 Answers
Actually, you should be using the volumeClaimTemplate field in your StatefulSet. Once you update that in your git repository, ArgoCD will reapply the StatefulSet and Kubernetes should handle updating the PVCs. However, you must be aware that trying to directly modify an existing PVC from a StatefulSet template will lead to errors. The preferred method is to push changes to the StatefulSet in git, delete the StatefulSet with orphan set to true (this keeps the pods running), manually resize the PVC, and then let Argo deploy the StatefulSet again.
To manually resize a PVC linked to a StatefulSet, you usually need to set the ignore field in your Argo app for that StatefulSet's size, then edit the size directly using the CLI or the Argo UI.
If your PVCs are created through a StatefulSet volume template, updates will need to be done manually, and those changes won't automatically reflect back in your git repo. So, you’ll have to patch it directly in Kubernetes.
Related Questions
How To Get Your Domain Unblocked From Facebook
How To Find A String In a Directory of Files Using Linux