skip to Main Content

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?

2

Answers


  1. The string type parameter values within the list of extraFlags must be explicitly cast as a string to avoid issues with characters such as whitespace:

    extraFlags:
    - 'stream-db-max-len 100'
    
    Login or Signup to reply.
  2. The actual syntax is a bit different compared to what you have. It should be:

    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
    

    As a rule of the thumb, I usually read the chart documentation prior to trying to deploy it because it has examples on how to set different values. For extraFlags, you can see how it is supposed to look here.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search