Skip to content

Commit c3a8f35

Browse files
ixxeL2097Frederic Spiers
andauthored
feat(helm): add more control on default nginx proxy option timeout (#54)
Co-authored-by: Frederic Spiers <[email protected]>
1 parent 0ee87a5 commit c3a8f35

File tree

3 files changed

+27
-13
lines changed

3 files changed

+27
-13
lines changed

helm/ggbridge/README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,13 @@ A Helm chart for installing ggbridge
7575
| podSecurityContext.enabled | bool | `true` | Enable Pod security Context in deployments |
7676
| proxy.affinity | object | `{}` | Affinity for pod assignment |
7777
| proxy.annotations | object | `{}` | Set proxy annotations |
78+
| proxy.config | object | `{"server":{"proxyConnectTimeout":"10s","proxyTimeout":"600s"},"upstream":{"failTimeout":"10s","maxFails":1}}` | Nginx configuration |
79+
| proxy.config.server | object | `{"proxyConnectTimeout":"10s","proxyTimeout":"600s"}` | Nginx server configuration |
80+
| proxy.config.server.proxyConnectTimeout | string | `"10s"` | Nginx proxy timeout for TCP handshake |
81+
| proxy.config.server.proxyTimeout | string | `"600s"` | Nginx proxy timeout for data exchange |
82+
| proxy.config.upstream | object | `{"failTimeout":"10s","maxFails":1}` | Nginx upstream configuration |
83+
| proxy.config.upstream.failTimeout | string | `"10s"` | Time during which the specified number of unsuccessful attempts must happen to mark the server as unavailable |
84+
| proxy.config.upstream.maxFails | int | `1` | Maximum number of unsuccessful attempts to communicate with the server |
7885
| proxy.labels | object | `{}` | Set proxy labels |
7986
| proxy.logLevel | string | `"notice"` | Set nginx sidecar container and proxy pod log level (default: notice) |
8087
| proxy.networkPolicy.allowExternal | bool | `true` | When true, server will accept connections from any source |
@@ -178,9 +185,6 @@ A Helm chart for installing ggbridge
178185
| proxy.updateStrategy.rollingUpdate.maxSurge | int | `1` | |
179186
| proxy.updateStrategy.rollingUpdate.maxUnavailable | int | `0` | |
180187
| proxy.updateStrategy.type | string | `"RollingUpdate"` | Customize updateStrategy |
181-
| proxy.upstream | object | `{"failTimeout":"5s","maxFails":1}` | Nginx upstream configuration |
182-
| proxy.upstream.failTimeout | string | `"5s"` | Time during which the specified number of unsuccessful attempts must happen to mark the server as unavailable |
183-
| proxy.upstream.maxFails | int | `1` | Maximum number of unsuccessful attempts to communicate with the server |
184188
| proxyProtocol.enabled | bool | `true` | When true, enables proxy protocol v2 for web/tls tunnels |
185189
| replicaCount | int | `1` | Number of pods for each deployment |
186190
| resources.limits | object | `{}` | Set container limits |

helm/ggbridge/files/proxy/nginx.conf

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@
66
{{- $fullname := ternary (include "ggbridge.server.fullname" $context) (include "ggbridge.client.fullname" $context) (eq $context.Values.mode "server") -}}
77
{{- $ports := $context.Values.proxy.service.ports -}}
88
{{- $logLevel := $context.Values.proxy.logLevel -}}
9-
{{- $maxFails := $context.Values.proxy.upstream.maxFails | default 1 -}}
10-
{{- $failTimeout := $context.Values.proxy.upstream.failTimeout | default "5s" -}}
9+
{{- $maxFails := $context.Values.proxy.config.upstream.maxFails | default 1 -}}
10+
{{- $failTimeout := $context.Values.proxy.config.upstream.failTimeout | default "10s" -}}
11+
{{- $proxyTimeout := $context.Values.proxy.config.server.proxyTimeout | default "600s" -}}
12+
{{- $proxyConnectTimeout := $context.Values.proxy.config.server.proxyConnectTimeout | default "10s" -}}
1113

1214
load_module "/usr/lib/nginx/modules/ngx_stream_module.so";
1315

@@ -45,8 +47,8 @@ stream {
4547
server {
4648
listen {{ $config.containerPort }};
4749
proxy_pass {{ $tunnel }};
48-
proxy_timeout 600s;
49-
proxy_connect_timeout 5s;
50+
proxy_timeout {{ $proxyTimeout }};
51+
proxy_connect_timeout {{ $proxyConnectTimeout }};
5052
}
5153
{{ end }}
5254
}

helm/ggbridge/values.yaml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -395,12 +395,20 @@ proxy:
395395
# -- Set proxy labels
396396
labels: {}
397397

398-
# -- Nginx upstream configuration
399-
upstream:
400-
# -- Maximum number of unsuccessful attempts to communicate with the server
401-
maxFails: 1
402-
# -- Time during which the specified number of unsuccessful attempts must happen to mark the server as unavailable
403-
failTimeout: 5s
398+
# -- Nginx configuration
399+
config:
400+
# -- Nginx server configuration
401+
server:
402+
# -- Nginx proxy timeout for data exchange
403+
proxyTimeout: 600s
404+
# -- Nginx proxy timeout for TCP handshake
405+
proxyConnectTimeout: 10s
406+
# -- Nginx upstream configuration
407+
upstream:
408+
# -- Maximum number of unsuccessful attempts to communicate with the server
409+
maxFails: 1
410+
# -- Time during which the specified number of unsuccessful attempts must happen to mark the server as unavailable
411+
failTimeout: 10s
404412

405413
# -- Set the Proxy DNS resolver
406414
resolver: kube-dns.kube-system.svc.cluster.local

0 commit comments

Comments
 (0)