#  Copyright (C) 2021 Intel Corporation
#  SPDX-License-Identifier: BSD-3-Clause

---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: hvs-deployment
  namespace: isecl
  labels:
    env: demo
    app: hvs
spec:
  replicas: 1
  selector:
    matchLabels:
      app: hvs
  template:
    metadata:
      labels:
        app: hvs
    spec:
      securityContext:
        fsGroup: 1001
      containers:
        - name: hvs
          image: <image-name>:<image-tag>
          imagePullPolicy: Always
          securityContext:
           runAsUser: 1001
           runAsGroup: 1001
          ports:
            - containerPort: 8443
          envFrom:
            - configMapRef:
                name: hvs-config
          volumeMounts:
            - name: hvs-config-volume
              mountPath: /etc/hvs/
            - name: hvs-logs-volume
              mountPath: /var/log/hvs/
            - name: hvs-db-certs
              mountPath: /etc/postgresql/
            - mountPath: /etc/secret-volume/
              name: hvs-credentials
              readOnly: true
      volumes:
        - name: hvs-logs-volume
          persistentVolumeClaim:
            claimName: hvs-logs-pvc
        - name: hvs-config-volume
          persistentVolumeClaim:
            claimName: hvs-config-pvc
        - name: hvs-db-certs
          secret:
            secretName: hvs-db-certs
            defaultMode: 0640
        - name: hvs-credentials
          secret:
              secretName: hvs-secret 
