Skip to content
This repository has been archived by the owner on Jul 30, 2024. It is now read-only.

Commit

Permalink
add multiple ingresses (#57)
Browse files Browse the repository at this point in the history
* add multiple ingresses

* add service name

* readd old ingress

* fix indent
  • Loading branch information
dbeneker authored Jul 31, 2020
1 parent 12341b1 commit 371c013
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 0 deletions.
43 changes: 43 additions & 0 deletions deploy/helm-chart/servicegateway/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,46 @@ spec:
{{- end }}
{{- end }}
{{- end }}
---
{{- $fullName := include "servicegateway.fullname" . -}}
{{- range $ingressName, $ingress := .Values.ingresses }}
{{- if $ingress }}
apiVersion: {{ template "servicegateway.ingress.apiVersion" $ }}
kind: Ingress
metadata:
name: {{ $fullName }}-{{ $ingressName }}
labels:
{{- include "servicegateway.labels" $ | nindent 4 }}
{{- if $.Values.additionalLabels }}
{{ toYaml $.Values.additionalLabels | nindent 4 }}
{{- end }}
{{- with $ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
tls:
{{- range $ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
{{- if .secretName }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
{{- range $ingress.hosts }}
- host: {{ .host | quote }}
http:
paths:
{{- range .paths }}
- path: {{ . }}
backend:
serviceName: {{ $fullName }}
servicePort: {{ $.Values.service.port}}
{{- end }}
{{- end }}
---
{{- end }}
{{- end }}
15 changes: 15 additions & 0 deletions deploy/helm-chart/servicegateway/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,21 @@ ingress:
# hosts:
# - chart-example.local

ingresses: {}
#ingresses:
# youringressname:
# annotations:
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
# nginx.ingress.kubernetes.io/force-ssl-redirect: "true"
# hosts:
# - host: chart-example.local
# paths: ["/"]
# tls:
# - secretName: chart-example-tls
# hosts:
# - chart-example.local

probes:
livenessProbe:
httpGet:
Expand Down

0 comments on commit 371c013

Please sign in to comment.