Skip to content

Commit

Permalink
allow chart to set paths for each ingress host if required (#41)
Browse files Browse the repository at this point in the history
* allow chart to set paths for each ingress host if required

* bump chart version
  • Loading branch information
MuriukiPM authored Nov 6, 2024
1 parent 344060d commit 0c6bbe3
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 1 deletion.
2 changes: 1 addition & 1 deletion standard-app/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: standard-app
description: A Helm chart library by Cloudkite
type: application
version: 0.4.8
version: 0.4.9
maintainters:
- email: [email protected]
name: cloudkite
14 changes: 14 additions & 0 deletions standard-app/example.values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,20 @@ ingress:
cert-manager.io/cluster-issuer: letsencrypt-prod
nginx.ingress.kubernetes.io/configuration-snippet: |
rewrite ^(/api)(.*) $2 break;
# hostPaths:
# - host: "my.domain.name.com"
# servicePort: 3000
# serviceName: cloudkite-app-1
# path: "/"
# - host: "my-other.domain.name.com"
# servicePort: 3000
# serviceName: cloudkite-app-1
# path: "/someprefix"
# tls:
# - secretName: my-domain-name-com-tls
# hosts:
# - "my.domain.name.com"
# - "my-other.domain.name.com"
hosts:
- test.dev.someorg.com
- other.domain.name.com
Expand Down
15 changes: 15 additions & 0 deletions standard-app/templates/network/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,20 @@ metadata:
spec:
ingressClassName: {{ .Values.ingress.className | default "nginx" }}
rules:
{{- if .Values.ingress.hostPaths }}
{{- range .Values.ingress.hostPaths }}
- host: {{ .host | quote }}
http:
paths:
- path: {{ .path }}
pathType: Prefix
backend:
service:
name: {{ .serviceName }}
port:
number: {{ .servicePort }}
{{- end }}
{{- else if .Values.ingress.hosts }}
{{- range .Values.ingress.hosts }}
- host: {{ . | quote }}
http:
Expand All @@ -30,6 +44,7 @@ spec:
number: {{ .servicePort }}
{{- end }}
{{- end }}
{{- end }}
tls:
{{- if .Values.ingress.tls }}
{{- toYaml .Values.ingress.tls | nindent 4 }}
Expand Down

0 comments on commit 0c6bbe3

Please sign in to comment.