Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

helm - Ingress configuration QoL fixes #836

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/836.doc
Original file line number Diff line number Diff line change
@@ -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
10 changes: 5 additions & 5 deletions helm/hookshot/templates/ingress-appservice.yaml
Original file line number Diff line number Diff line change
@@ -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}}
Expand Down Expand Up @@ -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 }}
Expand Down
10 changes: 5 additions & 5 deletions helm/hookshot/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -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}}
Expand Down Expand Up @@ -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 }}
Expand Down
15 changes: 13 additions & 2 deletions helm/hookshot/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: []

Expand All @@ -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: []

Expand Down