{{- if .Values.service.enabled -}}
apiVersion: v1
kind: Service
metadata:
  name: {{ include "cups-airprint.fullname" . }}
  labels:
    {{- include "cups-airprint.labels" . | nindent 4 }}
spec:
  type: {{ .Values.service.type }}
  ports:
    - port: {{ .Values.service.port }}
      targetPort: {{ .Values.service.port }}
      protocol: TCP
      name: http
  {{- if .Values.service.externalIPs.enabled }}
  externalTrafficPolicy: Local
  externalIPs:{{- range .Values.service.externalIPs.ip }}
  - {{.}}{{- end }}
  {{- end }}
  selector:
    {{- include "cups-airprint.selectorLabels" . | nindent 4 }}
{{- end }}
