From 6b3419dc31377ce090435c2ccfb88e9827e901c6 Mon Sep 17 00:00:00 2001 From: KirbyKatcher <115538070+KirbyKatcher@users.noreply.github.com> Date: Tue, 16 Apr 2024 15:06:51 +0100 Subject: [PATCH] created specific ingress for requests to api/bootstrap from outside the cluster (#20) * created specific ingress for requests to api/bootstrap from outside the cluster Signed-off-by: Savvas Kyriacou * Update bootstrap ingress rewrite path Signed-off-by: Eamonn Mansour <47121388+eamansour@users.noreply.github.com> * Fix webui liveness and readiness probe warnings Signed-off-by: Eamonn Mansour <47121388+eamansour@users.noreply.github.com> * Update bootstrap ingress name Signed-off-by: Eamonn Mansour <47121388+eamansour@users.noreply.github.com> --------- Signed-off-by: Savvas Kyriacou Signed-off-by: Eamonn Mansour <47121388+eamansour@users.noreply.github.com> Co-authored-by: Eamonn Mansour <47121388+eamansour@users.noreply.github.com> --- .../templates/api-bootstrap-ingress.yaml | 33 +++++++++++++++++++ charts/ecosystem/templates/api-ingress.yaml | 2 +- charts/ecosystem/templates/webui.yaml | 6 ++-- 3 files changed, 36 insertions(+), 5 deletions(-) create mode 100644 charts/ecosystem/templates/api-bootstrap-ingress.yaml diff --git a/charts/ecosystem/templates/api-bootstrap-ingress.yaml b/charts/ecosystem/templates/api-bootstrap-ingress.yaml new file mode 100644 index 0000000..f137a20 --- /dev/null +++ b/charts/ecosystem/templates/api-bootstrap-ingress.yaml @@ -0,0 +1,33 @@ +# +# Copyright contributors to the Galasa project +# +# SPDX-License-Identifier: EPL-2.0 +# + +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: {{ .Release.Name }}-api-bootstrap + annotations: + {{- with .Values.ingress.annotations }} + {{- toYaml . | nindent 4 }} + {{- end }} + nginx.ingress.kubernetes.io/rewrite-target: /bootstrap/external +spec: + ingressClassName: {{ .Values.ingress.ingressClassName }} + {{- with .Values.ingress.tls }} + tls: + {{- toYaml . | nindent 4 }} + {{- end }} + rules: + - host: {{ .Values.externalHostname }} + http: + paths: + - path: /api/bootstrap + pathType: ImplementationSpecific + backend: + service: + name: {{ .Release.Name }}-api + port: + number: 8080 + diff --git a/charts/ecosystem/templates/api-ingress.yaml b/charts/ecosystem/templates/api-ingress.yaml index 520bbe6..2ba8a22 100644 --- a/charts/ecosystem/templates/api-ingress.yaml +++ b/charts/ecosystem/templates/api-ingress.yaml @@ -23,7 +23,7 @@ spec: - host: {{ .Values.externalHostname }} http: paths: - - path: /api(/|$)(.*) + - path: /api(/|$)((?!bootstrap).*) pathType: ImplementationSpecific backend: service: diff --git a/charts/ecosystem/templates/webui.yaml b/charts/ecosystem/templates/webui.yaml index b2442cd..72b8a12 100644 --- a/charts/ecosystem/templates/webui.yaml +++ b/charts/ecosystem/templates/webui.yaml @@ -66,14 +66,12 @@ spec: - containerPort: 8080 name: http livenessProbe: - httpGet: - path: / + tcpSocket: port: 8080 initialDelaySeconds: 5 periodSeconds: 60 readinessProbe: - httpGet: - path: / + tcpSocket: port: 8080 initialDelaySeconds: 5 periodSeconds: 10