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

[alertmanager] Ability to pass existing persistent volume claim for a single replica statefulset #5126

Open
NandigamAbhishek opened this issue Jan 10, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@NandigamAbhishek
Copy link

NandigamAbhishek commented Jan 10, 2025

Is your feature request related to a problem ?

It would be great to use an existing persistent volume (if there is) in statefulset yaml file. I know this would mean that the statefulset should have a single pod running.

Describe the solution you'd like.

  1. Add a persistentVolumeClaim block below the claimTemplate in statefulset.yaml

{{- if and ( .Values.persistence.enabled) (eq .Values.persistence.existingClaim "") }}
volumeClaimTemplates:
- metadata:
name: storage
spec:
accessModes:
{{- toYaml .Values.persistence.accessModes | nindent 10 }}
resources:
requests:
storage: {{ .Values.persistence.size }}
{{- if .Values.persistence.storageClass }}
{{- if (eq "-" .Values.persistence.storageClass) }}
storageClassName: ""
{{- else }}
storageClassName: {{ .Values.persistence.storageClass }}
{{- end }}
{{- end }}
{{- else if and (.Values.persistence.enabled) (not (eq .Values.persistence.existingClaim "")) (eq .Values.replicaCount 1) }}
- name: storage
persistentVolumeClaim:
claimName: {{ .Values.persistence.existingClaim }}
{{- else }}
- name: storage
emptyDir: {}
{{- end }}

  1. Add a existingClaim key under persistence inside values.yaml

persistence:
enabled: true
accessModes:
- ReadWriteOnce
size: 50Mi
existingClaim: ""

Describe alternatives you've considered.

Maybe the logic of applying the condition can be better. Not sure.

Additional context.

This is a suggestion. I have tested using existing claim with azurefile-csi storage class in an aks cluster with single alertmanager pod. It works as expected.

@NandigamAbhishek NandigamAbhishek added the enhancement New feature or request label Jan 10, 2025
@NandigamAbhishek NandigamAbhishek changed the title [alertmanager] Ability to pass existing persistent volume in volume claim template for a single replica statefulset [alertmanager] Ability to pass existing persistent volume claim for a single replica statefulset Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant