apiVersion: v1
kind: Service
metadata:
  name: {{ include "dnsup.fullname" . }}
  labels:
    {{- include "dnsup.labels" . | nindent 4 }}
  annotations:
    {{- .Values.service.annotations | toYaml | nindent 4 }}
spec:
  type: {{ .Values.service.type }}
  {{- if and (eq .Values.service.type "LoadBalancer" ) .Values.service.LoadBalancerIP }} 
  loadBalancerIP: {{ .Values.service.LoadBalancerIP }}
  {{- end }}
  ports:
    - port: {{ .Values.service.port }}
      targetPort: 53
      protocol: UDP
      name: udp
    - port: {{ .Values.service.port }}
      targetPort: 53
      protocol: TCP
      name: tcp      
  selector:
    {{- include "dnsup.selectorLabels" . | nindent 4 }}