apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: redismaster
  labels:
    app: redismaster
spec:
  replicas: 1
  selector:
    matchLabels:
      app: redismaster
  serviceName: "redis-master-service"
  template:
    metadata:
      name: redis
      labels:
        app: redismaster
    spec:
      volumes:
        - name: data
          persistentVolumeClaim:
            claimName: "redis-pvc"
        - name: config-volume
          configMap:
            name: redis-config
      containers:
        - name: redismaster
          image: redis
          command: ["redis-server"]
          args: ["/etc/config/redis-master.conf"]
          imagePullPolicy: Always
          ports:
            - containerPort: 6379
              name: redis
          volumeMounts:
            - name: data
              mountPath: /usr/share/redis
            - name: config-volume
              mountPath: /etc/config
