OT-CONTAINER-KIT/redis-operator

Custom annotations for PVC

Open

#689 opened on Nov 8, 2023

View on GitHub
 (4 comments) (0 reactions) (0 assignees)Go (377 forks)auto 404
enhancementgood first issue

Repository metrics

Stars
 (1,416 stars)
PR merge metrics
 (PR metrics pending)

Description

I need to set custom annotations on PVC created by operator CRDs.

My usecase is to prevent PVC deletion if helm chart is uninstalled using annotation helm.sh/resource-policy: keep.

For now, metadata from PVC is ignored by operator when generating annotations: https://github.com/OT-CONTAINER-KIT/redis-operator/blob/5bf8182035ce29cc303d1de5cc25d5a1fb937f3e/k8sutils/statefulset.go#L319

Describe the solution you'd like

Apparently, I want annotations from CRD (f.e. Redis: spec.storage.volumeClaimTemplate.metadata.annotations) to be added to claim template in generated statefulset.

What version of redis-operator are you using?

redis-operator version: quay.io/opstree/redis-operator:v0.15.1

Contributor guide