How to tweak Redis config with Kubernetes statefulset?

461 views Asked by At

I am fine with Redis' default redis.conf, but would just like to change "appendonly" from the default of "no" to "yes". Kubernetes statefulset is, in part:

    spec:
      containers:
      - name: master
        image: k8s.gcr.io/redis:e2e
        command: ["/usr/local/bin/redis-server"]
        args: ["/etc/redis/redis.conf"]
        env:
        - name: appendonly
          value: "yes"

I think I'm way off-track, but struggling to wrap my head around Kubernetes.

1

There are 1 answers

0
Zeke MC On BEST ANSWER

Here's what worked and is simpler than using configmaps. I am only using this in test/dev, so of course YMMV if working in prod. The relevant portion:

    spec:
      containers:
      - name: master
        image: k8s.gcr.io/redis:e2e
        imagePullPolicy: Always
        command: ["redis-server"]
        args: ["--appendonly", "yes"]