apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: redis-sts
spec:
  serviceName: "redis"
  selector:
    matchLabels:
      app: redis
  template:
    metadata:
      labels:
        app: redis
    spec:
      containers:
      - name: redis
        image: redis:5.0.5-alpine
        resources:
          requests:
            memory: "400Mi"
            cpu: "0.1"
        ports:
        - containerPort: 6379
  volumeClaimTemplates:
    - metadata:
        name: redis-volume
      spec:
        accessModes: ["ReadWriteOnce"]
        resources:
          requests:
            storage: 500m
