Skip to content

Commit 91340bd

Browse files
authored
Merge pull request #187 from xenit-eu/NYS2AWS-192-allow-multiple-ingress-hostnames
NYS2AWS-192: Allow multiple ingress hostnames
2 parents 289d5f8 + db2642c commit 91340bd

File tree

4 files changed

+48
-17
lines changed

4 files changed

+48
-17
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
chronology things are added/fixed/changed and - where possible - links to the PRs involved.
77

88
### Changes
9+
[v0.8.16]
10+
* Introduced the `ingress.hosts` property that can be used to specify multiple hostnames for the ingress configuration.
11+
`ingress.host` can still be used for a single hostname.
12+
913
[v0.8.13]
1014
* Added support for custom NGINX container image.
1115

README.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,9 +250,19 @@ nginx rules to redirect the normal pages to a 503 maintenance page.
250250
251251
#### `ingress.host`
252252
253-
* Required: true
253+
* Required: if `ingress.hosts` is an empty list
254254
* Default: None
255-
* Description: The host that points to the alfresco cluster for all services besides the syncService service
255+
* Description: The host that points to the alfresco cluster for all services besides the syncService service.
256+
Although this is not recommended, this property can be combined with the `ingress.hosts` property.
257+
In that case, the hostnames will be combined.
258+
259+
#### `ingress.hosts`
260+
261+
* Required: if `ingress.host` is None
262+
* Default: empty list
263+
* Description: The hosts that point to the alfresco cluster for all services besides the syncService service.
264+
This property can be combined with the `ingress.host` property. In that case, the hostnames will be combined.
265+
256266
257267
#### `ingress.syncServiceHost`
258268

xenit-alfresco/templates/ingress/alfresco-ingress.yaml

