Kubernetes Redis rejson 持久化数据未保存

Har*_*var 1 redis docker google-cloud-platform kubernetes

我正在使用https://hub.docker.com/r/redislabs/rejson/

apiVersion: v1
kind: Service
metadata:
  name: redis
spec:
  ports:
    - port: 6379
      name: redis
  clusterIP: None
  selector:
    app: redis
---
apiVersion: apps/v1beta2
kind: StatefulSet
metadata:
  name: redis
spec:
  selector:
    matchLabels:
      app: redis  
  serviceName: redis
  replicas: 1
  template:
    metadata:
      labels:
        app: redis 
    spec:
      containers:
        - name: redis
          image: redislabs/rejson
          args: ["--requirepass", "pass", "--appendonly", "yes", "--save", "900", "1", "--save", "30", "2"]
          ports:
            - containerPort: 6379
              name: redis
          volumeMounts:
            - name: redis-volume
              mountPath: /data
  volumeClaimTemplates:
  - metadata:
      name: redis-volume
    spec:
      accessModes: [ "ReadWriteOnce" ]
      resources:
        requests:
          storage: 1Gi
Run Code Online (Sandbox Code Playgroud)

我正在将 arg 传递给 kubernetes 配置,用于持久化数据存储 "--appendonly", "yes"

如果我没有通过 arg 它正在运行

`redis-cli:6379 > JSON.SET foo . '"bar"'`
OK
Run Code Online (Sandbox Code Playgroud)

如果我将 arg 传递给 kubernetes 配置,它会在 redis 中生成错误和 json 模块不起作用

`redis-cli:6379 > JSON.SET foo . '"bar"'`
(error) ERR unknown command `JSON.SET`, with args beginning with: `foo`, `.`, `"bar"`,
Run Code Online (Sandbox Code Playgroud)

我正在关注这个:https : //estl.tech/deploying-redis-with-persistence-on-google-kubernetes-engine-c1d60f70a043

Ita*_*ber 5

redislabs/rejson图像需要有loadmodule交换机作为CMD参数,以及-这应该工作:

...
      args: ["--requirepass", "pass", "--appendonly", "yes", "--save", "900", "1", "--save", "30", "2", "--loadmodule", "/usr/lib/redis/modules/rejson.so"]
...
Run Code Online (Sandbox Code Playgroud)