From 7ef4905c445bff58bd315ed7820bbbb68b863d8f Mon Sep 17 00:00:00 2001 From: Drew Walters Date: Wed, 9 Oct 2019 19:02:54 +0000 Subject: [PATCH] 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 --- charts/armada/templates/deployment-api.yaml | 5 ----- entrypoint.sh | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/charts/armada/templates/deployment-api.yaml b/charts/armada/templates/deployment-api.yaml index 60b84615..3b17d29c 100644 --- a/charts/armada/templates/deployment-api.yaml +++ b/charts/armada/templates/deployment-api.yaml @@ -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 diff --git a/entrypoint.sh b/entrypoint.sh index 6a84f3f2..5c1fe87e 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -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