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 Sentinel pods not starting after redis-operator upgrade #995

Closed MoZadro closed 1 week ago

MoZadro commented 1 week ago

What version of redis operator are you using?

Version 0.15.9 quay.io/opstree/redis-operator:v0.15.1

We are using same image on both redis-operator versions image: quay.io/opstree/redis-sentinel:v7.0.12

On this redis-operator version everything is ok.

Statefulset of Redis Sentinel, probes (both liveness and readiness) are checking:

exec:
              command:
                - bash
                - /usr/bin/healthcheck.sh

Does this issue reproduce with the latest release?

When we upgrade redis-operator version to 0.16.1 ghcr.io/ot-container-kit/redis-operator/redis-operator:v0.17.0

Then Redis Sentinel pods wont start, looks like probes (both liveness and readiness) are not checking healthcheck.sh script anymore but:

exec:
              command:
                - sh
                - '-c'
                - >-
                  redis-cli -h $(hostname) -p ${SENTINEL_PORT} -a
                  ${REDIS_PASSWORD} ping

but under containers env variables,

- env:
        - name: REDIS_ADDR
          value: redis://localhost:26379
        - name: REDIS_PASSWORD
          valueFrom:
            secretKeyRef:
              key: password
              name: test-god-tools-redis-password
        - name: SERVER_MODE
          value: sentinel
        - name: SETUP_MODE
          value: sentinel
        - name: MASTER_GROUP_NAME
          value: myMaster
        - name: IP
          value: 10.32.1.101
        - name: PORT
          value: '6379'
        - name: QUORUM
          value: '2'
        - name: DOWN_AFTER_MILLISECONDS
          value: '30000'
        - name: PARALLEL_SYNCS
          value: '1'
        - name: FAILOVER_TIMEOUT
          value: '180000'

SENTINEL_PORT env is not defined.

What did you do?

When we configure/add manually to Sentinel StatefulSet

- name: SENTINEL_PORT
              value: '26379'

Then pods are in Running state

What did you expect to see?

We expect that pods are in running state, like on older redis-operator version.