Skip to content

Commit 145ff64

Browse files
Config/Annotations: Remove proxy-busy-buffers-size default value. (#13790)
Co-authored-by: Marco Ebert <marco_ebert@icloud.com>
1 parent 1b71402 commit 145ff64

File tree

5 files changed

+7
-12
lines changed

5 files changed

+7
-12
lines changed

docs/user-guide/nginx-configuration/annotations.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -729,7 +729,7 @@ To use custom values in an Ingress rule define these annotation:
729729
nginx.ingress.kubernetes.io/proxy-buffering: "on"
730730
```
731731

732-
### Proxy buffers Number
732+
### Proxy buffers number
733733

734734
Sets the number of the buffers in [`proxy_buffers`](https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_buffers) used for reading the first part of the response received from the proxied server.
735735
By default proxy buffers number is set as 4
@@ -752,11 +752,9 @@ nginx.ingress.kubernetes.io/proxy-buffer-size: "8k"
752752
### Proxy busy buffers size
753753

754754
[Limits the total size of buffers that can be busy](https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_busy_buffers_size) sending a response to the client while the response is not yet fully read.
755-
756-
By default proxy busy buffers size is set as "8k".
755+
By default, size is limited by the size of two buffers set by the `proxy_buffer_size` and `proxy_buffers` directives.
757756

758757
To configure this setting globally, set `proxy-busy-buffers-size` in the [ConfigMap](./configmap.md#proxy-busy-buffers-size). To use custom values in an Ingress rule, define this annotation:
759-
760758
```yaml
761759
nginx.ingress.kubernetes.io/proxy-busy-buffers-size: "16k"
762760
```

docs/user-guide/nginx-configuration/configmap.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ The following table shows a configuration option's name, type, and the default v
180180
| [proxy-send-timeout](#proxy-send-timeout) | int | 60 | |
181181
| [proxy-buffers-number](#proxy-buffers-number) | int | 4 | |
182182
| [proxy-buffer-size](#proxy-buffer-size) | string | "4k" | |
183-
| [proxy-busy-buffers-size](#proxy-busy-buffers-size) | string | "8k" | |
183+
| [proxy-busy-buffers-size](#proxy-busy-buffers-size) | string | "" | |
184184
| [proxy-cookie-path](#proxy-cookie-path) | string | "off" | |
185185
| [proxy-cookie-domain](#proxy-cookie-domain) | string | "off" | |
186186
| [proxy-next-upstream](#proxy-next-upstream) | string | "error timeout" | |

internal/ingress/annotations/proxy/main.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ var proxyAnnotations = parser.Annotation{
8787
Validator: parser.ValidateRegex(parser.SizeRegex, true),
8888
Scope: parser.AnnotationScopeLocation,
8989
Risk: parser.AnnotationRiskLow,
90-
Documentation: `This annotation limits the total size of buffers that can be busy sending a response to the client while the response is not yet fully read. By default proxy busy buffers size is set as "8k".`,
90+
Documentation: `This annotation limits the total size of buffers that can be busy sending a response to the client while the response is not yet fully read.`,
9191
},
9292
proxyCookiePathAnnotation: {
9393
Validator: parser.ValidateRegex(parser.URLIsValidRegex, true),
@@ -301,11 +301,9 @@ func (a proxy) Parse(ing *networking.Ingress) (interface{}, error) {
301301
config.BufferSize = defBackend.ProxyBufferSize
302302
}
303303

304-
// Only set BusyBuffersSize if annotation is present, blank is NGINX default
305-
// https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_busy_buffers_size
306304
config.BusyBuffersSize, err = parser.GetStringAnnotation(proxyBusyBuffersSizeAnnotation, ing, a.annotationConfig.Annotations)
307305
if err != nil {
308-
config.BusyBuffersSize = ""
306+
config.BusyBuffersSize = defBackend.ProxyBusyBuffersSize
309307
}
310308

311309
config.CookiePath, err = parser.GetStringAnnotation(proxyCookiePathAnnotation, ing, a.annotationConfig.Annotations)

internal/ingress/annotations/proxy/main_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ func (m mockBackend) GetDefaultBackend() defaults.Backend {
8888
ProxyReadTimeout: 20,
8989
ProxyBuffersNumber: 4,
9090
ProxyBufferSize: "10k",
91-
ProxyBusyBuffersSize: "15k",
91+
ProxyBusyBuffersSize: "",
9292
ProxyBodySize: "3k",
9393
ProxyNextUpstream: "error",
9494
ProxyNextUpstreamTimeout: 0,
@@ -299,7 +299,6 @@ func TestProxyWithNoAnnotation(t *testing.T) {
299299
}
300300
}
301301

302-
// Add a test for when annotation is set
303302
func TestProxyWithBusyBuffersSizeAnnotation(t *testing.T) {
304303
ing := buildIngress()
305304
data := map[string]string{}

internal/ingress/controller/config/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -860,7 +860,7 @@ func NewDefault() Configuration {
860860
ProxySendTimeout: 60,
861861
ProxyBuffersNumber: 4,
862862
ProxyBufferSize: "4k",
863-
ProxyBusyBuffersSize: "8k",
863+
ProxyBusyBuffersSize: "",
864864
ProxyCookieDomain: "off",
865865
ProxyCookiePath: "off",
866866
ProxyNextUpstream: "error timeout",

0 commit comments

Comments
 (0)