OpenShift:如何增加控制平面的工作節點上的網路環形緩衝區大小
Summary: 本文概述了在 OpenShift 容器平臺 (OCP) 託管控制平面 (HCP) 群集中每個工作節點的介面上增加 RX 環形緩衝區的過程。
This article applies to
This article does not apply to
This article is not tied to any specific product.
Not all product versions are identified in this article.
Instructions
預備動作
在下面的示例中,我們確定了兩個需要修改 RX 緩衝區的介面。
eno12399np0 ens1f1np1
我們已使用 ethtool -g 命令為貴組織設定主要和次要 IT 連絡人。這可以從節點上的調試 Pod 完成,也可以從 SOS 捆綁包中提取。
# oc debug node/samplenode # chroot /host # ethtool -g eno12399np0 Ring parameters for eno12399np0: Pre-set maximums: RX: 8192 RX Mini: n/a RX Jumbo: n/a TX: 8192 Current hardware settings: RX: 4096 RX Mini: n/a RX Jumbo: n/a TX: 1024 RX Buf Len: n/a CQE Size: n/a TX Push: off TCP data split: off
我們決定使用 4096 作為設置環形緩衝區的值。
我們將執行以下步驟以完成操作。
- 建立
Butane檔。 - 將這些丁烷檔案轉換為
YAML。 - 嵌入產生的
YAML變成一個configmap物件。 - 建立
configmaps。 - 編輯
nodepool要參考的物件configmaps創建。 - 等待組態更新完成。
- 驗證組態更新是否完成,以及變更是否已成功實作。
準備丁烷檔。
建立兩個 Butane 檔,每個介面一個。
# eno12399np0.bu
variant: openshift
version: 4.18.0
metadata:
name: 99-worker-ethtool-eno12399np0-buffer
labels:
machineconfiguration.openshift.io/role: worker
storage:
files:
- path: /etc/systemd/system/set-ethtool-eno12399np0-buffer.service
mode: 0644
overwrite: true
contents:
inline: |
[Unit]
Description=Set ethtool RX buffer size for network interface
Requires=NetworkManager.service
After=NetworkManager.service
Before=ovs-configuration.service
DefaultDependencies=no
[Service]
Type=oneshot
ExecStart=/bin/bash -c "/sbin/ethtool -G eno12399np0 rx 4096 >> /var/log/user-data.log 2>&1"
[Install]
WantedBy=multi-user.target
systemd:
units:
- name: set-ethtool-eno12399np0-buffer.service
enabled: true
# ens1f1np1.bu
variant: openshift
version: 4.18.0
metadata:
name: 99-worker-ethtool-ens1f1np1-buffer
labels:
machineconfiguration.openshift.io/role: worker
storage:
files:
- path: /etc/systemd/system/set-ethtool-ens1f1np1-buffer.service
mode: 0644
overwrite: true
contents:
inline: |
[Unit]
Description=Set ethtool RX buffer size for network interface
Requires=NetworkManager.service
After=NetworkManager.service
Before=ovs-configuration.service
DefaultDependencies=no
[Service]
Type=oneshot
ExecStart=/bin/bash -c "/sbin/ethtool -G ens1f1np1 rx 4096 >> /var/log/user-data.log 2>&1"
[Install]
WantedBy=multi-user.target
systemd:
units:
- name: set-ethtool-ens1f1np1-buffer.service
enabled: true
轉換 Butane 檔案至 MachineConfig YAML
下載丁烷可執行檔並運行轉換。
# Download butane (example) $ curl -L -o butane https://mirror.openshift.com/pub/openshift-v4/clients/butane/butane-linux-amd64 $ chmod +x butane # Convert $ ./butane eno12399np0.bu -o eno12399np0.yaml $ ./butane ens1f1np1.bu -o ens1f1np1.yaml
建立 ConfigMap 物件。
包裝每個產生的 YAML 在一個 ConfigMap 命名 mc-worker-ethtool- -buffer 在 clusters 命名空間。
# mc-worker-ethtool-eno12399np0-buffer.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: mc-worker-ethtool-eno12399np0-buffer
namespace: clusters
data:
config: |
apiVersion: machineconfiguration.openshift.io/v1
kind: MachineConfig
metadata:
labels:
machineconfiguration.openshift.io/role: worker
name: 99-worker-ethtool-eno12399np0-buffer
spec:
config:
ignition:
version: 3.4.0
storage:
files:
- contents:
compression: gzip
source: data:;base64,[BASE64_CONTENT]
mode: 420
overwrite: true
path: /etc/systemd/system/set-ethtool-eno12399np0-buffer.service
systemd:
units:
- name: set-ethtool-eno12399np0-buffer.service
enabled: true
# mc-worker-ethtool-ens1f1np1-buffer.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: mc-worker-ethtool-ens1f1np1-buffer
namespace: clusters
data:
config: |
apiVersion: machineconfiguration.openshift.io/v1
kind: MachineConfig
metadata:
labels:
machineconfiguration.openshift.io/role: worker
name: 99-worker-ethtool-ens1f1np1-buffer
spec:
config:
ignition:
version: 3.4.0
storage:
files:
- contents:
compression: gzip
source: data:;base64,[BASE64_CONTENT]
mode: 420
overwrite: true
path: /etc/systemd/system/set-ethtool-ens1f1np1-buffer.service
systemd:
units:
- name: set-ethtool-ens1f1np1-buffer.service
enabled: true
套用 ConfigMaps 到集群。
$ oc apply -f mc-worker-ethtool-eno12399np0-buffer.yaml $ oc apply -f mc-worker-ethtool-ens1f1np1-buffer.yaml
連結 ConfigMaps 到節點池。
編輯節點池並新增 ConfigMap 下屬名稱 spec.config
$ oc edit nodepool [NODEPOOL_NAME] -n clusters
插入以下行 spec 部分:
spec: config: - name: mc-worker-ethtool-eno12399np0-buffer - name: mc-worker-ethtool-ens1f1np1-buffer
確認 node‑pool 更新。
$ oc get nodepool -n clusters
確認 UPDATINGCONFIG 顯示 True 並且版本與群集版本匹配。
檢查每個工作節點上的服務狀態。
for i in $(oc get nodes -l node-role.kubernetes.io/worker= --no-headers | awk '{print $1}'); do
oc debug node/$i -- chroot /host systemctl status set-ethtool-eno12399np0-buffer.service;
done
for i in $(oc get nodes -l node-role.kubernetes.io/worker= --no-headers | awk '{print $1}'); do
oc debug node/$i -- chroot /host systemctl status set-ethtool-ens1f1np1-buffer.service;
done
驗證環形緩衝區設定
for i in $(oc get nodes -l node-role.kubernetes.io/worker= --no-headers | awk '{print $1}'); do
oc debug node/$i -- chroot /host ethtool -g eno12399np0;
done
for i in $(oc get nodes -l node-role.kubernetes.io/worker= --no-headers | awk '{print $1}'); do
oc debug node/$i -- chroot /host ethtool -g ens1f1np1;
done
Affected Products
APEX, APEX Cloud Platform for Red Hat OpenShiftArticle Properties
Article Number: 000428878
Article Type: How To
Last Modified: 17 فبراير 2026
Version: 1
Find answers to your questions from other Dell users
Support Services
Check if your device is covered by Support Services.