redis-operator icon indicating copy to clipboard operation
redis-operator copied to clipboard

readinessProbe and livenessProbe fail when AUTH is enforced

Open szelenka opened this issue 2 years ago • 1 comments

Expected behaviour

Enable AUTH for Redis and Sentinel via :

spec:
  auth:
    secretPath: k8s-secret-name

Actual behaviour

Issue 1

AUTH is configured on rfr pods, but the livenessProbe fails because it's not attempting to authenticate:

    livenessProbe:
      exec:
        command:
        - sh
        - -c
        - redis-cli -h $(hostname) ping

The readinessProbe doesn't have this issue, as it execute a script from a ConfigMap and the use of -a $REDIS_PASSWORD} in #235 . It'd be nice to have a way to modify these probes, similar to how you can modify the shutdown script.

Issue 2

AUTH is not configured on rfs pods, and has similar challenges with readinessProbe and livenessProbe not attempting to authenticate:

    livenessProbe:
      exec:
        command:
        - sh
        - -c
        - redis-cli -h $(hostname) -p 26379 ping
    readinessProbe:
      exec:
        command:
        - sh
        - -c
        - redis-cli -h $(hostname) -p 26379 ping

It'd be nice to have a way to modify these probes, similar to how you can modify the shutdown script.

Steps to reproduce the behaviour

  1. Redis docker image which enforces protected-mode yes
  2. Create a k8s Secret with a password field to use as the password for AUTH
  3. Enable auth in the RedisFailover CRD

Environment

  • Redis Operator version = 1.1.1
  • Kubernetes version = 1.21
  • Kubernetes configuration used (eg: Is RBAC active?)

Logs

The Operator is running fine, it's just that it never configures AUTH on the probes for Redis and Sentinel, so k8s will continually think the Pods are not available.

szelenka avatar Jun 24 '22 12:06 szelenka

This issue is stale because it has been open for 45 days with no activity.

github-actions[bot] avatar Aug 09 '22 02:08 github-actions[bot]

This issue was closed because it has been inactive for 14 days since being marked as stale.

github-actions[bot] avatar Aug 23 '22 02:08 github-actions[bot]

@szelenka check if https://github.com/spotahome/redis-operator/pull/430 fixes the issue now?

samof76 avatar Aug 30 '22 07:08 samof76