Skip to content

Commit 9296c22

Browse files
[Helm] Make Kube Client QPS and Burst configurable for kuberay-operator (#4002)
* [Helm] Make Kube Client QPS and burst configurable for kuberay-operator Signed-off-by: Future-Outlier <eric901201@gmail.com> * update Signed-off-by: Future-Outlier <eric901201@gmail.com> * update Signed-off-by: Future-Outlier <eric901201@gmail.com> --------- Signed-off-by: Future-Outlier <eric901201@gmail.com>
1 parent d56356b commit 9296c22

File tree

4 files changed

+43
-0
lines changed

4 files changed

+43
-0
lines changed

helm-chart/kuberay-operator/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,9 @@ spec:
174174
| operatorCommand | string | `"/manager"` | Path to the operator binary |
175175
| leaderElectionEnabled | bool | `true` | If leaderElectionEnabled is set to true, the KubeRay operator will use leader election for high availability. |
176176
| reconcileConcurrency | int | `1` | The maximum number of reconcile operations that can be performed simultaneously. This setting controls the concurrency of the controller reconciliation loops. Higher values can improve throughput in clusters with many resources, but may increase resource consumption. |
177+
| kubeClient | object | `{"burst":200,"qps":100}` | Kube Client configuration for QPS and burst settings. This setting controls the QPS and burst rate of the kube client when sending requests to the Kubernetes API server. If the QPS and burst values are too low, we may easily hit rate limits on the API server and slow down the controller reconciliation loops. |
178+
| kubeClient.qps | float | `100` | The QPS value for the client communicating with the Kubernetes API server. Must be a float number. |
179+
| kubeClient.burst | int | `200` | The maximum burst for throttling requests from this client to the Kubernetes API server. Must be a non-negative integer. |
177180
| rbacEnable | bool | `true` | If rbacEnable is set to false, no RBAC resources will be created, including the Role for leader election, the Role for Pods and Services, and so on. |
178181
| crNamespacedRbacEnable | bool | `true` | When crNamespacedRbacEnable is set to true, the KubeRay operator will create a Role for RayCluster preparation (e.g., Pods, Services) and a corresponding RoleBinding for each namespace listed in the "watchNamespace" parameter. Please note that even if crNamespacedRbacEnable is set to false, the Role and RoleBinding for leader election will still be created. Note: (1) This variable is only effective when rbacEnable and singleNamespaceInstall are both set to true. (2) In most cases, it should be set to true, unless you are using a Kubernetes cluster managed by GitOps tools such as ArgoCD. |
179182
| singleNamespaceInstall | bool | `false` | When singleNamespaceInstall is true: - Install namespaced RBAC resources such as Role and RoleBinding instead of cluster-scoped ones like ClusterRole and ClusterRoleBinding so that the chart can be installed by users with permissions restricted to a single namespace. (Please note that this excludes the CRDs, which can only be installed at the cluster scope.) - If "watchNamespace" is not set, the KubeRay operator will, by default, only listen to resource events within its own namespace. |

helm-chart/kuberay-operator/templates/deployment.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,22 @@ spec:
115115
{{- end }}
116116
{{- $argList = append $argList (printf "--reconcile-concurrency=%v" .Values.reconcileConcurrency) -}}
117117
{{- end -}}
118+
{{- if hasKey .Values "kubeClient" -}}
119+
{{- if hasKey .Values.kubeClient "qps" -}}
120+
{{- $qps := toString .Values.kubeClient.qps }}
121+
{{- if not (regexMatch "^[+-]?[0-9]+(\\.[0-9]+)?$" $qps) }}
122+
{{- fail (printf "values.kubeClient.qps must be a valid float number, got %q" $qps) }}
123+
{{- end }}
124+
{{- $argList = append $argList (printf "--qps=%v" .Values.kubeClient.qps) -}}
125+
{{- end -}}
126+
{{- if hasKey .Values.kubeClient "burst" -}}
127+
{{- $burst := toString .Values.kubeClient.burst }}
128+
{{- if not (regexMatch "^[0-9]+$" $burst) }}
129+
{{- fail (printf "values.kubeClient.burst must be a non-negative integer, got %q" $burst) }}
130+
{{- end }}
131+
{{- $argList = append $argList (printf "--burst=%v" .Values.kubeClient.burst) -}}
132+
{{- end -}}
133+
{{- end -}}
118134
{{- (printf "\n") -}}
119135
{{- $argList | toYaml | indent 12 }}
120136
ports:

helm-chart/kuberay-operator/tests/deployment_test.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,3 +275,16 @@ tests:
275275
- contains:
276276
path: spec.template.spec.containers[?(@.name=="kuberay-operator")].args
277277
content: "--reconcile-concurrency=5"
278+
279+
- it: Should use custom kube client qps and burst when set
280+
set:
281+
kubeClient:
282+
qps: 75.5
283+
burst: 150
284+
asserts:
285+
- contains:
286+
path: spec.template.spec.containers[?(@.name=="kuberay-operator")].args
287+
content: "--qps=75.5"
288+
- contains:
289+
path: spec.template.spec.containers[?(@.name=="kuberay-operator")].args
290+
content: "--burst=150"

helm-chart/kuberay-operator/values.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,17 @@ leaderElectionEnabled: true
121121
# Higher values can improve throughput in clusters with many resources, but may increase resource consumption.
122122
reconcileConcurrency: 1
123123

124+
# -- Kube Client configuration for QPS and burst settings.
125+
# This setting controls the QPS and burst rate of the kube client when sending requests to the Kubernetes API server.
126+
# If the QPS and burst values are too low, we may easily hit rate limits on the API server and slow down the controller reconciliation loops.
127+
kubeClient:
128+
# -- The QPS value for the client communicating with the Kubernetes API server.
129+
# Must be a float number.
130+
qps: 100.0
131+
# -- The maximum burst for throttling requests from this client to the Kubernetes API server.
132+
# Must be a non-negative integer.
133+
burst: 200
134+
124135
# -- If rbacEnable is set to false, no RBAC resources will be created, including the Role for leader election, the Role for Pods and Services, and so on.
125136
rbacEnable: true
126137

0 commit comments

Comments
 (0)