Skip to content

Commit

Permalink
Add separated ingresses (#74)
Browse files Browse the repository at this point in the history
Add possibility to move some endpoints to separated ingresses to use custom annotations
  • Loading branch information
sergei-ak authored Nov 2, 2021
1 parent 568b16b commit b8af146
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 1 deletion.
1 change: 1 addition & 0 deletions moon/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ name: moon
version: 1.1.14
appVersion: 1.9.2
description: Moon Helm chart
icon: https://aerokube.com/img/aerokube_logo.svg
33 changes: 32 additions & 1 deletion moon/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,43 @@ spec:
{{- $releaseName := .Release.Name }}
{{- range $v := .Values.moon.ingress.paths }}
- path: {{ $v.path | quote }}
pathType: Prefix
pathType: {{ $v.type | default "Prefix" }}
backend:
service:
name: {{ $releaseName }}
port:
number: {{ $v.port }}
{{- end }}
{{- end }}
{{- range .Values.moon.separateIngresses }}
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
{{- range $key, $value := .annotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
name: {{ $.Release.Name }}-{{ .name }}
namespace: {{ $.Release.Namespace }}
spec:
ingressClassName: {{ .ingressClassName }}
{{- if .tls }}
tls:
{{ toYaml .tls | nindent 4 }}
{{- end }}
rules:
- host: {{ .host }}
http:
paths:
{{- range $v := .paths }}
- path: {{ $v.path | quote }}
pathType: {{ $v.type | default "Prefix" }}
backend:
service:
name: {{ $.Release.Name }}
port:
number: {{ $v.port }}
{{- end }}
{{- end }}
{{- end }}
10 changes: 10 additions & 0 deletions moon/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,16 @@ moon:
- path: /mobile
port: 4444

separateIngresses: []
# - name: wd-hub-session
# annotations: {}
# ingressClassName: nginx
# host: moon.aerokube.local
# tls: []
# paths:
# - path: /wd/hub/session/
# port: 4444

##
## Moon configuration.
##
Expand Down

0 comments on commit b8af146

Please sign in to comment.