Redis cluster on kubernetes

ask Status - Failed

StatefulSet - Name redis-cluster container name: redis, command: [“/conf/update-node.sh”, “redis-server”, “/conf/redis.conf”]

unable to find out the reason of failure.

spec:
volumes:
- name: conf
configMap:
- name: redis-cluster-configmap
defaultMode: 0755
containers:
- name: redis-container
image: redis:5.0.1-alpine
command: [“/conf/update-node.sh”, “redis-server”, “/conf/redis.conf”]
env:
- name: POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP

Hi Akhila

Can you please elaborate more on your issue .

@akhila @sadiq1425 -

There’s a button placed to verify whatever resources are created are in good shape or not.
If you are looking for configs needed to complete the challenge, here they are -

apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: redis-cluster
spec:
  selector:
    matchLabels:
      app: redis-cluster # has to match .spec.template.metadata.labels
  serviceName: "redis-cluster-service"
  replicas: 6 # by default is 1
  template:
    metadata:
      labels:
        app: redis-cluster # has to match .spec.selector.matchLabels
    spec:
      containers:
      - name: redis
        image: redis:5.0.1-alpine
        command: ["/conf/update-node.sh", "redis-server", "/conf/redis.conf"]
        env:
          - name: POD_IP
            valueFrom:
              fieldRef:
                fieldPath: status.podIP
        ports:
        - containerPort: 6379
          name: client
        - containerPort: 16379
          name: gossip
        volumeMounts:
        - name: conf
          mountPath: /conf
          readOnly: false
        - name: data
          mountPath: /data
          readOnly: false
      volumes:
      - name: conf
        configMap:
          name: redis-cluster-configmap
          defaultMode: 0755
  volumeClaimTemplates:
  - metadata:
      name: data
    spec:
      accessModes: [ "ReadWriteOnce" ]
      resources:
        requests:
          storage: 1Gi


apiVersion: v1
kind: Service
metadata:
  name: redis-cluster-service
spec:
  ports:
  - port: 6379
    name: client
    targetPort: 6379
    name: client
  - port: 16379
    name: gossip
    targetPort: 16379
    name: gossip
  clusterIP: None
  selector:
    app: redis-cluster


apiVersion: v1
kind: PersistentVolume
metadata:
  name: redis01
spec:
  capacity:
    storage: 1Gi
  accessModes:
    - ReadWriteOnce
  hostPath:
    path: /redis01

apiVersion: v1
kind: PersistentVolume
metadata:
  name: redis02
spec:
  capacity:
    storage: 1Gi
  accessModes:
    - ReadWriteOnce
  hostPath:
    path: /redis02

apiVersion: v1
kind: PersistentVolume
metadata:
  name: redis03
spec:
  capacity:
    storage: 1Gi
  accessModes:
    - ReadWriteOnce
  hostPath:
    path: /redis03

apiVersion: v1
kind: PersistentVolume
metadata:
  name: redis04
spec:
  capacity:
    storage: 1Gi
  accessModes:
    - ReadWriteOnce
  hostPath:
    path: /redis04

apiVersion: v1
kind: PersistentVolume
metadata:
  name: redis05
spec:
  capacity:
    storage: 1Gi
  accessModes:
    - ReadWriteOnce
  hostPath:
    path: /redis05

apiVersion: v1
kind: PersistentVolume
metadata:
  name: redis06
spec:
  capacity:
    storage: 1Gi
  accessModes:
    - ReadWriteOnce
  hostPath:
    path: /redis06