Open xTrekStorex opened 1 week ago
Thank you for bringing this issue to our attention. We appreciate your involvement! If you're interested in contributing a solution, we welcome you to create a pull request. The Bitnami team is excited to review your submission and offer feedback. You can find the contributing guidelines here.
Your contribution will greatly benefit the community. Feel free to reach out if you have any questions or need assistance.
Name and Version
bitnami/redis 20.0.5
What architecture are you using?
amd64
What steps will reproduce the bug?
Are you using any custom parameters or values?
What is the expected behavior?
master pod is labeled with
isMaster="true"
What do you see instead?
no such label on master
Additional information
kubectl uses the content of
/etc/shared/current
for the pod selector inupdate-master-label.sh
. The content of/etc/shared/current
is written by sentinel from${REDIS_MASTER_HOST/.*}
instart-sentinel.sh
. when using useHostnames=false REDIS_MASTER_HOST contains notredis-node-0.redis.svc.cluster.local
, which would returnredis-node-0
ascurrent
, but instead the IP address e.g.172.22.140.140
which returns172
ascurrent
. thus kubectl matches no pod and updates no labels. Unfortunately, the output of kubectl is also not logged - only the echo statement withnew master elected, updating label(s)...
. Patching the script configmap withecho "$(< "/etc/shared/current")"
helped to debug this as it returned172
instead ofredis-node-0
.This also applies to the delete patch for the label
app.kubernetes.io/role
which will be fixed in 20.0.6 (annotation -> label).To fix this either sentinel writes a non-resolved value for
REDIS_MASTER_HOST
into/etc/shared/current
or the kubectl script looks up the pod by IP ifcurrent
is numerical. such as:kubectl get -n <namespace> --output json pods | jq '.items[] | select(.status.podIP=="<IP>")' | jq .metadata.name
though this would likely require further RBAC permissions.