A lot of work on the workload library
This commit is contained in:
25
charts/workload/templates/service/_service.tpl
Normal file
25
charts/workload/templates/service/_service.tpl
Normal 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 }}
|
31
charts/workload/templates/service/_services.tpl
Normal file
31
charts/workload/templates/service/_services.tpl
Normal 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 -}}
|
||||
|
Reference in New Issue
Block a user