Skip to content

Commit 02bcc96

Browse files
authored
Merge pull request opencloud-eu#80 from kastl-ars/20250603_tls.enabled_gatewaAPI_resources
use global.tls.enabled for gatewayAPI resources
2 parents acbeb6c + 94ae0ff commit 02bcc96

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed

charts/opencloud/templates/gateway/gateway.yaml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,31 +17,51 @@ spec:
1717
{{- toYaml . | nindent 4 }}
1818
{{- end }}
1919
listeners:
20+
{{- if .Values.global.tls.enabled }}
2021
- name: opencloud-https
22+
{{- else }}
23+
- name: opencloud-http
24+
{{- end }}
25+
{{- if .Values.global.tls.enabled }}
2126
protocol: HTTPS
27+
{{- else }}
28+
protocol: HTTP
29+
{{- end }}
2230
port: {{ .Values.httpRoute.gateway.port }}
2331
hostname: {{ .Values.global.domain.opencloud | quote }}
32+
{{- if .Values.global.tls.enabled }}
2433
tls:
2534
mode: Terminate
2635
certificateRefs:
2736
- name: {{ .Values.global.tls.secretName }}
2837
namespace: {{ .Values.httpRoute.gateway.namespace | default .Release.Namespace }}
38+
{{- end }}
2939
allowedRoutes:
3040
namespaces:
3141
from: Selector
3242
selector:
3343
matchLabels:
3444
kubernetes.io/metadata.name: {{ .Values.httpRoute.gateway.namespace | default .Release.Namespace }}
3545
{{- if .Values.keycloak.enabled }}
46+
{{- if .Values.global.tls.enabled }}
3647
- name: keycloak-https
48+
{{- else }}
49+
- name: keycloak-http
50+
{{- end }}
51+
{{- if .Values.global.tls.enabled }}
3752
protocol: HTTPS
53+
{{- else }}
54+
protocol: HTTP
55+
{{- end }}
3856
port: {{ .Values.httpRoute.gateway.port }}
3957
hostname: {{ .Values.global.domain.keycloak | quote }}
58+
{{- if .Values.global.tls.enabled }}
4059
tls:
4160
mode: Terminate
4261
certificateRefs:
4362
- name: {{ .Values.global.tls.secretName }}
4463
namespace: {{ .Values.httpRoute.gateway.namespace | default .Release.Namespace }}
64+
{{- end }}
4565
allowedRoutes:
4666
namespaces:
4767
from: Selector
@@ -50,15 +70,25 @@ spec:
5070
kubernetes.io/metadata.name: {{ .Values.httpRoute.gateway.namespace | default .Release.Namespace }}
5171
{{- end }}
5272
{{- if and .Values.opencloud.storage.s3.internal.enabled .Values.opencloud.storage.s3.internal.httpRoute.enabled }}
73+
{{- if .Values.global.tls.enabled }}
5374
- name: minio-https
75+
{{- else }}
76+
- name: minio-http
77+
{{- end }}
78+
{{- if .Values.global.tls.enabled }}
5479
protocol: HTTPS
80+
{{- else }}
81+
protocol: HTTP
82+
{{- end }}
5583
port: {{ .Values.httpRoute.gateway.port }}
5684
hostname: {{ .Values.global.domain.minio | quote }}
85+
{{- if .Values.global.tls.enabled }}
5786
tls:
5887
mode: Terminate
5988
certificateRefs:
6089
- name: {{ .Values.global.tls.secretName }}
6190
namespace: {{ .Values.httpRoute.gateway.namespace | default .Release.Namespace }}
91+
{{- end }}
6292
allowedRoutes:
6393
namespaces:
6494
from: Selector
@@ -67,15 +97,25 @@ spec:
6797
kubernetes.io/metadata.name: {{ .Values.httpRoute.gateway.namespace | default .Release.Namespace }}
6898
{{- end }}
6999
{{- if .Values.collabora.enabled }}
100+
{{- if .Values.global.tls.enabled }}
70101
- name: collabora-https
102+
{{- else }}
103+
- name: collabora-http
104+
{{- end }}
105+
{{- if .Values.global.tls.enabled }}
71106
protocol: HTTPS
107+
{{- else }}
108+
protocol: HTTP
109+
{{- end }}
72110
port: {{ .Values.httpRoute.gateway.port }}
73111
hostname: {{ .Values.global.domain.collabora | quote }}
112+
{{- if .Values.global.tls.enabled }}
74113
tls:
75114
mode: Terminate
76115
certificateRefs:
77116
- name: {{ .Values.global.tls.secretName }}
78117
namespace: {{ .Values.httpRoute.gateway.namespace | default .Release.Namespace }}
118+
{{- end }}
79119
allowedRoutes:
80120
namespaces:
81121
from: Selector
@@ -84,15 +124,25 @@ spec:
84124
kubernetes.io/metadata.name: {{ .Values.httpRoute.gateway.namespace | default .Release.Namespace }}
85125
{{- end }}
86126
{{- if .Values.onlyoffice.enabled }}
127+
{{- if .Values.global.tls.enabled }}
87128
- name: onlyoffice-https
129+
{{- else }}
130+
- name: onlyoffice-http
131+
{{- end }}
132+
{{- if .Values.global.tls.enabled }}
88133
protocol: HTTPS
134+
{{- else }}
135+
protocol: HTTP
136+
{{- end }}
89137
port: {{ .Values.httpRoute.gateway.port }}
90138
hostname: {{ .Values.global.domain.onlyoffice | quote }}
139+
{{- if .Values.global.tls.enabled }}
91140
tls:
92141
mode: Terminate
93142
certificateRefs:
94143
- name: {{ .Values.global.tls.secretName }}
95144
namespace: {{ .Values.httpRoute.gateway.namespace | default .Release.Namespace }}
145+
{{- end }}
96146
allowedRoutes:
97147
namespaces:
98148
from: Selector
@@ -101,15 +151,25 @@ spec:
101151
kubernetes.io/metadata.name: {{ .Values.httpRoute.gateway.namespace | default .Release.Namespace }}
102152
{{- end }}
103153
{{- if and .Values.onlyoffice.collaboration.enabled .Values.onlyoffice.enabled }}
154+
{{- if .Values.global.tls.enabled }}
104155
- name: collaboration-https
156+
{{- else }}
157+
- name: collaboration-http
158+
{{- end }}
159+
{{- if .Values.global.tls.enabled }}
105160
protocol: HTTPS
161+
{{- else }}
162+
protocol: HTTP
163+
{{- end }}
106164
port: {{ .Values.httpRoute.gateway.port }}
107165
hostname: {{ .Values.global.domain.wopi | quote }}
166+
{{- if .Values.global.tls.enabled }}
108167
tls:
109168
mode: Terminate
110169
certificateRefs:
111170
- name: {{ .Values.global.tls.secretName }}
112171
namespace: {{ .Values.httpRoute.gateway.namespace | default .Release.Namespace }}
172+
{{- end }}
113173
allowedRoutes:
114174
namespaces:
115175
from: Selector

0 commit comments

Comments
 (0)