From b6a5d32b500f8718e145e4023f90e9eacd2ef6a0 Mon Sep 17 00:00:00 2001 From: Derek Gaffney <17263955+gaffneyd4@users.noreply.github.com> Date: Thu, 30 Mar 2023 07:47:33 -0400 Subject: [PATCH 1/2] Allow configuration of pathType in Ingress resource Signed-off-by: Derek Gaffney <17263955+gaffneyd4@users.noreply.github.com> --- charts/longhorn/templates/ingress.yaml | 2 +- charts/longhorn/values.yaml | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/charts/longhorn/templates/ingress.yaml b/charts/longhorn/templates/ingress.yaml index ee47f8b8..402c624e 100644 --- a/charts/longhorn/templates/ingress.yaml +++ b/charts/longhorn/templates/ingress.yaml @@ -27,7 +27,7 @@ spec: paths: - path: {{ default "" .Values.ingress.path }} {{- if (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} - pathType: ImplementationSpecific + pathType: {{ .Values.ingress.pathType }} {{- end }} backend: {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} diff --git a/charts/longhorn/values.yaml b/charts/longhorn/values.yaml index 55805f8b..cc0eaf7f 100644 --- a/charts/longhorn/values.yaml +++ b/charts/longhorn/values.yaml @@ -291,6 +291,11 @@ ingress: ## then you can access the UI by using the following full path {{host}}+{{path}} path: / + ## The pathType configures how the Ingress Controller implementation interprets the path + ## There are three supported path types, please see + ## ref: https://kubernetes.io/docs/concepts/services-networking/ingress/#path-types + pathType: ImplementationSpecific + ## Ingress annotations done as key:value pairs ## If you're using kube-lego, you will want to add: ## kubernetes.io/tls-acme: true From 2e9931116a98cf7565a9d742c9a8b2c010232d1b Mon Sep 17 00:00:00 2001 From: Derek Gaffney <17263955+gaffneyd4@users.noreply.github.com> Date: Thu, 30 Mar 2023 07:56:42 -0400 Subject: [PATCH 2/2] Route by port name instead of number Signed-off-by: Derek Gaffney <17263955+gaffneyd4@users.noreply.github.com> --- charts/longhorn/templates/ingress.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/longhorn/templates/ingress.yaml b/charts/longhorn/templates/ingress.yaml index 402c624e..a78bbb92 100644 --- a/charts/longhorn/templates/ingress.yaml +++ b/charts/longhorn/templates/ingress.yaml @@ -34,10 +34,10 @@ spec: service: name: longhorn-frontend port: - number: 80 + name: http {{- else }} serviceName: longhorn-frontend - servicePort: 80 + servicePort: http {{- end }} {{- if .Values.ingress.tls }} tls: