{{- if or (not .Values.global.excludePortals) (not (has "citizen" .Values.global.excludePortals)) (not (has "officer" .Values.global.excludePortals)) }}
apiVersion: v1
kind: Service
metadata:
  name: {{ .Values.name }}
  labels:
    app: {{ .Values.name }}
    version: {{ .Values.version }}
spec:
  {{- if .Values.service.clusterIP }}
  clusterIP: {{ .Values.service.clusterIP }}
  {{- end }}
  ports:
    - name: api
      {{- if .Values.service.type }}
      {{- if eq .Values.service.type "NodePort" }}
      nodePort: {{ .Values.service.nodePort }}
      {{- end }}
      {{- end }}
      port: {{ .Values.service.port }}
      targetPort: {{ default .Values.service.port .Values.service.targetPort }}
  selector:
    app: {{ .Values.name }}
  type: {{ default "ClusterIP" (.Values.service.type | quote) }}
{{- end }}