From 2b03a588f36f3270b9204a683ddf91d69fb3d093 Mon Sep 17 00:00:00 2001 From: mikeeq Date: Tue, 10 Aug 2021 10:44:52 +0200 Subject: [PATCH 1/2] helm-guestbook: Add ingress yaml --- helm-guestbook/templates/ingress.yaml | 36 +++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 helm-guestbook/templates/ingress.yaml diff --git a/helm-guestbook/templates/ingress.yaml b/helm-guestbook/templates/ingress.yaml new file mode 100644 index 0000000..016e1e7 --- /dev/null +++ b/helm-guestbook/templates/ingress.yaml @@ -0,0 +1,36 @@ +{{- if .Values.ingress -}} +{{- if .Values.ingress.enabled -}} +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + annotations: +{{ toYaml .Values.ingress.annotations | indent 4 }} + labels: +{{ toYaml .Values.ingress.labels | indent 4 }} + name: {{ template "helm-guestbook.fullname" .}}-socks-ingress +spec: +{{- if .Values.ingress.tls }} + tls: + {{- range .Values.ingress.tls }} + - hosts: + {{- range .hosts }} + - {{ . | quote }} + {{- end }} + secretName: {{ .secretName }} + {{- end }} +{{- end }} + rules: + {{- range .Values.ingress.hosts }} + - host: {{ . | quote }} + http: + paths: + - path: {{ $.Values.ingress.path }} + pathType: Prefix + backend: + service: + name: http + port: + number: {{ $.Values.service.port }} + {{- end }} +{{- end }} +{{- end }} From 0a23d14ee030229d40c32f3941c71983b7c88ddd Mon Sep 17 00:00:00 2001 From: mikeeq Date: Tue, 10 Aug 2021 11:14:20 +0200 Subject: [PATCH 2/2] Change service name --- helm-guestbook/templates/ingress.yaml | 2 +- helm-guestbook/templates/service.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/helm-guestbook/templates/ingress.yaml b/helm-guestbook/templates/ingress.yaml index 016e1e7..28c0b32 100644 --- a/helm-guestbook/templates/ingress.yaml +++ b/helm-guestbook/templates/ingress.yaml @@ -28,7 +28,7 @@ spec: pathType: Prefix backend: service: - name: http + name: guestbook-svc port: number: {{ $.Values.service.port }} {{- end }} diff --git a/helm-guestbook/templates/service.yaml b/helm-guestbook/templates/service.yaml index b7aab0b..3ce0420 100644 --- a/helm-guestbook/templates/service.yaml +++ b/helm-guestbook/templates/service.yaml @@ -1,7 +1,7 @@ apiVersion: v1 kind: Service metadata: - name: {{ template "helm-guestbook.fullname" . }} + name: guestbook-svc labels: app: {{ template "helm-guestbook.name" . }} chart: {{ template "helm-guestbook.chart" . }}