From 9e81a317e2cc420a943b2f428be02ded0a137d11 Mon Sep 17 00:00:00 2001 From: Bryan Strassner Date: Fri, 23 Feb 2018 11:10:04 -0600 Subject: [PATCH] Set the API port from chart env var For the deployment of armada, the entrypoint.sh needs to have the exposed uwsgi port matching the deployment of the api pod. This change sets the value in the pod.env.armada_api seciton so that the environment variable is set up by the chart rather than relying upon the default value set in the entrypoint.sh script. Change-Id: I7535abac7c252f5c65447476e02f8eb54647e966 --- charts/armada/values.yaml | 3 +++ entrypoint.sh | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/charts/armada/values.yaml b/charts/armada/values.yaml index 80f259c3..b529acad 100644 --- a/charts/armada/values.yaml +++ b/charts/armada/values.yaml @@ -152,6 +152,9 @@ conf: pod: env: armada_api: +# ARMADA_API_PORT should = conf.armada.armada_api.bind_port in standard cases + - name: ARMADA_API_PORT + value: 8000 # - name: http_proxy # value: http://proxy.example.com:8080 # - name: https_proxy diff --git a/entrypoint.sh b/entrypoint.sh index 0bb9f5d1..c483bfa5 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -19,7 +19,7 @@ set -ex CMD="armada" # Define port -PORT=${PORT:-9000} +PORT=${ARMADA_API_PORT:-9000} # How long uWSGI should wait for each Armada response ARMADA_API_TIMEOUT=${ARMADA_API_TIMEOUT:-"3600"} # Number of uWSGI workers to handle API requests @@ -32,7 +32,7 @@ ARMADA_API_THREADS=${ARMADA_API_THREADS:-"1"} # server during import in `armada.api.server`. if [ "$1" = 'server' ]; then exec uwsgi \ - --http :${PORT} \ + --http :${ARMADA_API_PORT} \ --http-timeout $ARMADA_API_TIMEOUT \ --enable-threads \ -L \