From 31402494411859435dd8d73be95512a111e22c97 Mon Sep 17 00:00:00 2001 From: kalxas Date: Mon, 13 Feb 2023 13:31:30 +0000 Subject: [PATCH] Commit triggered by a change on the main branch of helm-charts-dev --- charts/rm-resource-catalogue/Chart.yaml | 2 +- charts/rm-resource-catalogue/README.md | 3 ++ .../templates/resource-catalogue-ingress.yaml | 36 +++++++++++++++++++ charts/rm-resource-catalogue/values.yaml | 6 ++++ 4 files changed, 46 insertions(+), 1 deletion(-) diff --git a/charts/rm-resource-catalogue/Chart.yaml b/charts/rm-resource-catalogue/Chart.yaml index 708b564..8d58988 100644 --- a/charts/rm-resource-catalogue/Chart.yaml +++ b/charts/rm-resource-catalogue/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 1.2.0 +version: 1.2.2 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/charts/rm-resource-catalogue/README.md b/charts/rm-resource-catalogue/README.md index dd71564..e2fb00b 100644 --- a/charts/rm-resource-catalogue/README.md +++ b/charts/rm-resource-catalogue/README.md @@ -43,6 +43,9 @@ The configuration parameters in this section control the resource catalogue conf | db.volume_name | Volume name that stores the database data | `resource-catalogue-db-data` | | db.volume_path | Volume path for the database data | `/var/lib/postgresql/data/pgdata` | | db.volume_size | Volume size to store the database data | `500Mi` | +| ingress.enabled | Set true to enable the ingress controler, false to disable | `true` | +| ingress.subpath_enabled | Set true to enable path based configuration of the ingress controler, false to disable | `false` | +| ingress.subpath | Subpath of the resource catalogue to be set to the ingress rules/rewrites. The pycsw.config.server.url value should be set accordingly | `/resource-catalogue` | | ingress.name | Name of the Kubernetes ingress for the catalogue | `resource-catalogue` | | ingress.class | Class of the Kubernetes ingress | `nginx` | | ingress.host | Hostname to be used by the Kubernetes ingress controler | `resource-catalogue.demo.eoepca.org` | diff --git a/charts/rm-resource-catalogue/templates/resource-catalogue-ingress.yaml b/charts/rm-resource-catalogue/templates/resource-catalogue-ingress.yaml index 0bb603b..16f32a8 100644 --- a/charts/rm-resource-catalogue/templates/resource-catalogue-ingress.yaml +++ b/charts/rm-resource-catalogue/templates/resource-catalogue-ingress.yaml @@ -17,6 +17,11 @@ metadata: {{- with .Values.ingress.annotations }} {{- tpl (toYaml .) $ | nindent 4 }} {{- end }} + {{- if .Values.ingress.subpath_enabled }} + {{- with .Values.ingress.subpath_annotations }} + {{- tpl (toYaml .) $ | nindent 4 }} + {{- end }} + {{- end }} spec: {{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} ingressClassName: {{ .Values.ingress.class }} @@ -25,6 +30,36 @@ spec: - host: {{ .Values.ingress.host }} http: paths: + {{- if .Values.ingress.subpath_enabled }} + - path: {{ .Values.ingress.subpath }}/(.*) + {{- if semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion }} + pathType: Prefix + {{- end }} + backend: + {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} + service: + name: {{ .Values.pycsw.service_name }} + port: + number: {{ .Values.pycsw.service_port }} + {{- else }} + serviceName: {{ .Values.pycsw.service_name }} + servicePort: {{ .Values.pycsw.service_port }} + {{- end }} + - path: {{ .Values.ingress.subpath }}$ + {{- if semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion }} + pathType: Exact + {{- end }} + backend: + {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} + service: + name: {{ .Values.pycsw.service_name }} + port: + number: {{ .Values.pycsw.service_port }} + {{- else }} + serviceName: {{ .Values.pycsw.service_name }} + servicePort: {{ .Values.pycsw.service_port }} + {{- end }} + {{- else }} - path: {{- if semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion }} pathType: "ImplementationSpecific" @@ -39,6 +74,7 @@ spec: serviceName: {{ .Values.pycsw.service_name }} servicePort: {{ .Values.pycsw.service_port }} {{- end }} + {{- end }} tls: - hosts: - {{ .Values.ingress.tls_host }} diff --git a/charts/rm-resource-catalogue/values.yaml b/charts/rm-resource-catalogue/values.yaml index c4714d6..606123a 100644 --- a/charts/rm-resource-catalogue/values.yaml +++ b/charts/rm-resource-catalogue/values.yaml @@ -50,10 +50,16 @@ ingress: host: resource-catalogue.demo.eoepca.org tls_host: resource-catalogue.demo.eoepca.org tls_secret_name: resource-catalogue-tls + subpath_enabled: false + subpath: "/resource-catalogue" default_annotations: kubernetes.io/ingress.class: "{{ .Values.ingress.class }}" nginx.ingress.kubernetes.io/enable-cors: "true" nginx.ingress.kubernetes.io/proxy-read-timeout: "600" + subpath_annotations: + nginx.ingress.kubernetes.io/rewrite-target: /$1 + nginx.ingress.kubernetes.io/configuration-snippet: | + rewrite ^({{ .Values.ingress.subpath }})$ $1/ redirect; annotations: cert-manager.io/cluster-issuer: letsencrypt