softplayer-helm-lib/charts/workload-testing/templates/service/_service.tpl

26 lines
759 B
Smarty
Raw Normal View History

2024-05-13 15:20:21 +00:00
{{- define "lib.service" }}
---
# ---------------------------------------------------------------------
# This service is created as a part of softplayer 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 }}