apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: general-cache-set
  namespace: microservices-namespace
  labels:
    moduleid: microservice-cache-data
    version: 1.70.0-master
spec:
  serviceName: general-cache-service
  selector:
    matchLabels:
      app: general-cache-set
  replicas: 1
  template:
    metadata:
      labels:
        moduleid: microservice-cache-data
        version: 1.70.0-master
        app: general-cache-set
    spec:
      terminationGracePeriodSeconds: 10
      containers:
        -
          name: data
          image: 'redis:3.2-alpine'
          args:
            - '--requirepass'
            - SECRET_PASSWORD
            - '--appendonly'
            - 'yes'
            - '--save'
            - '900'
            - '1'
            - '--save'
            - '30'
            - '1'
          ports:
            -
              containerPort: 6379
          volumeMounts:
            -
              name: microservice-cache-storage
              mountPath: /data
  volumeClaimTemplates:
    -
      metadata:
        name: microservice-cache-storage
      spec:
        accessModes:
          - ReadWriteOnce
        storageClassName: local-storage
        resources:
          requests:
            storage: 1Gi
