From fbc5b2aad3d1d1e524c1a8d3ad5bef7a07e31032 Mon Sep 17 00:00:00 2001 From: Fiete Ostkamp Date: Tue, 14 May 2024 15:03:54 +0200 Subject: [PORTALNG] Support readonly file system in portal-ng-ui - mount files via configmaps to support readonly filesystems Issue-ID: PORTALNG-101 Change-Id: Ia399d0230db4cc25f2d8e438a0e64a34f06b921f Signed-off-by: Fiete Ostkamp --- .../portal-ng-ui/templates/configmap-env-js.yaml | 26 ++++++++++++++++++++ .../templates/configmap-nginx-config.yaml | 26 ++++++++++++++++++++ .../templates/configmap-version-json.yaml | 26 ++++++++++++++++++++ .../portal-ng-ui/templates/deployment.yaml | 28 ++++++++++++++++++++++ 4 files changed, 106 insertions(+) create mode 100644 kubernetes/portal-ng/components/portal-ng-ui/templates/configmap-env-js.yaml create mode 100644 kubernetes/portal-ng/components/portal-ng-ui/templates/configmap-nginx-config.yaml create mode 100644 kubernetes/portal-ng/components/portal-ng-ui/templates/configmap-version-json.yaml (limited to 'kubernetes/portal-ng/components/portal-ng-ui/templates') diff --git a/kubernetes/portal-ng/components/portal-ng-ui/templates/configmap-env-js.yaml b/kubernetes/portal-ng/components/portal-ng-ui/templates/configmap-env-js.yaml new file mode 100644 index 0000000000..e2244bd768 --- /dev/null +++ b/kubernetes/portal-ng/components/portal-ng-ui/templates/configmap-env-js.yaml @@ -0,0 +1,26 @@ +{{/* +# Copyright © 2024 Deutsche Telekom +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +*/}} +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "common.fullname" . }}-env-js + labels: + app: {{ include "common.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ include "common.release" . }} + heritage: {{ .Release.Service }} +data: +{{ tpl (.Files.Glob "resources/assets/env.js").AsConfig . | nindent 2 }} diff --git a/kubernetes/portal-ng/components/portal-ng-ui/templates/configmap-nginx-config.yaml b/kubernetes/portal-ng/components/portal-ng-ui/templates/configmap-nginx-config.yaml new file mode 100644 index 0000000000..f8e560b908 --- /dev/null +++ b/kubernetes/portal-ng/components/portal-ng-ui/templates/configmap-nginx-config.yaml @@ -0,0 +1,26 @@ +{{/* +# Copyright © 2024 Deutsche Telekom +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +*/}} +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "common.fullname" . }}-nginx-config + labels: + app: {{ include "common.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ include "common.release" . }} + heritage: {{ .Release.Service }} +data: +{{ tpl (.Files.Glob "resources/default.conf").AsConfig . | nindent 2 }} diff --git a/kubernetes/portal-ng/components/portal-ng-ui/templates/configmap-version-json.yaml b/kubernetes/portal-ng/components/portal-ng-ui/templates/configmap-version-json.yaml new file mode 100644 index 0000000000..79182a4e51 --- /dev/null +++ b/kubernetes/portal-ng/components/portal-ng-ui/templates/configmap-version-json.yaml @@ -0,0 +1,26 @@ +{{/* +# Copyright © 2024 Deutsche Telekom +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +*/}} +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "common.fullname" . }}-version-json + labels: + app: {{ include "common.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ include "common.release" . }} + heritage: {{ .Release.Service }} +data: +{{ tpl (.Files.Glob "resources/assets/version.json").AsConfig . | nindent 2 }} diff --git a/kubernetes/portal-ng/components/portal-ng-ui/templates/deployment.yaml b/kubernetes/portal-ng/components/portal-ng-ui/templates/deployment.yaml index 6a16384346..4d467e0c88 100644 --- a/kubernetes/portal-ng/components/portal-ng-ui/templates/deployment.yaml +++ b/kubernetes/portal-ng/components/portal-ng-ui/templates/deployment.yaml @@ -53,6 +53,22 @@ spec: mountPath: {{ .Values.nginx.tilesPath }} subPath: tiles.json readOnly: true + - name: nginx-config + mountPath: /etc/nginx/conf.d/default.conf + subPath: default.conf + readOnly: true + - name: env-js + mountPath: /usr/share/nginx/html/assets/env.js + subPath: env.js + readOnly: true + - name: version-json + mountPath: /usr/share/nginx/html/assets/version.json + subPath: version.json + readOnly: true + - name: tmp-volume + mountPath: /tmp + - name: nginx-cache-volume + mountPath: /var/cache/nginx resources: {{ include "common.resources" . | nindent 12 }} {{- with .Values.nodeSelector }} nodeSelector: @@ -76,3 +92,15 @@ spec: items: - key: tiles.json path: tiles.json + - name: nginx-config + configMap: + name: {{ include "common.fullname" . }}-nginx-config + - name: env-js + configMap: + name: {{ include "common.fullname" . }}-env-js + - name: tmp-volume + emptyDir: + sizeLimit: 64Mi + - name: nginx-cache-volume + emptyDir: + sizeLimit: 64Mi -- cgit 1.2.3-korg