diff --git a/charts/zerotier-ingress-helm/Chart.yaml b/charts/zerotier-ingress-helm/Chart.yaml index 970ddb8..31086c9 100644 --- a/charts/zerotier-ingress-helm/Chart.yaml +++ b/charts/zerotier-ingress-helm/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.1.1 +version: 0.1.2 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/charts/zerotier-ingress-helm/README.md b/charts/zerotier-ingress-helm/README.md index 3aa2cb5..3a4237a 100644 --- a/charts/zerotier-ingress-helm/README.md +++ b/charts/zerotier-ingress-helm/README.md @@ -16,6 +16,7 @@ Create your values.yaml file. The following fields are required: | ---------- | ----------- | | nginx.listenPort | The port Nginx is configured to listen on (default 8000) | | nginx.proxyAddress | The URL of the upstream service. (ex: `http://my-service.my-namespace.svc.cluster.local:1234`) | +| nginx.proxyTimeout | The timeout (in seconds) for prosied requests (default 60) | | zerotier.identity.public | The public ZeroTier identity. Use `zerotier-idtool` to generate an identity on a per-ingress basis.| | zerotier.identity.secret | The secret ZeroTier identity. Use `zerotier-idtool` to generate an identity on a per-ingress basis.| | zerotier.networkID | The network ID the ZeroTier instance will connect to. | diff --git a/charts/zerotier-ingress-helm/docker/default.conf.template b/charts/zerotier-ingress-helm/docker/default.conf.template index cd140ee..58248e7 100644 --- a/charts/zerotier-ingress-helm/docker/default.conf.template +++ b/charts/zerotier-ingress-helm/docker/default.conf.template @@ -7,5 +7,7 @@ server { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; + proxy_read_timeout $NGINX_PROXY_READ_TIMEOUT; + send_timeout $NGINX_PROXY_READ_TIMEOUT; } } \ No newline at end of file diff --git a/charts/zerotier-ingress-helm/docker/entrypoint-ztnginx.sh b/charts/zerotier-ingress-helm/docker/entrypoint-ztnginx.sh index 3ca0156..98f593d 100755 --- a/charts/zerotier-ingress-helm/docker/entrypoint-ztnginx.sh +++ b/charts/zerotier-ingress-helm/docker/entrypoint-ztnginx.sh @@ -1,13 +1,15 @@ #!/usr/bin/env bash NGINX_LISTEN_PORT="${NGINX_LISTEN_PORT:-8000}" +NGINX_PROXY_READ_TIMEOUT=${NGINX_PROXY_READ_TIMEOUT:-60} + if [ -z "$NGINX_PROXY_ADDRESS" ]; then echo "Error: NGINX_PROXY_ADDRESS environment variable is not set" exit 1 fi -envsubst '$NGINX_LISTEN_PORT,$NGINX_PROXY_ADDRESS' < /default.conf.template > /etc/nginx/conf.d/default.conf +envsubst '$NGINX_LISTEN_PORT,$NGINX_PROXY_ADDRESS,$NGINX_PROXY_READ_TIMEOUT' < /default.conf.template > /etc/nginx/conf.d/default.conf cat /etc/nginx/conf.d/default.conf diff --git a/charts/zerotier-ingress-helm/templates/deployment.yaml b/charts/zerotier-ingress-helm/templates/deployment.yaml index 7981f24..81b9767 100644 --- a/charts/zerotier-ingress-helm/templates/deployment.yaml +++ b/charts/zerotier-ingress-helm/templates/deployment.yaml @@ -58,6 +58,8 @@ spec: value: "{{ .Values.nginx.listenPort | default 8000 }}" - name: NGINX_PROXY_ADDRESS value: {{ .Values.nginx.proxyAddress }} + - name: NGINX_PROXY_READ_TIMEOUT + value: "{{ .Values.nginx.proxyTimeout | default 60 }}" ports: - name: http containerPort: {{ .Values.nginx.listenPort }} diff --git a/charts/zerotier-ingress-helm/values.yaml b/charts/zerotier-ingress-helm/values.yaml index 19d1657..6972477 100644 --- a/charts/zerotier-ingress-helm/values.yaml +++ b/charts/zerotier-ingress-helm/values.yaml @@ -13,6 +13,7 @@ nginx: # Set the proxy address # this should be the full host/port combination: http://someservice.mynamespace.svc.cluster.local:1234 proxyAddress: "" + proxyTimeout: 60 resources: {}