Skip to content
Snippets Groups Projects
Commit bcc2f56e authored by Lennart Kramer's avatar Lennart Kramer
Browse files

don't try to delete tmpfs at startup

since DAC_OVERRIDE is no longer an effective capability, removing
all files from /tmp at startup will no longer work even as root,
since we do not have permissions to delete from other users. this
was always a workarond for kubernetes having problems on OOM related
to overfull emptyDirs.
conveniently, since kubernetes 1.22 setting sizeLimits on memory-
backed emptyDirs is now possible so we can just switch to that since
1.22 should be reasonably widely used by now.
parent 23c0e601
No related branches found
No related tags found
No related merge requests found
......@@ -58,6 +58,5 @@ EXPOSE 8080
HEALTHCHECK --interval=1m --timeout=3s CMD curl -f 'http://localhost:8080/goemaxima?health=1'
# clear tmp because when kubernetes restarts a pod, it keeps the /tmp content even if it's tmpfs,
# which means that on a restart caused by an overfull tmpfs, it will keep restarting in a loop
CMD cd /tmp && rm --one-file-system -rf * && exec tini ${BIN}/goweb ${BIN}/maxima-optimised || echo oh no no >&2
ENTRYPOINT ["tini", "--"]
CMD exec "${BIN}/goweb" "${BIN}/maxima-optimised"
......@@ -86,6 +86,7 @@ spec:
- name: tmptmpfs
emptyDir:
medium: "Memory"
sizeLimit: "{{ .Values.tmpfsSizeLimit }}"
{{ if .Values.enableGitRollout }}
- name: git
emptyDir:
......
......@@ -62,6 +62,9 @@ resources:
cpu: 1000m
memory: 256Mi
# maximum size of /tmp
tmpfsSizeLimit: 128Mi
nodeSelector: {}
tolerations: []
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment