DevOps-Nirvana / Kubernetes-Volume-Autoscaler

Autoscaling volumes for Kubernetes (with the help of Prometheus)
Apache License 2.0
273 stars 32 forks source link

Annotations on `Statefulset`'s `volumeClaimTemplate` don't propagate to the PVC #24

Open lucasfcnunes opened 2 months ago

lucasfcnunes commented 2 months ago

Is your feature request related to a problem? Please describe.

Changing the annotation as follows

apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: prometheus-kube-prometheus-stack-prometheus
  namespace: monitoring
# ...
  volumeClaimTemplates:
  - apiVersion: v1
    kind: PersistentVolumeClaim
    metadata:
      annotations:
        volume.autoscaler.kubernetes.io/scale-up-max-size: "375809638400" # <- Set on StatefulSet
        # ...
      name: prometheus-data
# ...
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  annotations:
    # volume.autoscaler.kubernetes.io/scale-up-max-size: "375809638400" <- Doesn't propagate/mirror what's in the StatefulSet's volumeClaimTemplates
    # ...
  name: prometheus-data-prometheus-kube-prometheus-stack-prometheus-0
  namespace: monitoring
# ...

Describe the solution you'd like

When the an annotation appears on the StatefulSet's volumeClaimTemplates, mirror on the respective PersistentVolumeClaim.

Describe alternatives you've considered

kubectl annotate -n monitoring pvc prometheus-data-prometheus-kube-prometheus-stack-prometheus-0 volume.autoscaler.kubernetes.io/scale-up-max-size='999999'