From e2c757af0dcb245fbebf91c19bcc8a594e11802c Mon Sep 17 00:00:00 2001 From: aaronstutzer Date: Tue, 13 Feb 2024 10:10:32 +0100 Subject: [PATCH] service --- charts/gke-ingress/templates/_helpers.tpl | 4 ++-- charts/gke-ingress/templates/service.yaml | 15 +++++++++------ 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/charts/gke-ingress/templates/_helpers.tpl b/charts/gke-ingress/templates/_helpers.tpl index 932ef6c..432e2f4 100644 --- a/charts/gke-ingress/templates/_helpers.tpl +++ b/charts/gke-ingress/templates/_helpers.tpl @@ -46,13 +46,13 @@ app.kubernetes.io/name: {{ include "gke-ingress.name" . }} {{- if hasKey .Values.service.labels "app" }} {{- with .Values.service.labels.app }}app: {{.|quote}} {{- end}} -{{- else }}app: {{ include "gateway.name" . }} +{{- else }}app: {{ include "gke-ingress.name" . }} {{- end }} {{- if hasKey .Values.service.labels "istio" }} {{- with .Values.service.labels.istio }} istio: {{.|quote}} {{- end}} {{- else }} -istio: {{ include "gateway.name" . | trimPrefix "istio-" }} +istio: {{ include "gke-ingress.name" . | trimPrefix "istio-" }} {{- end }} {{- end }} \ No newline at end of file diff --git a/charts/gke-ingress/templates/service.yaml b/charts/gke-ingress/templates/service.yaml index fa46cbe..fb2f160 100644 --- a/charts/gke-ingress/templates/service.yaml +++ b/charts/gke-ingress/templates/service.yaml @@ -1,15 +1,18 @@ +{{range .Values.service}} apiVersion: v1 kind: Service metadata: - name: {{ .Values.service.name }} - namespace: {{ .Release.Namespace }} + name: {{ .name }} + namespace: {{ default "istio-ingress" .namespace}} labels: {{- include "gke-ingress.labels" . | nindent 4 }} annotations: - {{- .Values.service.annotations | toYaml | nindent 4 }} + {{- .annotations | toYaml | nindent 4 }} spec: - type: {{ .Values.service.type }} + type: {{ .type }} ports: -{{ .Values.service.ports | toYaml | indent 4 }} +{{ .ports | toYaml | indent 4 }} selector: - {{- include "gke-ingress.selectorLabels" . | nindent 4 }} \ No newline at end of file + {{- include "gke-ingress.selectorLabels" . | nindent 4 }} +--- +{{ end }} \ No newline at end of file