images: Create single metrics dir in entrypoint

The entrypoint script for the Armada Docker container attempts to create
a nested, temporary directory when one is not provided through an
environment variable. This is fine when deploying Armada via a Helm
chart, as a writable volume mount exists; however, the directory
/tmp/armada/metrics does not exist when running as a standalone
container. This commit changes the entrypoint script to use a flat,
temporary directory to avoid requiring a user to mount a temporary
volume.

Change-Id: I26857908fa90c64c98038d508263a5094b06668a
Signed-off-by: Drew Walters <andrew.walters@att.com>
This commit is contained in:
Drew Walters 2019-10-09 19:02:54 +00:00
parent 5fae57d179
commit 7ef4905c44
2 changed files with 1 additions and 6 deletions

View File

@ -138,8 +138,6 @@ spec:
volumeMounts:
- name: pod-tmp
mountPath: /tmp
- name: pod-tmp-metrics
mountPath: /tmp/armada/metrics
- name: pod-etc-armada
mountPath: /etc/armada
- name: armada-etc
@ -195,9 +193,6 @@ spec:
volumes:
- name: pod-tmp
emptyDir: {}
- name: pod-tmp-metrics
emptyDir:
medium: Memory
- name: pod-etc-armada
emptyDir: {}
- name: armada-bin

View File

@ -27,7 +27,7 @@ ARMADA_UWSGI_WORKERS=${ARMADA_UWSGI_WORKERS:-4}
# Threads per worker
ARMADA_UWSGI_THREADS=${ARMADA_UWSGI_THREADS:-1}
# Prometheus multiprocess dir
ARMADA_PROMETHEUS_MULTIPROC_DIR=${ARMADA_PROMETHEUS_MULTIPROC_DIR:-$(mktemp -d -p /tmp/armada/metrics XXXXXX)}
ARMADA_PROMETHEUS_MULTIPROC_DIR=${ARMADA_PROMETHEUS_MULTIPROC_DIR:-$(mktemp -d -p /tmp armada-metrics-XXXXXX)}
# Start Armada application
# TODO(fmontei): Should be specifying callable too. But Armada spins up the