# version: '3.7'
# k8s namespace network
---
apiVersion: v1
kind: Service
metadata:
  name: redis
  namespace: edoc2
  labels:
    app: redis
spec:
  ports:
  - name: redis6379
    port: 6379
    targetPort: 6379
    protocol: TCP
  selector:
    app: redis
  type: ClusterIP
---
apiVersion: apps/v1
#kind: StatefulSet
kind: Deployment
metadata:
  name: redis
  namespace: edoc2
  labels:
    app: redis
    k8s-app: redis
spec:
  selector:
    matchLabels:
      app: redis
  #serviceName: redis
  replicas: 1
  revisionHistoryLimit: 5
  template:
    metadata:
      labels:
        app: redis
    spec:
      hostname: redis
      terminationGracePeriodSeconds: 30
      containers:
      - name: redis-container
        image: registry.edoc2.com:5000/edoc2v5/redis:prod600-v4.0.14.8
        imagePullPolicy: IfNotPresent
        #env:
        #- name: MODE
        #  value: "standalone"
        volumeMounts:
          - mountPath: /data
            name: owner-redis-volume
        ports:
        - containerPort: 6379
          name: redis6379
          protocol: TCP
      restartPolicy: Always
      volumes:
        - name: owner-redis-volume
          hostPath:
            path: /home/edoc2/macrowing/edoc2v5/data/redis
            type: DirectoryOrCreate
      nodeSelector:
        "node.labels.nodelabels": Middleware
        # nodetype: InDrive
