OT-CONTAINER-KIT / redis-operator

A golang based redis operator that will make/oversee Redis standalone/cluster/replication/sentinel mode setup on top of the Kubernetes.
https://ot-redis-operator.netlify.app/
Apache License 2.0
738 stars 207 forks source link

RedisCluster Creation time facing issue. #714

Open syslab007 opened 7 months ago

syslab007 commented 7 months ago

Describe your question I have setup redis operator success , then after I have install redis cluster via helm chart but facing issue?

What version of redis-operator are you using?

redis-operator version: 0.15.9

I have attach logs of pod . Defaulted container "redis-cluster-leader" out of: redis-cluster-leader, redis-exporter mkdir: can't create directory '/node-conf': Permission denied Redis is running without password which is not recommended sed: /node-conf/nodes.conf: No such file or directory Running without TLS mode ACL_MODE is not true, skipping ACL file modification Starting redis service in cluster mode..... 12:C 30 Nov 2023 09:29:33.664 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo 12:C 30 Nov 2023 09:29:33.664 # Redis version=7.0.12, bits=64, commit=00000000, modified=0, pid=12, just started 12:C 30 Nov 2023 09:29:33.664 # Configuration loaded 12:M 30 Nov 2023 09:29:33.665 * monotonic clock: POSIX clock_gettime 12:M 30 Nov 2023 09:29:33.666 # Can't open /node-conf/nodes.conf in order to acquire a lock: No such file or directory

shubham-cmyk commented 7 months ago

I have to investigate this but this error is related to the securityContext. This should not be the issue since we have e2e test but I think helm chart might have some issue.

arusa commented 6 months ago

I have the same issue. Just freshly installed the redis-operator using helm and created a new redis-cluster. It only created leader-0 which is hanging in "CrashLoopBackOff" and the same error message message in the container logs:

Can't open /node-conf/nodes.conf in order to acquire a lock: No such file or directory
arusa commented 6 months ago

For me this solved the problem:

    nodeConfVolume: true
    nodeConfVolumeClaimTemplate:
      spec:
        accessModes: ["ReadWriteOnce"]
        resources:
          requests:
            storage: 1Gi

As seen in this template: https://github.com/OT-CONTAINER-KIT/redis-operator/blob/master/example/v1beta2/redis-cluster.yaml

teocns commented 2 months ago

For me this solved the problem:

    nodeConfVolume: true
    nodeConfVolumeClaimTemplate:
      spec:
        accessModes: ["ReadWriteOnce"]
        resources:
          requests:
            storage: 1Gi

As seen in this template: https://github.com/OT-CONTAINER-KIT/redis-operator/blob/master/example/v1beta2/redis-cluster.yaml

That, plus:

  podSecurityContext:
    runAsUser: 1000
    fsGroup: 1000