Skip to content

Commit d2011a3

Browse files
committed
update ingress values and implementation
1 parent a8e38ce commit d2011a3

File tree

3 files changed

+49
-38
lines changed

3 files changed

+49
-38
lines changed

cloud/helm-chart/src/main/helm/zilla/templates/NOTES.txt

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
Connect to Zilla by running these commands:
21
{{- if .Values.ingress.enabled }}
3-
{{- range $host := .Values.ingress.hosts }}
4-
{{- range .paths }}
5-
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }}
6-
{{- end }}
2+
Zilla is available through an ingress controller at the base url(s):
3+
{{- $host := or .Values.ingress.host "localhost" -}}
4+
{{- range $path := .Values.ingress.paths }}
5+
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host }}{{ $path.path }}
6+
{{- else }}
7+
Connect to Zilla by running these commands:
78
{{- end }}
89
{{- else if contains "NodePort" .Values.service.type }}
910
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "zilla.fullname" . }})

cloud/helm-chart/src/main/helm/zilla/templates/ingress.yaml

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -22,39 +22,37 @@ metadata:
2222
{{- toYaml . | nindent 4 }}
2323
{{- end }}
2424
spec:
25-
{{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }}
26-
ingressClassName: {{ .Values.ingress.className }}
27-
{{- end }}
28-
{{- if .Values.ingress.tls }}
25+
{{- if .Values.ingress.tls.enabled }}
2926
tls:
30-
{{- range .Values.ingress.tls }}
3127
- hosts:
32-
{{- range .hosts }}
33-
- {{ . | quote }}
34-
{{- end }}
35-
secretName: {{ .secretName }}
36-
{{- end }}
28+
- {{ tpl .Values.ingress.host . }}
29+
secretName: {{ .Values.ingress.tls.secretName }}
30+
{{- end }}
31+
{{- if .Values.ingress.ingressClassName }}
32+
ingressClassName: {{ .Values.ingress.ingressClassName }}
3733
{{- end }}
3834
rules:
39-
{{- range .Values.ingress.hosts }}
40-
- host: {{ .host | quote }}
41-
http:
35+
- http:
4236
paths:
43-
{{- range .paths }}
37+
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}}
38+
{{- range .Values.ingress.paths }}
4439
- path: {{ .path }}
45-
{{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }}
4640
pathType: {{ .pathType }}
47-
{{- end }}
4841
backend:
49-
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
5042
service:
5143
name: {{ $fullName }}
5244
port:
5345
number: {{ .port }}
54-
{{- else }}
46+
{{- end }}
47+
{{- else -}}
48+
{{- range .Values.ingress.paths }}
49+
- path: {{ .path }}
50+
backend:
5551
serviceName: {{ $fullName }}
5652
servicePort: {{ .port }}
57-
{{- end }}
5853
{{- end }}
59-
{{- end }}
54+
{{- end }}
55+
{{- if tpl .Values.ingress.host . }}
56+
host: {{ tpl .Values.ingress.host . }}
57+
{{- end }}
6058
{{- end }}

cloud/helm-chart/src/main/helm/zilla/values.yaml

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -96,22 +96,34 @@ service:
9696
type: ClusterIP
9797
ports: []
9898

99+
# Ingress configuration
99100
ingress:
101+
# Enable ingress resource
100102
enabled: false
101-
className: ""
103+
104+
# Annotations for the Ingress
102105
annotations: {}
103-
# kubernetes.io/ingress.class: nginx
104-
# kubernetes.io/tls-acme: "true"
105-
hosts:
106-
- host: chart-example.local
107-
paths:
108-
- path: /
109-
port: 7114
110-
pathType: ImplementationSpecific
111-
tls: []
112-
# - secretName: chart-example-tls
113-
# hosts:
114-
# - chart-example.local
106+
107+
# ingressClassName for the Ingress
108+
ingressClassName: ""
109+
110+
# The hostname for the Ingress
111+
host: ""
112+
113+
## HTTP paths to add to the Ingress
114+
## e.g:
115+
## paths:
116+
## - path: /api
117+
## pathType: Prefix
118+
## port: 7114
119+
paths: []
120+
121+
# configs for Ingress TLS
122+
tls:
123+
# Enable TLS termination for the Ingress
124+
enabled: false
125+
# the name of a pre-created Secret containing a TLS private key and certificate
126+
secretName: ""
115127

116128
resources: {}
117129
# We usually recommend not to specify default resources and to leave this as a conscious

0 commit comments

Comments
 (0)