From 4395e900e92fd7122b71e48d2f713110822fff1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=96=9B=E4=BD=B3=E5=B8=86?= <452531855@qq.com> Date: Tue, 8 Sep 2026 16:20:41 +0800 Subject: [PATCH] =?UTF-8?q?refactor(network-agent):=20=E7=A7=BB=E9=99=A4?= =?UTF-8?q?=20NET=5FADMIN=20capability=20=E4=B8=8E=20nm-run=20=E6=8C=82?= =?UTF-8?q?=E8=BD=BD=E2=80=94=E2=80=94agent=20=E5=B7=B2=E6=97=A0=20ip=20ad?= =?UTF-8?q?dr=20del=20=E7=AD=89=E7=BD=91=E7=BB=9C=E5=86=99=E6=93=8D?= =?UTF-8?q?=E4=BD=9C(=E5=88=87=E9=9D=99=E6=80=81=E6=B8=85=E6=AE=8B?= =?UTF-8?q?=E7=95=99=E5=8A=A8=E6=80=81=E5=9C=B0=E5=9D=80=E9=80=BB=E8=BE=91?= =?UTF-8?q?=E5=88=A0=E9=99=A4,networkd=20=E5=B0=86=E5=9C=A8=E5=AE=BF?= =?UTF-8?q?=E4=B8=BB=E6=9C=BA=20mask),=E7=89=B9=E6=9D=83=E5=8A=A8=E4=BD=9C?= =?UTF-8?q?=E5=85=A8=E9=83=A8=E7=BB=8F=20D-Bus=20=E7=94=B1=E4=B8=BB?= =?UTF-8?q?=E6=9C=BA=20NM=20=E6=89=A7=E8=A1=8C;/run/NetworkManager=20?= =?UTF-8?q?=E6=BA=90=E7=A0=81=E6=9C=AA=E4=BD=BF=E7=94=A8=E4=B8=80=E5=B9=B6?= =?UTF-8?q?=E7=A7=BB=E9=99=A4;chart=201.0.7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mixingx-network-agent/templates/daemonset.yaml | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/release-charts/mixingx-network-agent/templates/daemonset.yaml b/release-charts/mixingx-network-agent/templates/daemonset.yaml index 656be18..2009ac5 100644 --- a/release-charts/mixingx-network-agent/templates/daemonset.yaml +++ b/release-charts/mixingx-network-agent/templates/daemonset.yaml @@ -51,13 +51,10 @@ spec: - name: K3S_RESTART_ON_IP_CHANGE value: {{ .Values.k3sRestartOnIpChange | quote }} securityContext: - # 只需 root + D-Bus socket,无需 privileged - # NET_ADMIN: 清除切换静态后残留的动态地址(ip addr del 需要此能力) + # 只需 root + D-Bus socket,无需 privileged 与额外 capability: + # nmcli 经 D-Bus 操作主机 NM,特权动作(改 IP/路由)全部由 NM 进程执行 runAsUser: 0 allowPrivilegeEscalation: false - capabilities: - add: - - NET_ADMIN livenessProbe: httpGet: path: /api/network/health @@ -80,15 +77,8 @@ spec: # 主机 system bus: nmcli 与 systemd 重启都走它 - name: dbus mountPath: /run/dbus/system_bus_socket - - name: nm-run - mountPath: /run/NetworkManager - readOnly: true volumes: - name: dbus hostPath: path: /run/dbus/system_bus_socket type: Socket - - name: nm-run - hostPath: - path: /run/NetworkManager - type: DirectoryOrCreate