Skip to content

Commit 540cade

Browse files
authored
DEVOPS-3101-fixed-readOnlyRootFilesystem-issue-for-artifacts-and-keycloak (#143)
1 parent 123b586 commit 540cade

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

chart/templates/artifacts/deployment.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,12 @@ spec:
8686
mountPath: /cert/
8787
readOnly: true
8888
{{- end }}
89+
{{- if .Values.general.readOnlyRootFilesystem }}
90+
- name: tmpfs
91+
mountPath: /var/lib/nginx/tmp
92+
- name: tmpfs
93+
mountPath: /tmp
94+
{{- end }}
8995
{{- if .Values.general.tolerations }}
9096
tolerations:
9197
{{ toYaml .Values.general.tolerations | nindent 8 }}
@@ -111,3 +117,8 @@ spec:
111117
secretName: {{ .Values.general.internal_tls.certificates.existing_certificates.artifacts }}
112118
{{- end }}
113119
{{- end }}
120+
{{- if .Values.general.readOnlyRootFilesystem }}
121+
- name: tmpfs
122+
emptyDir:
123+
sizeLimit: {{ .Values.general.readOnlyRootFilesystem_tmpfs_sizeLimit }}
124+
{{- end -}}

chart/templates/helpers/_keycloak_initContainer.tpl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
{{ define "lightrun-keycloak.initContainer.read-only-rootfs" }}
22
- args:
3-
- cp -R /opt/* /keycloak-empty-dir/
3+
- >
4+
cp -R /opt/* /keycloak-empty-dir/ &&
5+
cd /opt &&
6+
find . -type f -exec touch -r {} /keycloak-empty-dir/{} \; 2>/dev/null
47
command:
58
- /bin/sh
69
- -c

0 commit comments

Comments
 (0)