apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: redis-stateful-set
  namespace: mafia
spec:
  selector:
    matchLabels:
      app: mafia
  replicas: 1
  serviceName: "redis"
  template:
    metadata:
      labels:
        name: redis
        app: mafia
    spec:
      securityContext:
        fsGroup: 999
      containers:
        - name: redis-container
          image: redis:5.0.8-buster
          command: ["redis-server", "--bind", "0.0.0.0"]
          ports:
          - containerPort: 6379
          volumeMounts:
          - mountPath: "/data"
            name: redis-data
  volumeClaimTemplates:
    - metadata:
        name: redis-data
      spec:
        accessModes: [ "ReadWriteOnce" ]
        resources:
          requests:
            storage: 32Gi
