apiVersion: v1
kind: Service
metadata:
  name: {{ .Chart.Name }}
  labels:
    run: {{ .Chart.Name }}
  annotations:
  {{- if (eq .Values.provider "aws") }}
    external-dns.alpha.kubernetes.io/hostname: amundsen-{{ .Chart.Name }}-{{ .Values.environment }}.{{ .Values.dnsZone }}
    service.beta.kubernetes.io/aws-load-balancer-internal: 0.0.0.0/0
    service.beta.kubernetes.io/aws-load-balancer-type: nlb 
  {{- end }}   
spec:
  type: LoadBalancer
  externalTrafficPolicy: Local
  ports:
    - port: 9200
      name: {{ .Chart.Name }}-{{ .Values.environment }}-http
      targetPort: 9200
      nodePort: 30200
  selector:
    run: {{ .Chart.Name }}