From 6d1a271b443b84226d17829a34fda25774ac38a3 Mon Sep 17 00:00:00 2001 From: Chi-En Wu Date: Wed, 15 Apr 2020 16:05:36 +0800 Subject: [PATCH] feat: add template `common.service` --- templates/_service.yaml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 templates/_service.yaml diff --git a/templates/_service.yaml b/templates/_service.yaml new file mode 100644 index 0000000..082ff27 --- /dev/null +++ b/templates/_service.yaml @@ -0,0 +1,20 @@ +{{/* vim: set filetype=mustache: */}} + +{{- define "common.service.tpl" -}} +apiVersion: v1 +kind: Service +{{ include "common.metadata" . }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: http + protocol: TCP + name: http + selector: + {{- include "common.selectorLabels" . | nindent 4 }} +{{- end -}} + +{{- define "common.service" -}} +{{- include "common.utils.flattenCall" (list "common.utils.merge" . "common.service.tpl") -}} +{{- end -}}