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
731 stars 206 forks source link

Redis standalone/replicated instances are not restarted on ConfigMap change #960

Open alita1991 opened 4 weeks ago

alita1991 commented 4 weeks ago

What version of redis operator are you using?

kubectl logs <_redis-operator_pod_name> -n <namespace>

redis-operator version: 0.16.0

Does this issue reproduce with the latest release? Yes

What operating system and processor architecture are you using (kubectl version)?

kubectl version Output
$ kubectl version
Client Version: v1.29.3
Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3

What did you do?

  1. Created a Redis Standalone instance via RedisStandalone CR with additional config
  2. Updated the ConfigMap, where the additional config is stored

What did you expect to see? Redis instance should be restarted

What did you see instead? Redis instance is not restarted to start with the new config

Mlk777 commented 3 weeks ago

If I'm not wrong, in Kubernetes Pods and Configmap are decoupled so it's not related to the operator, it's default behavior. You'll need to find another way (watchers, kustomize or tools that will handle it for you)

alita1991 commented 3 weeks ago

I solved this problem with https://github.com/stakater/Reloader, but I'm seeking a solution to minimize additional steps. For example, if the Redis Operator can create the ConfigMap via CR, it should be enough to know when to trigger a RollingUpgrade, the easiest way is with an annotation that stores the hash value of ConfigMap data.