apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: {{.Values.label}}
  name: {{.Values.deployment.name}} 
spec:
  template:
     metadata:
        labels:
          app: {{.Values.label}}
     spec:     
      containers:
        - image: {{.Values.deployment.bdtImage}}
          imagePullPolicy: IfNotPresent
          name: {{.Values.deployment.bdtContainername}}
          
          env:
            - name: KMS_HOST
              value: {{.Values.env.kmsHost}}      
            - name: REG_TOKEN
              value: {{.Values.env.regToken}}   
          volumeMounts:
            - mountPath: {{.Values.deployment.volumeMountPath}}
              name: {{.Values.deployment.volumeName}}
      volumes:
      - name: {{.Values.deployment.volumeName}}
        hostPath:
          path: {{.Values.deployment.volumeHostPath}}
          type: Directory        

  replicas: {{.Values.deployment.replicas}}
  selector:
      matchLabels:
        app: {{.Values.label}}

---

apiVersion: v1
kind: Service
metadata:
  labels: 
    app: {{.Values.label}}
  name: {{.Values.service.name}}
spec:
  selector:
    app: {{.Values.label}}
  type: {{.Values.service.type}}
  ports:
    - port: {{.Values.service.port}}
      nodePort: {{.Values.service.nodePort}}

---
