From cf1e8225997510d7e71f9cd8e7996ea3e4e6adeb Mon Sep 17 00:00:00 2001 From: Anthony Lin Date: Wed, 7 Feb 2018 17:14:28 +0000 Subject: [PATCH] Make Ingress proxy-read-timeout Configurable There is a need to make the proxy-read-timeout configurable so that we can alter the value to handle request that takes more than a minute (default timeout) to process Also increase http-timeout for uwsgi to 600 seconds Change-Id: I25dabc648822252a7918d6272c78fb8ebc236b6c --- charts/shipyard/templates/ingress-airflow-api.yaml | 1 + charts/shipyard/templates/ingress-shipyard-api.yaml | 1 + charts/shipyard/values.yaml | 2 ++ entrypoint.sh | 4 +++- 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/charts/shipyard/templates/ingress-airflow-api.yaml b/charts/shipyard/templates/ingress-airflow-api.yaml index 73a2b6d6..38c71655 100644 --- a/charts/shipyard/templates/ingress-airflow-api.yaml +++ b/charts/shipyard/templates/ingress-airflow-api.yaml @@ -32,6 +32,7 @@ metadata: annotations: kubernetes.io/ingress.class: "nginx" ingress.kubernetes.io/rewrite-target: / + nginx.ingress.kubernetes.io/proxy-read-timeout: {{ .Values.network.airflow.ingress.proxy_read_timeout | quote }} spec: rules: {{- range $key1, $vHost := tuple $hostName $hostNameNamespaced $hostNameFull }} diff --git a/charts/shipyard/templates/ingress-shipyard-api.yaml b/charts/shipyard/templates/ingress-shipyard-api.yaml index d5517c80..215c543e 100644 --- a/charts/shipyard/templates/ingress-shipyard-api.yaml +++ b/charts/shipyard/templates/ingress-shipyard-api.yaml @@ -32,6 +32,7 @@ metadata: annotations: kubernetes.io/ingress.class: "nginx" ingress.kubernetes.io/rewrite-target: / + nginx.ingress.kubernetes.io/proxy-read-timeout: {{ .Values.network.shipyard.ingress.proxy_read_timeout | quote }} spec: rules: {{- range $key1, $vHost := tuple $hostName $hostNameNamespaced $hostNameFull }} diff --git a/charts/shipyard/values.yaml b/charts/shipyard/values.yaml index b325d24b..ebc0c984 100644 --- a/charts/shipyard/values.yaml +++ b/charts/shipyard/values.yaml @@ -41,12 +41,14 @@ network: shipyard: ingress: public: true + proxy_read_timeout: 600 port: 9000 node_port: 31901 enable_node_port: false airflow: ingress: public: true + proxy_read_timeout: 600 flower: name: airflow-flower port: 5555 diff --git a/entrypoint.sh b/entrypoint.sh index 19b2eea6..e73ee79a 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -18,6 +18,7 @@ set -ex CMD="shipyard" PORT=${PORT:-9000} +HTTP_TIMEOUT=${HTTP_TIMEOUT:-600} # Number of uWSGI workers to handle API request SHIPYARD_API_WORKERS=${SHIPYARD_API_WORKERS:-"4"} #Threads per worker @@ -32,7 +33,8 @@ if [ "$1" = 'server' ]; then -L \ --pyargv "--config-file /etc/shipyard/shipyard.conf" \ --threads $SHIPYARD_API_THREADS \ - --workers $SHIPYARD_API_WORKERS + --workers $SHIPYARD_API_WORKERS \ + --http-timeout ${HTTP_TIMEOUT} else # Execute shipyard command exec ${CMD} $@