A lot of work on the workload library

This commit is contained in:
2024-05-19 18:56:41 +02:00
parent ac6751d3da
commit 19f22c18a1
40 changed files with 322 additions and 310 deletions

View File

@ -0,0 +1,25 @@
{{- 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 }}

View File

@ -0,0 +1,31 @@
{{- define "lib.services" }}
{{- range $k, $v := .Values.services }}
{{- $customName := printf "%s-%s" (include "chart.fullname" $) $k }}
---
# ---------------------------------------------------------------------
# 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" $customName)}}
spec:
{{- if ($v).type }}
type: {{ $v.type }}
{{- else }}
type: ClusterIP
{{- end }}
selector:
{{ include "metadata.selectorLabels" $ | indent 4}}
ports:
{{- range $k,$v := $v.ports }}
- name: {{ $k }}
port: {{ $v.port }}
targetPort: {{ $v.targetPort}}
protocol: {{ $v.protocol}}
{{- end }}
{{- end }}
{{- end -}}