helm icon indicating copy to clipboard operation
helm copied to clipboard

Feature: Redis Cluster and Valkey Cluster as optional subcharts

Open jessebot opened this issue 1 year ago • 1 comments

Description of the change

Since Redis Cluster is supported upstream we should also support it in this chart and do as much templated configuration as possible. We should start by adding Redis Cluster as a subchart (and valkey cluster as the alternative with more features and a better license).

We should also have a test for it, and a test for redis proper honestly.

Benefits

Easily to support testing issues with redis cluster/valkey cluster if we already have a way to deploy it via the chart easily. Supports users scaling their infra better.

Possible drawbacks

Another thing to support and write tests for.

Additional information

Relates to #543

jessebot avatar Dec 17 '24 19:12 jessebot

I already tried to use nextcloud together with bitnami's redis-cluster chart. It did connect, but the connection was rather unstable (nextcloud logged connection losses every X minutes). I wasn't able to figure out why. Therefore, I reverted to a single instance redis. This was my setup:

        configs:
            redis.config.php: |-
              <?php
              $CONFIG = array (
                'memcache.distributed' => '\OC\Memcache\Redis',
                'memcache.locking' => '\OC\Memcache\Redis',

                'redis' => array(),
                'redis.cluster' => array (
                  'seeds' => array(
                    'redis-nextcloud.nextcloud.svc.cluster.local:6379'
                  ),
                  'timeout' => 0.0,
                  'read_timeout' => 0.0,
                  'failover_mode' => \RedisCluster::FAILOVER_ERROR,
                  'password' => getenv('REDIS_HOST_PASSWORD'),
                  // If redis in-transit encryption is enabled, provide certificates
                  // SSL context https://www.php.net/manual/en/context.ssl.php
                  'ssl_context' => array (
                    'local_cert' => '/opt/certs/redis/tls.crt',
                    'local_pk' => '/opt/certs/redis/tls.key',
                    'cafile' => '/opt/certs/redis/ca.crt',
                    'verify_peer' => false,
                    'verify_peer_name' => false
                  )
                )
              );              

          ##
          ## Extra environment variables
          extraEnv:
            - name: REDIS_HOST_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: nextcloud-secrets
                  key: redis-password

I tried both with and without TLS. Both were equally unstable.

pfaelzerchen avatar Dec 18 '24 19:12 pfaelzerchen