RedisLabs / redis-enterprise-k8s-docs

152 stars 92 forks source link

Replica set with same names(id's) for redis-enterprise-operator in different namespaces #174

Open saiharshitachava opened 3 years ago

saiharshitachava commented 3 years ago

We have this rec installed on our kube cluster in two different namespaces but when we the replica set name of redis-enterprise-operator deployment..the rs names are same even the ID's ..IS this by design?

laurentdroin commented 3 years ago

Hi,

I have just seen this on a customer deployment, and while I found it strange, I am not sure it would cause an issue. You will probably notice this for other replicasets as well. What Kubernetes distribution are you using?

saiharshitachava commented 3 years ago

@laurentdroin 1.16.7

We have lot of rs running in cluster no other rs have identical id's

laurentdroin commented 3 years ago

@saiharshitachava What "flavor" of k8s is it? Openshift? Rancher? GKE?

saiharshitachava commented 3 years ago

Its open source cluster

laurentdroin commented 3 years ago

I was looking into it and it's possible that the ID used comes from the "pod-template-hash". And so it's possible that if different RS have the same contents, they will have the same ID. I am checking this. I don't imagine it would cause any issue though.

saiharshitachava commented 3 years ago

sure @laurentdroin please update the thread if you find something

laurentdroin commented 3 years ago

From https://kubernetes.io/docs/concepts/workloads/controllers/_print/

Notice that the name of the ReplicaSet is always formatted as [DEPLOYMENT-NAME]-[RANDOM-STRING]. The random string is randomly generated and uses the pod-template-hash as a seed.

and

The pod-template-hash label is added by the Deployment controller to every ReplicaSet that a Deployment creates or adopts. This label ensures that child ReplicaSets of a Deployment do not overlap. It is generated by hashing the PodTemplate of the ReplicaSet and using the resulting hash as the label value that is added to the ReplicaSet selector, Pod template labels, and in any existing Pods that the ReplicaSet might have.

So it should be all good.

laurentdroin commented 3 years ago

In my case, the "RANDOM-STRING" seems to be the pod template hash, and not a random number using that hash as the seed so I am still not completely sure what's going on.