5.3. 对 Red Hat OpenShift Service on AWS 集群中的机器池设置更高的进程 ID 限制
您可以通过创建或编辑更改 the-pod- pids-limit 参数的 。
KubeletConfig 对象,为现有 Red Hat OpenShift Service on AWS 集群中的机器池设置更高的 pod PidsLimit
在现有机器池中更改 podPidsLimit 会触发机器池中的节点一次重新引导。对于机器池中的工作负载,在峰值使用小时外进行这个变化,并避免升级或休眠集群,直到所有节点重启为止。
先决条件
- 在 AWS 集群上有一个 Red Hat OpenShift Service。
-
已安装 ROSA 命令行界面(CLI) (
rosa)。 - 已使用 ROSA CLI 登录您的红帽帐户。
流程
为集群创建新
KubeletConfig对象,用于指定 new-pod-pids-limit:$ rosa create kubeletconfig -c <cluster_name> --name=<kubeletconfig_name> --pod-pids-limit=<value>例如,以下命令为
my-cluster集群创建一个set-high-pidsKubeletConfig对象,用于为每个 pod 设置最多 16,384 PID:$ rosa create kubeletconfig -c my-cluster --name=set-high-pids --pod-pids-limit=16384将新的
KubeletConfig对象与新的或现有机器池关联。对于新机器池:
$ rosa create machinepool -c <cluster_name> --name <machinepool_name> --kubelet-configs=<kubeletconfig_name>对于现有机器池:
$ rosa edit machinepool -c <cluster_name> --kubelet-configs=<kubeletconfig_name> <machinepool_name>输出示例
Editing the kubelet config will cause the Nodes for your Machine Pool to be recreated. This may cause outages to your applications. Do you wish to continue? (y/N)
例如,以下命令将
set-high-pidsKubeletConfig对象与my-cluster集群中的high-pid-pool机器池关联:$ rosa edit machinepool -c my-cluster --kubelet-configs=set-high-pids high-pid-pool当新的
KubeletConfig对象添加到现有机器池时,会触发 worker 节点的滚动重启。您可以在机器池描述中检查推出部署的进度:$ rosa describe machinepool --cluster <cluster_name> --machinepool <machinepool_name>
验证
确认新设置已放置到机器池的节点:
$ rosa describe kubeletconfig --cluster=<cluster_name> --name <kubeletconfig_name>新的 PID 限制会出现在输出中,如下例所示:
输出示例
Pod Pids Limit: 16384