Config/Annotations: Add proxy-busy-buffers-size. (#12433)
This commit is contained in:
parent
5ae018e5df
commit
d1dc3e827f
10 changed files with 59 additions and 0 deletions
|
|
@ -31,6 +31,7 @@ const (
|
|||
proxyReadTimeoutAnnotation = "proxy-read-timeout"
|
||||
proxyBuffersNumberAnnotation = "proxy-buffers-number"
|
||||
proxyBufferSizeAnnotation = "proxy-buffer-size"
|
||||
proxyBusyBuffersSizeAnnotation = "proxy-busy-buffers-size"
|
||||
proxyCookiePathAnnotation = "proxy-cookie-path"
|
||||
proxyCookieDomainAnnotation = "proxy-cookie-domain"
|
||||
proxyBodySizeAnnotation = "proxy-body-size"
|
||||
|
|
@ -82,6 +83,12 @@ var proxyAnnotations = parser.Annotation{
|
|||
Documentation: `This annotation sets the size of the buffer proxy_buffer_size used for reading the first part of the response received from the proxied server.
|
||||
By default proxy buffer size is set as "4k".`,
|
||||
},
|
||||
proxyBusyBuffersSizeAnnotation: {
|
||||
Validator: parser.ValidateRegex(parser.SizeRegex, true),
|
||||
Scope: parser.AnnotationScopeLocation,
|
||||
Risk: parser.AnnotationRiskLow,
|
||||
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".`,
|
||||
},
|
||||
proxyCookiePathAnnotation: {
|
||||
Validator: parser.ValidateRegex(parser.URLIsValidRegex, true),
|
||||
Scope: parser.AnnotationScopeLocation,
|
||||
|
|
@ -167,6 +174,7 @@ type Config struct {
|
|||
ReadTimeout int `json:"readTimeout"`
|
||||
BuffersNumber int `json:"buffersNumber"`
|
||||
BufferSize string `json:"bufferSize"`
|
||||
BusyBuffersSize string `json:"busyBuffersSize"`
|
||||
CookieDomain string `json:"cookieDomain"`
|
||||
CookiePath string `json:"cookiePath"`
|
||||
NextUpstream string `json:"nextUpstream"`
|
||||
|
|
@ -206,6 +214,9 @@ func (l1 *Config) Equal(l2 *Config) bool {
|
|||
if l1.BufferSize != l2.BufferSize {
|
||||
return false
|
||||
}
|
||||
if l1.BusyBuffersSize != l2.BusyBuffersSize {
|
||||
return false
|
||||
}
|
||||
if l1.CookieDomain != l2.CookieDomain {
|
||||
return false
|
||||
}
|
||||
|
|
@ -290,6 +301,11 @@ func (a proxy) Parse(ing *networking.Ingress) (interface{}, error) {
|
|||
config.BufferSize = defBackend.ProxyBufferSize
|
||||
}
|
||||
|
||||
config.BusyBuffersSize, err = parser.GetStringAnnotation(proxyBusyBuffersSizeAnnotation, ing, a.annotationConfig.Annotations)
|
||||
if err != nil {
|
||||
config.BusyBuffersSize = defBackend.ProxyBusyBuffersSize
|
||||
}
|
||||
|
||||
config.CookiePath, err = parser.GetStringAnnotation(proxyCookiePathAnnotation, ing, a.annotationConfig.Annotations)
|
||||
if err != nil {
|
||||
config.CookiePath = defBackend.ProxyCookiePath
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue