3.3. 配置对 API 服务器的请求率
配置配置策略控制器在每个受管集群上进行的 API 服务器的请求率。速率提高了配置策略控制器的响应,这也会增加 Kubernetes API 服务器和 OpenShift API 服务器的 CPU 和内存使用率。默认情况下,请求的速度会根据 policy-evaluation-concurrency
设置进行扩展,并被设置为每秒 30
个查询(QPS),带有 45
burst 值,代表短时间内的请求数。
您可以通过在引号内设置 client-qps
和 client-burst
注解来配置速率和突发。您可以在 hub 集群的受管集群命名空间中将 ManagedClusterAddOn
对象名称上的值设置为 config-policy-controller
。
请参阅以下 YAML 示例,其中对每秒的查询设置为 20
,并且受管集群上 burst 被设置为 100
,名为 cluster1
:
apiVersion: addon.open-cluster-management.io/v1alpha1 kind: ManagedClusterAddOn metadata: name: config-policy-controller namespace: cluster1 annotations: client-qps: "20" client-burst: "100" spec: installNamespace: open-cluster-management-agent-addon