{{- define "lib.service" }} --- # --------------------------------------------------------------------- # This service is created as a part of badhouseplants helm library # please see /lib/tempaltes/service/_service.tpl # --------------------------------------------------------------------- apiVersion: v1 kind: Service {{- include "lib.metadata" (dict "Context" . "customName" "")}} spec: {{- if (.Values.service).type }} type: {{ .Values.service.type }} {{- else }} type: ClusterIP {{- end }} selector: {{ include "metadata.selectorLabels" . | indent 4}} ports: {{- range $k,$v := .Values.service.ports }} - name: {{ $k }} port: {{ $v.port }} targetPort: {{ $v.targetPort}} protocol: {{ $v.protocol}} {{- end }} {{- end }}