{{- include "nplus.init" $ -}} apiVersion: v1 kind: Service metadata: {{- if .this.utils.includeNamespace }} namespace: {{ .Release.Namespace }} {{- end }} name: {{ .component.fullName }} labels: {{- include "nplus.instanceLabels" . | nindent 4 }} annotations: {{- include "nplus.annotations" . | nindent 4 }} {{- include "nplus.securityAnnotations" . | nindent 4 }} spec: type: ClusterIP clusterIP: None ports: {{- if .this.ui }} {{- include "nplus.defaultServicePorts" . | nindent 4 }} {{- end }} selector: {{- if eq .this.service.selector "component" }} {{- include "nplus.selectorLabels" . | nindent 4 }} {{- else if eq .this.service.selector "type" }} {{- include "nplus.selectorLabelsNc" . | nindent 4 }} {{- else }} {{- fail (printf "Unknown Service Selector Type: %s - must be component or type" .this.service.selector) }} {{- end }}