Skip to content
Merged
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
update ingress values and implementation
  • Loading branch information
vordimous committed Jul 14, 2024
commit af34d48f5a4de69532e0a74e5d9242806b207987
10 changes: 6 additions & 4 deletions cloud/helm-chart/src/main/helm/zilla/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
{{- if not .Values.ingress.enabled }}
Connect to Zilla by running these commands:
{{- end }}
{{- if .Values.ingress.enabled }}
{{- range $host := .Values.ingress.hosts }}
{{- range .paths }}
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }}
Zilla is available through an ingress controller at the base url(s):
{{- $host := or .Values.ingress.host "localhost" -}}
{{- range $path := .Values.ingress.paths }}
http{{ if $.Values.ingress.tls.enabled }}s{{ end }}://{{ $host }}{{ $path.path }}
{{- end }}
{{- end }}
{{- else if contains "NodePort" .Values.service.type }}
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "zilla.fullname" . }})
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
Expand Down
38 changes: 18 additions & 20 deletions cloud/helm-chart/src/main/helm/zilla/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,39 +22,37 @@ metadata:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }}
ingressClassName: {{ .Values.ingress.className }}
{{- end }}
{{- if .Values.ingress.tls }}
{{- if .Values.ingress.tls.enabled }}
tls:
{{- range .Values.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
- {{ tpl .Values.ingress.host . }}
secretName: {{ .Values.ingress.tls.secretName }}
{{- end }}
{{- if .Values.ingress.ingressClassName }}
ingressClassName: {{ .Values.ingress.ingressClassName }}
{{- end }}
rules:
{{- range .Values.ingress.hosts }}
- host: {{ .host | quote }}
http:
- http:
paths:
{{- range .paths }}
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}}
{{- range .Values.ingress.paths }}
- path: {{ .path }}
{{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }}
pathType: {{ .pathType }}
{{- end }}
backend:
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
service:
name: {{ $fullName }}
port:
number: {{ .port }}
{{- else }}
{{- end }}
{{- else -}}
{{- range .Values.ingress.paths }}
- path: {{ .path }}
backend:
serviceName: {{ $fullName }}
servicePort: {{ .port }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- if tpl .Values.ingress.host . }}
host: {{ tpl .Values.ingress.host . }}
{{- end }}
{{- end }}
38 changes: 25 additions & 13 deletions cloud/helm-chart/src/main/helm/zilla/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,22 +96,34 @@ service:
type: ClusterIP
ports: []

# Ingress configuration
ingress:
# Enable ingress resource
enabled: false
className: ""

# Annotations for the Ingress
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
hosts:
- host: chart-example.local
paths:
- path: /
port: 7114
pathType: ImplementationSpecific
tls: []
# - secretName: chart-example-tls
# hosts:
# - chart-example.local

# ingressClassName for the Ingress
ingressClassName: ""

# The hostname for the Ingress
host: ""

## HTTP paths to add to the Ingress
## e.g:
## paths:
## - path: /api
## pathType: Prefix
## port: 7114
paths: []

# configs for Ingress TLS
tls:
# Enable TLS termination for the Ingress
enabled: false
# the name of a pre-created Secret containing a TLS private key and certificate
secretName: ""

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