apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    run: {{.Values.runlabel}}
  name: appserver-deployment
spec:
  template:
     metadata:
        name: {{.Values.deployment.name}}
        labels:
          run: {{.Values.runlabel}}
     spec:
        containers:
          - image: {{.Values.deployment.appimage}}
            imagePullPolicy: IfNotPresent
            name: {{.Values.deployment.appimagename}}        

  replicas: {{.Values.deployment.replicas}}
  selector:
      matchLabels:
        run: {{.Values.runlabel}}
---
apiVersion: v1
kind: Service
metadata:
  name: {{.Values.service.name}}
spec:
  selector:
    run: {{.Values.runlabel}}
  type: {{.Values.service.type}}
  ports:
    - name: {{.Values.service.appname}}
      port: {{.Values.service.appPort}}
      targetPort: {{.Values.service.apptargetPort}}
      nodePort: {{.Values.service.appnodePort}}