From 4ed3945a6e2aaa267c55166ec82629ca3a14fa3b Mon Sep 17 00:00:00 2001 From: Rhea Danzey Date: Tue, 7 Nov 2023 11:43:40 -0600 Subject: [PATCH 1/2] helm - Clarify host/path configuration, fix link between hookshot service ports / ingress configuration Signed-off-by: Rhea Danzey --- helm/hookshot/templates/ingress-appservice.yaml | 10 +++++----- helm/hookshot/templates/ingress.yaml | 10 +++++----- helm/hookshot/values.yaml | 15 +++++++++++++-- 3 files changed, 23 insertions(+), 12 deletions(-) diff --git a/helm/hookshot/templates/ingress-appservice.yaml b/helm/hookshot/templates/ingress-appservice.yaml index 3a537d569..3de2eb005 100644 --- a/helm/hookshot/templates/ingress-appservice.yaml +++ b/helm/hookshot/templates/ingress-appservice.yaml @@ -1,7 +1,7 @@ --- {{- if .Values.ingress.appservice.enabled -}} {{- $fullName := include "hookshot.fullname" . -}} -{{- $svcPort := .Values.service.port -}} +{{- $svcPort := .Values.service.appservice.port -}} {{- if and .Values.ingress.appservice.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} {{- if not (hasKey .Values.ingress.appservice.annotations "kubernetes.io/ingress.class") }} {{- $_ := set .Values.ingress.appservice.annotations "kubernetes.io/ingress.class" .Values.ingress.appservice.className}} @@ -44,18 +44,18 @@ spec: paths: {{- range .paths }} - path: {{ .path }} - {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} - pathType: {{ .pathType }} + {{- if semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion }} + pathType: {{ .pathType | default "ImplementationSpecific" }} {{- end }} backend: {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} service: name: {{ $fullName }} port: - number: {{ .port }} + number: {{ $svcPort }} {{- else }} serviceName: {{ $fullName }} - servicePort: {{ .port }} + servicePort: {{ $svcPort }} {{- end }} {{- end }} {{- end }} diff --git a/helm/hookshot/templates/ingress.yaml b/helm/hookshot/templates/ingress.yaml index 129d19a3f..3deb91238 100644 --- a/helm/hookshot/templates/ingress.yaml +++ b/helm/hookshot/templates/ingress.yaml @@ -1,7 +1,7 @@ --- {{- if .Values.ingress.webhook.enabled -}} {{- $fullName := include "hookshot.fullname" . -}} -{{- $svcPort := .Values.service.port -}} +{{- $svcPort := .Values.service.webhook.port -}} {{- if and .Values.ingress.webhook.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} {{- if not (hasKey .Values.ingress.webhook.annotations "kubernetes.io/ingress.class") }} {{- $_ := set .Values.ingress.webhook.annotations "kubernetes.io/ingress.class" .Values.ingress.webhook.className}} @@ -44,18 +44,18 @@ spec: paths: {{- range .paths }} - path: {{ .path }} - {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} - pathType: {{ .pathType }} + {{- if semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion }} + pathType: {{ .pathType | default "ImplementationSpecific" }} {{- end }} backend: {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} service: name: {{ $fullName }} port: - number: {{ .port }} + number: {{ $svcPort }} {{- else }} serviceName: {{ $fullName }} - servicePort: {{ .port }} + servicePort: {{ $svcPort}} {{- end }} {{- end }} {{- end }} diff --git a/helm/hookshot/values.yaml b/helm/hookshot/values.yaml index a4b1302b7..7d87f8baa 100644 --- a/helm/hookshot/values.yaml +++ b/helm/hookshot/values.yaml @@ -73,8 +73,14 @@ ingress: className: "" # -- Annotations for webhook ingress annotations: {} + # -- Host configuration for webhook ingress - hosts: [] + hosts: + - host: webhook.hookshot.chart-example.local + paths: + - path: "/" + pathType: ImplementationSpecific + # -- TLS configuration for webhook ingress tls: [] @@ -86,7 +92,12 @@ ingress: # -- Annotations for appservice ingress annotations: {} # -- Host configuration for appservice ingress - hosts: [] + hosts: + - host: webhook.hookshot.chart-example.local + paths: + - path: "/" + pathType: ImplementationSpecific + # -- TLS configuration for appservice ingress tls: [] From b22be0fd957fa7d9e6deeb9bf8bf28cb27e28ed7 Mon Sep 17 00:00:00 2001 From: Rhea Danzey Date: Tue, 7 Nov 2023 11:50:18 -0600 Subject: [PATCH 2/2] Changelog Signed-off-by: Rhea Danzey --- changelog.d/836.doc | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/836.doc diff --git a/changelog.d/836.doc b/changelog.d/836.doc new file mode 100644 index 000000000..4098a8037 --- /dev/null +++ b/changelog.d/836.doc @@ -0,0 +1 @@ +Helm Chart - Minor tidy up of ingress configuration and explicit default configuration in values.yaml, no longer requires setting the port in ingress as well as services \ No newline at end of file