From 0231818c67705073430661200c0412fd7b633845 Mon Sep 17 00:00:00 2001 From: Ryan Fredette Date: Tue, 4 May 2021 12:43:05 -0400 Subject: [PATCH 1/2] Set maximum for ingresscontroller spec.tuningOptions.threadCount to 64 As of this commit HAProxy only supports up to 64 threads --- .../v1/0000_50_ingress-operator_00-ingresscontroller.crd.yaml | 1 + operator/v1/types_ingress.go | 1 + 2 files changed, 2 insertions(+) diff --git a/operator/v1/0000_50_ingress-operator_00-ingresscontroller.crd.yaml b/operator/v1/0000_50_ingress-operator_00-ingresscontroller.crd.yaml index 9bcd8445a25..4462626ee02 100644 --- a/operator/v1/0000_50_ingress-operator_00-ingresscontroller.crd.yaml +++ b/operator/v1/0000_50_ingress-operator_00-ingresscontroller.crd.yaml @@ -990,6 +990,7 @@ spec: Reducing the number of threads may cause the ingress controller to perform poorly." format: int32 + maximum: 64 minimum: 1 type: integer type: object diff --git a/operator/v1/types_ingress.go b/operator/v1/types_ingress.go index 235d1184929..810849afbff 100644 --- a/operator/v1/types_ingress.go +++ b/operator/v1/types_ingress.go @@ -1076,6 +1076,7 @@ type IngressControllerTuningOptions struct { // // +kubebuilder:validation:Optional // +kubebuilder:validation:Minimum=1 + // +kubebuilder:validation:Maximum=64 // +optional ThreadCount int32 `json:"threadCount,omitempty"` } From 6ca127d85b91209e919ccba4cba67a9e38bee7f3 Mon Sep 17 00:00:00 2001 From: Ryan Fredette Date: Tue, 4 May 2021 17:29:28 -0400 Subject: [PATCH 2/2] Explicitly mention 64 thread limit in tuningOptions.threadCount field --- ...000_50_ingress-operator_00-ingresscontroller.crd.yaml | 9 +++++---- operator/v1/types_ingress.go | 7 ++++--- operator/v1/zz_generated.swagger_doc_generated.go | 2 +- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/operator/v1/0000_50_ingress-operator_00-ingresscontroller.crd.yaml b/operator/v1/0000_50_ingress-operator_00-ingresscontroller.crd.yaml index 4462626ee02..eaaecf0b237 100644 --- a/operator/v1/0000_50_ingress-operator_00-ingresscontroller.crd.yaml +++ b/operator/v1/0000_50_ingress-operator_00-ingresscontroller.crd.yaml @@ -981,10 +981,11 @@ spec: description: "threadCount defines the number of threads created per HAProxy process. Creating more threads allows each ingress controller pod to handle more connections, at the cost of more - system resources being used. If this field is empty, the IngressController - will use the default value. The current default is 4 threads, - but this may change in future releases. \n Setting this field - is generally not recommended. Increasing the number of HAProxy + system resources being used. HAProxy currently supports up to + 64 threads. If this field is empty, the IngressController will + use the default value. The current default is 4 threads, but + this may change in future releases. \n Setting this field is + generally not recommended. Increasing the number of HAProxy threads allows ingress controller pods to utilize more CPU time under load, potentially starving other pods if set too high. Reducing the number of threads may cause the ingress controller diff --git a/operator/v1/types_ingress.go b/operator/v1/types_ingress.go index 810849afbff..126b53cf0d8 100644 --- a/operator/v1/types_ingress.go +++ b/operator/v1/types_ingress.go @@ -1064,9 +1064,10 @@ type IngressControllerTuningOptions struct { // threadCount defines the number of threads created per HAProxy process. // Creating more threads allows each ingress controller pod to handle more - // connections, at the cost of more system resources being used. If this - // field is empty, the IngressController will use the default value. The - // current default is 4 threads, but this may change in future releases. + // connections, at the cost of more system resources being used. HAProxy + // currently supports up to 64 threads. If this field is empty, the + // IngressController will use the default value. The current default is 4 + // threads, but this may change in future releases. // // Setting this field is generally not recommended. Increasing the number // of HAProxy threads allows ingress controller pods to utilize more CPU diff --git a/operator/v1/zz_generated.swagger_doc_generated.go b/operator/v1/zz_generated.swagger_doc_generated.go index cacc8f2acd3..c54dab28c06 100644 --- a/operator/v1/zz_generated.swagger_doc_generated.go +++ b/operator/v1/zz_generated.swagger_doc_generated.go @@ -668,7 +668,7 @@ var map_IngressControllerTuningOptions = map[string]string{ "": "IngressControllerTuningOptions specifies options for tuning the performance of ingress controller pods", "headerBufferBytes": "headerBufferBytes describes how much memory should be reserved (in bytes) for IngressController connection sessions. Note that this value must be at least 16384 if HTTP/2 is enabled for the IngressController (https://tools.ietf.org/html/rfc7540). If this field is empty, the IngressController will use a default value of 32768 bytes.\n\nSetting this field is generally not recommended as headerBufferBytes values that are too small may break the IngressController and headerBufferBytes values that are too large could cause the IngressController to use significantly more memory than necessary.", "headerBufferMaxRewriteBytes": "headerBufferMaxRewriteBytes describes how much memory should be reserved (in bytes) from headerBufferBytes for HTTP header rewriting and appending for IngressController connection sessions. Note that incoming HTTP requests will be limited to (headerBufferBytes - headerBufferMaxRewriteBytes) bytes, meaning headerBufferBytes must be greater than headerBufferMaxRewriteBytes. If this field is empty, the IngressController will use a default value of 8192 bytes.\n\nSetting this field is generally not recommended as headerBufferMaxRewriteBytes values that are too small may break the IngressController and headerBufferMaxRewriteBytes values that are too large could cause the IngressController to use significantly more memory than necessary.", - "threadCount": "threadCount defines the number of threads created per HAProxy process. Creating more threads allows each ingress controller pod to handle more connections, at the cost of more system resources being used. If this field is empty, the IngressController will use the default value. The current default is 4 threads, but this may change in future releases.\n\nSetting this field is generally not recommended. Increasing the number of HAProxy threads allows ingress controller pods to utilize more CPU time under load, potentially starving other pods if set too high. Reducing the number of threads may cause the ingress controller to perform poorly.", + "threadCount": "threadCount defines the number of threads created per HAProxy process. Creating more threads allows each ingress controller pod to handle more connections, at the cost of more system resources being used. HAProxy currently supports up to 64 threads. If this field is empty, the IngressController will use the default value. The current default is 4 threads, but this may change in future releases.\n\nSetting this field is generally not recommended. Increasing the number of HAProxy threads allows ingress controller pods to utilize more CPU time under load, potentially starving other pods if set too high. Reducing the number of threads may cause the ingress controller to perform poorly.", } func (IngressControllerTuningOptions) SwaggerDoc() map[string]string {