AmadeusITGroup / Redis-Operator

Redis Operator creates/configures/manages Redis clusters atop Kubernetes
MIT License
167 stars 62 forks source link

Redis operator is not able to differentiate between multiple clusters when run on different ports other than 6379 which is hardcoded. #57

Open irshadawake opened 4 years ago

irshadawake commented 4 years ago

Redis operator is not able to differentiate between multiple clusters when run on different ports other than 6379 which is hardcoded.

Steps to reproduce:

  1. deploy redis cluster with hostnetwork=true on port 6379. ( operator creates a cluster with all pods running on 6379 and all good)
  2. deploy 2nd cluster with hostnetwork=true on port 6389. (operator creates svc for the second cluster with port no:6379 as it is hardcoded here: https://github.com/AmadeusITGroup/Redis-Operator/blob/68f754e90846a5fbcf6efc5edd29abbf29023a16/pkg/controller/service_control.go#L76 )
  3. the operator now gets confused and mixes both the clusters together. RedisCluster.txt
irshadawake commented 4 years ago

Scenario: Redis operator creates a service per cluster. However, when we try to create multiple clusters with different ports, as the redis port is hardcoded in the operator code, it creates a wrong service and messes up the clusters. Workaround: Over-ridden the service creation just before the cluster is created manually. Hence the operator fails to create the wrong service and endpoints, but works as expected with all the features. This step can be skipped in future if the community gets a fix for the same.

Please let me know if this can have unexpected side effects too.