apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: redis
  namespace: flyte
spec:
  replicas: 1
  selector:
    matchLabels:
      app: redis-resource-manager
  serviceName: redis-resource-manager
  template:
    metadata:
      labels:
        app: redis-resource-manager
    spec:
      containers:
      - env:
        - name: REDIS_PASSWORD
          value: mypassword
        image: docker.io/bitnami/redis:4.0.2-r1
        imagePullPolicy: IfNotPresent
        livenessProbe:
          exec:
            command:
            - redis-cli
            - ping
          failureThreshold: 3
          initialDelaySeconds: 30
          periodSeconds: 10
          successThreshold: 1
          timeoutSeconds: 5
        name: redis-resource-manager
        ports:
        - containerPort: 6379
          name: redis
          protocol: TCP
        readinessProbe:
          exec:
            command:
            - redis-cli
            - ping
          failureThreshold: 3
          initialDelaySeconds: 5
          periodSeconds: 10
          successThreshold: 1
          timeoutSeconds: 1
        resources:
          requests:
            cpu: 200m
            memory: 128Mi
        volumeMounts:
        - mountPath: /bitnami
          name: redis-data
      dnsPolicy: ClusterFirst
      restartPolicy: Always
      volumes:
        - name: redis-data
          emptyDir: {}
