redis-operator icon indicating copy to clipboard operation
redis-operator copied to clipboard

Cluster creation got stuck while specifying the service type as NodePort

Open lehy786 opened this issue 6 months ago • 1 comments

What version of redis operator are you using?

kubectl logs <_redis-operator_pod_name> -n <namespace>

redis-operator version: v0.19.0

Does this issue reproduce with the latest release? yes

What operating system and processor architecture are you using (kubectl version)?

kubectl version Output
$ kubectl version
v1.28.13

What did you do?

1. define RedisCluster

cluster-define.yaml:

---
apiVersion: v1
kind: ConfigMap
metadata:
  name: redisot-additional-config
  namespace: mdw-sproject-operators
data:
  redis-additional.conf:
    cluster-config-file /data/nodes.conf

---
apiVersion: vl
kind: Secret
metadata:
  name: redisot-secret
  namespace: mdw-sproject-operators
data:
  password: bWR3QDIWMiAK
type: 0paque

---
apiVersion: redis.redis.opstreelabs.in/vlbeta2
kind: RedisCluster
metadata:
  name: redisot
  namespace: mdw-sproject-operators
spec:
  clusterSize: 3
  clusterVersion: v7
  podSecurityContext:
    runAsUser: 1000
    fsGroup: 1000
  persistenceEnabled: true
  kubernetesConfig:
    image: registry.oa.xxxx.com/fdm-mdw/opstree/redis:v7.0.15
    imagePullPolicy: IfNotPresent
    redisSecret:
      name: redisot-secret
      key: password
    service:
      serviceType: NodePort
  redisExporter:
    enabled: false
    image: registry.oa.xxxx.com/fdm-mdw/opstree/redis-exporter:v1.44.0
  redisLeader:
    redisConfig:
      additionalRedisconfig: redisot-additional-config
  redisFollower:
    redisConfig:
      additionalRedisconfig: redisot-additional-config

2. start cluster

kubectl apply -f cluster-define.yaml

What did you expect to see? Cluster start up normally with 3 masters and 3 slaves. And each node can interact with others.

What did you see instead? Cluster start up with 6 orphan masters. The cluster is not formed.

operator logs

{
    "level": "info”,
    "ts": "2025-04-08T07:52:25Z",
    "msg": "Not all leader are part of the cluster...",
    "controller": "rediscluster",
    "controllerGroup": "redis.redis.opstreelabs.in",
    "controllerKind": "RedisCluster",
    "RedisCluster":{
		"name": "redisot",
		"namespace": "mdw-sproject-operators"
	},
    "namespace": "mdw-sproject-operators",
    "name": "redisot",
    "reconcileID": "8e7248da-1960-4874-93c8-d02043c02595",
    "Leaders.Count": 1,
    "Instance.Size": 3
}

I've got the below log once, and never reproduce it again:

Image

lehy786 avatar Apr 08 '25 08:04 lehy786