---
apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: redis
spec:
  replicas: 1
  serviceName: redis
  selector:
    matchLabels:
      app.kubernetes.io/name: redis
      app.kubernetes.io/instance: matrix
  template:
    metadata:
      labels:
        app.kubernetes.io/name: redis
        app.kubernetes.io/instance: matrix
    spec:
      containers:
        - name: redis
          image: "redis:6.2.6"
          imagePullPolicy: IfNotPresent
          args:
            - --save
            - "60"
            - "1"
            - "--loglevel warning"
          ports:
            - name: redis
              containerPort: 6379
              protocol: TCP
          volumeMounts:
            - name: data
              mountPath: /data
      volumes:
        - name: data
          persistentVolumeClaim:
            claimName: redis
