# Copyright (c) 2020 SIGHUP s.r.l All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.

---
# Source: harbor/templates/redis/statefulset.yaml
apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: redis
  labels:
    app: harbor
    component: redis
spec:
  replicas: 1
  serviceName: redis
  selector:
    matchLabels:
      app: harbor
      component: redis
  template:
    metadata:
      labels:
        app: harbor
        component: redis
    spec:
      securityContext:
        fsGroup: 999
      containers:
        - name: redis
          image: goharbor/redis-photon
          imagePullPolicy: Always
          livenessProbe:
            tcpSocket:
              port: 6379
            initialDelaySeconds: 300
            periodSeconds: 10
          readinessProbe:
            tcpSocket:
              port: 6379
            initialDelaySeconds: 1
            periodSeconds: 10
          resources:
            requests:
              memory: 256Mi
              cpu: 100m
          volumeMounts:
            - name: data
              mountPath: /var/lib/redis
  volumeClaimTemplates:
    - metadata:
        name: data
        labels:
          app: harbor
          component: redis
      spec:
        accessModes: ["ReadWriteOnce"]
        resources:
          requests:
            storage: "1Gi"
