From 2b536cc5c004727962fa074e193147460514d108 Mon Sep 17 00:00:00 2001 From: seveneves Date: Thu, 14 Sep 2023 09:47:19 +0200 Subject: [PATCH] Allow overriding of `pathType` in ingress rules to support `ImplementationSpecific` Depending on implementation of ingressClass, hardcoded value `Prefix` for `pathType` of rules won't work and `ImplementationSpecific` should be specified instead. This change add a new parameter for both helm charts for `opensearch` and `opensearch-dashboards` * `opensearch` gets `pathType: Prefix` along with the existing `path: /` in `value.yaml` * `opensearch-dashboards` gets `pathType: Prefix` in `ingress.hosts.paths` array and defaults to `Prefix` in the template `ingress.yaml` and the default rule specified in `values.yaml`. Signed-off-by: seveneves --- charts/opensearch-dashboards/CHANGELOG.md | 1 + charts/opensearch-dashboards/Chart.yaml | 2 +- charts/opensearch-dashboards/templates/ingress.yaml | 2 +- charts/opensearch-dashboards/values.yaml | 1 + charts/opensearch/CHANGELOG.md | 1 + charts/opensearch/Chart.yaml | 2 +- charts/opensearch/templates/ingress.yaml | 3 ++- charts/opensearch/values.yaml | 1 + 8 files changed, 9 insertions(+), 4 deletions(-) diff --git a/charts/opensearch-dashboards/CHANGELOG.md b/charts/opensearch-dashboards/CHANGELOG.md index 11311409..a68f2c3f 100644 --- a/charts/opensearch-dashboards/CHANGELOG.md +++ b/charts/opensearch-dashboards/CHANGELOG.md @@ -6,6 +6,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 --- ## [Unreleased] ### Added +- Support `pathType` for ingress rules ### Changed ### Deprecated ### Removed diff --git a/charts/opensearch-dashboards/Chart.yaml b/charts/opensearch-dashboards/Chart.yaml index 3c7d89c4..649e2bf3 100644 --- a/charts/opensearch-dashboards/Chart.yaml +++ b/charts/opensearch-dashboards/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.15.0 +version: 1.16.0 # 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/opensearch-dashboards/templates/ingress.yaml b/charts/opensearch-dashboards/templates/ingress.yaml index 47d3bde6..e46334f0 100644 --- a/charts/opensearch-dashboards/templates/ingress.yaml +++ b/charts/opensearch-dashboards/templates/ingress.yaml @@ -44,7 +44,7 @@ spec: paths: {{- range .paths }} - path: {{ .path }} - pathType: Prefix + pathType: {{ .pathType | default "Prefix" }} backend: service: name: {{ .backend.serviceName | default $fullName }} diff --git a/charts/opensearch-dashboards/values.yaml b/charts/opensearch-dashboards/values.yaml index cc3dc629..b4930eb7 100644 --- a/charts/opensearch-dashboards/values.yaml +++ b/charts/opensearch-dashboards/values.yaml @@ -177,6 +177,7 @@ ingress: - host: chart-example.local paths: - path: / + pathType: Prefix backend: serviceName: "" servicePort: "" diff --git a/charts/opensearch/CHANGELOG.md b/charts/opensearch/CHANGELOG.md index 77552c5b..68302f31 100644 --- a/charts/opensearch/CHANGELOG.md +++ b/charts/opensearch/CHANGELOG.md @@ -6,6 +6,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 --- ## [Unreleased] ### Added +- Support `pathType` for ingress rules ### Changed ### Deprecated ### Removed diff --git a/charts/opensearch/Chart.yaml b/charts/opensearch/Chart.yaml index 435c04c2..efe29d43 100644 --- a/charts/opensearch/Chart.yaml +++ b/charts/opensearch/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.22.0 +version: 1.23.0 # 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/opensearch/templates/ingress.yaml b/charts/opensearch/templates/ingress.yaml index 7a4d0da8..8a2ffcda 100644 --- a/charts/opensearch/templates/ingress.yaml +++ b/charts/opensearch/templates/ingress.yaml @@ -2,6 +2,7 @@ {{- $fullName := include "opensearch.serviceName" . -}} {{- $servicePort := .Values.httpPort -}} {{- $ingressPath := .Values.ingress.path -}} +{{- $ingressPathType := .Values.ingress.pathType -}} {{- $ingressApiIsStable := eq (include "opensearch.ingress.isStable" .) "true" -}} {{- $ingressSupportsIngressClassName := eq (include "opensearch.ingress.supportsIngressClassName" .) "true" -}} {{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} @@ -41,7 +42,7 @@ spec: http: paths: - path: {{ $ingressPath }} - pathType: Prefix + pathType: {{ $ingressPathType }} backend: service: name: {{ $fullName }} diff --git a/charts/opensearch/values.yaml b/charts/opensearch/values.yaml index 4036a0cc..e609917f 100644 --- a/charts/opensearch/values.yaml +++ b/charts/opensearch/values.yaml @@ -389,6 +389,7 @@ ingress: # kubernetes.io/ingress.class: nginx # kubernetes.io/tls-acme: "true" path: / + pathType: Prefix hosts: - chart-example.local tls: []