OT-CONTAINER-KIT / redis-operator

A golang based redis operator that will make/oversee Redis standalone/cluster/replication/sentinel mode setup on top of the Kubernetes.
https://ot-redis-operator.netlify.app/
Apache License 2.0
738 stars 207 forks source link

NodeConfVolumeClaimTemplate not accepted #717

Open Pez721 opened 7 months ago

Pez721 commented 7 months ago

Hi,

Due to my issue with the latest version (https://github.com/OT-CONTAINER-KIT/redis-operator/issues/710), I'm trying to roll back to the last known working version of redis. That is redis v7.0.5, operator v0.15.0, using api v1beta1. I deleted the CRDs and reinstalled the operator. Now I am attempting to apply this cluster:

apiVersion: redis.redis.opstreelabs.in/v1beta1 kind: RedisCluster metadata: name: redis-cluster namespace: redis spec: clusterSize: 3 clusterVersion: v7 podSecurityContext: runAsUser: 1000 fsGroup: 1000 persistenceEnabled: true kubernetesConfig: image: quay.io/opstree/redis:v7.0.5 imagePullPolicy: IfNotPresent resources: requests: cpu: 4 memory: 10Gi limits: cpu: 4 memory: 10Gi redisSecret: name: redis-password key: password redisExporter: enabled: false image: quay.io/opstree/redis-exporter:v1.44.0 imagePullPolicy: IfNotPresent redisLeader: affinity: podAntiAffinity: requiredDuringSchedulingIgnoredDuringExecution:

The operator wont accept this cluster: Error from server (BadRequest): error when creating "redis.yaml": RedisCluster in version "v1beta1" cannot be handled as a RedisCluster: strict decoding error: unknown field "spec.storage.nodeConfVolumeClaimTemplate"

If I install without the nodeConf part, the command is accepted, however no pods come up. There is an error in the statefulful set:

Warning FailedCreate 6s (x12 over 16s) statefulset-controller create Pod redis-cluster-leader-0 in StatefulSet redis-cluster-leader failed error: failed to create PVC node-conf-redis-cluster-leader-0: PersistentVolumeClaim "node-conf-redis-cluster-leader-0" is invalid: spec.resources[storage]: Required value

I read in this issue https://github.com/OT-CONTAINER-KIT/redis-operator/issues/608 that the nodeConfVolumeClaimTemplate is required.

How can these errors be fixed?

Many thanks

arusa commented 6 months ago

I only see the nodeConfVolumeClaimTemplate in the v1beta2 template, not in v1beta1. Maybe this template helps you:

https://github.com/OT-CONTAINER-KIT/redis-operator/blob/master/example/v1beta2/redis-cluster.yaml