redisterraformkubernetes-helmredis-streamsterraform-provider-helm

Enable redis stream in redis helm chart bitnami with terraform


I am trying to deploy a standalone redis with bitnami helm chart and activate the redis stream and set the stream-db-max-len to 100. I have this tf file:

resource "helm_release" "redis" {
  timeout    = 120
  name       = "redis-stream"
  namespace  = var.namespace
  chart      = "oci://registry-1.docker.io/bitnamicharts/redis"
  version    = "18.19.2"
  values = [templatefile("manifests/redis-values.yaml", {
    redis_deployment_name = var.redis_deployment_name
    redis_affinity        = var.redis_affinity
    redis_nodeSelector    = var.redis_nodeSelector
    redis_tolerations     = var.redis_default_tolerations
  })]
}

and my redis-values.yaml file with this content:

architecture: standalone

fullnameOverride: ${redis_deployment_name}
auth:
  password: "redis"

master:
  ${ indent(2, redis_affinity) }
  ${ indent(2, redis_nodeSelector) }
  ${ indent(2, redis_tolerations) }
  persistence:
    enabled: false
  resources:
    limits:
      cpu: 350m
      memory: 700Mi
    requests:
      cpu: 100m
      memory: 256Mi
  extraFlags:
    - stream-db-max-len 100

pdb:
  enabled: true

# Activation explicite de Redis Stream
redisStreamEnabled: true

The problem is that this piece of code:

extraFlags:
    - stream-db-max-len 100

is causing the pod to CrashLoopBackOff and the logs of the pod are this:

*** FATAL CONFIG FILE ERROR (Redis 7.2.4) ***
                                                                                                         Reading the configuration file, at line 6
                                                                                                             >>> 'include "/opt/bitnami/redis/etc/master.conf" "stream-db-max-len 100"'
                                                                             
Bad directive or wrong number of arguments

because when i remove this:

extraFlags:
    - stream-db-max-len 100

I get the pod to run but the stream-db-max-len will be set to (empty array). enter image description here

What should I do?


Solution

  • The parameter to change was stream-node-max-entries not stream-db-max-len.