Lines changed: 31 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,16 @@
11
# Defines the deployment for the alfresco content repository app
2+
3+
# Collect all host names.
4+
{{- $allAlfrescoHostNames := .Values.ingress.hosts }}
5+
## Add support for the legacy ingress.host property.
6+
{{- if .Values.ingress.host }}
7+
{{- $allAlfrescoHostNames = append $allAlfrescoHostNames .Values.ingress.host }}
8+
{{- end }}
9+
## At least one Alfresco hostname should be specified.
10+
{{- if eq (len $allAlfrescoHostNames) 0}}
11+
{{- fail "No host specified for the Alfresco Ingress controller. Please specify the 'values.ingress.hosts' property (list of hostnames)." }}
12+
{{- end }}
13+
214
apiVersion: networking.k8s.io/v1
315
kind: Ingress
416
metadata:
@@ -29,7 +41,9 @@ spec:
2941
tls:
3042
- hosts:
3143
# Provide the desired host
32-
- {{ required "A host where your alfresco services can be reached on must be specified in values.ingress.host" .Values.ingress.host }}
44+
{{- range $allAlfrescoHostNames}}
45+
- {{ . | quote }}
46+
{{- end }}
3347
{{- if .Values.syncService.enabled }}
3448
- {{ required "If sync Services are enabled a specific host for sync services must be specified in values.ingress.syncServiceHost" .Values.ingress.syncServiceHost }}
3549
{{- end }}
@@ -44,27 +58,28 @@ spec:
4458
number: {{ .Values.ingress.defaultBackend.port }}
4559
{{- end }}
4660
rules:
47-
- host: {{ required "A host where your alfresco services can be reached on must be specified in values.ingress.host" .Values.ingress.host }}
61+
{{- range $allAlfrescoHostNames }}
62+
- host: {{ . | quote }}
4863
http:
4964
paths:
50-
{{- if .Values.general.hibernate }}
65+
{{- if $.Values.general.hibernate }}
5166
- path: /
5267
pathType: Prefix
5368
backend:
5469
service:
5570
name: nginx-default-service
5671
port:
5772
number: 30403
58-
{{- else if .Values.ingress.defaultPath }}
73+
{{- else if $.Values.ingress.defaultPath }}
5974
- path: /
6075
pathType: Prefix
6176
backend:
6277
service:
63-
name: {{ .Values.ingress.defaultPath.service }}
78+
name: {{ $.Values.ingress.defaultPath.service }}
6479
port:
65-
number: {{ .Values.ingress.defaultPath.port }}
80+
number: {{ $.Values.ingress.defaultPath.port }}
6681
{{- end }}
67-
{{- if and .Values.acs.ingress.enabled (not .Values.general.hibernate) }}
82+
{{- if and $.Values.acs.ingress.enabled (not $.Values.general.hibernate) }}
6883
- path: /alfresco
6984
pathType: Prefix
7085
backend:
@@ -73,7 +88,7 @@ spec:
7388
port:
7489
number: 30000
7590
{{- end }}
76-
{{- if and .Values.share.enabled .Values.share.ingress.enabled (not .Values.general.hibernate) }}
91+
{{- if and $.Values.share.enabled $.Values.share.ingress.enabled (not $.Values.general.hibernate) }}
7792
- path: /share
7893
pathType: Prefix
7994
backend:
@@ -82,16 +97,16 @@ spec:
8297
port:
8398
number: 30100
8499
{{- end }}
85-
{{- if and .Values.digitalWorkspace.enabled .Values.digitalWorkspace.ingress.enabled (not .Values.general.hibernate) }}
86-
- path: {{ .Values.digitalWorkspace.basePath }}
100+
{{- if and $.Values.digitalWorkspace.enabled $.Values.digitalWorkspace.ingress.enabled (not $.Values.general.hibernate) }}
101+
- path: {{ $.Values.digitalWorkspace.basePath }}
87102
pathType: Prefix
88103
backend:
89104
service:
90105
name: digital-workspace-service
91106
port:
92107
number: 30200
93108
{{- end }}
94-
{{- if and .Values.ooi.enabled .Values.ooi.ingress.enabled (not .Values.general.hibernate) }}
109+
{{- if and $.Values.ooi.enabled $.Values.ooi.ingress.enabled (not $.Values.general.hibernate) }}
95110
- path: /ooi-service
96111
pathType: Prefix
97112
backend:
@@ -100,8 +115,8 @@ spec:
100115
port:
101116
number: 30500
102117
{{- end }}
103-
{{- if .Values.ingress.blockedPaths.enabled }}
104-
{{- range .Values.ingress.blockedPaths.paths }}
118+
{{- if $.Values.ingress.blockedPaths.enabled }}
119+
{{- range $.Values.ingress.blockedPaths.paths }}
105120
- path: {{ . }}
106121
pathType: Prefix
107122
backend:
@@ -111,9 +126,10 @@ spec:
111126
number: 30403
112127
{{- end }}
113128
{{- end }}
114-
{{- if and .Values.ingress.additionalPaths (not .Values.general.hibernate) }}
115-
{{ toYaml .Values.ingress.additionalPaths | nindent 6 }}
129+
{{- if and $.Values.ingress.additionalPaths (not $.Values.general.hibernate) }}
130+
{{ toYaml $.Values.ingress.additionalPaths | nindent 6 }}
116131
{{- end }}
132+
{{- end }}
117133
{{- if and .Values.syncService.enabled (not .Values.general.hibernate) }}
118134
- host: {{ required "If sync Services are enabled a specific host for sync services must be specified in values.ingress.syncServiceHost" .Values.ingress.syncServiceHost }}
119135
http:

xenit-alfresco/values.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ general:
2121
selfManaged: false
2222

2323
ingress:
24+
hosts: [] # Note: you can still use the legacy 'host' property instead; cf. alfresco-ingress.yaml.
2425
clusterIssuer: "letsencrypt-production"
2526
ingressClass: "nginx"
2627
protocol: 'https'

0 commit comments

Comments
 (0)