Redis-HA chart has conflicting selectors
In the Redis-HA chart, you can deploy both the redis-sentinel-deployment
and redis-server-statefulset
at the same time, which results in 2 controllers trying to control the same set of pods.
Breakdown
-
The current template of
redis-sentinel-deployment
uses the "autofill selector" feature of theapps/v1beta1
deployment. The pods are also assigned only the labels of{{ template "labels.standard" . }}
, which results in a selector of{{ template "labels.standard" . }}
. -
The
redis-server-statefulset
template gives its pods the{{ template "labels.standard" . }}
-labels, together with some more specific ones, and selects them correctly with a selector (usingapps/v1beta2
).
The issue here is that redis-sentinel-deployment
has a selector which also selects redis-server-statefulset
-pods, which might very well break the deployment of both sets.
redis-server-statefulset
only selects its own pods.
Footnote: Due to redis-server-statefulset
being an apps/v1beta1
statefulset, it will not break if you directly update the labels / selector, BUT this will likely orphan any active pods. redis-sentinel-deployment
is apps/v1beta2, and can therefore not update its selector.