refactor(network-agent): 移除 NET_ADMIN capability 与 nm-run 挂载——agent 已无 ip addr del 等网络写操作(切静态清残留动态地址逻辑删除,networkd 将在宿主机 mask),特权动作全部经 D-Bus 由主机 NM 执行;/run/NetworkManager 源码未使用一并移除;chart 1.0.7

This commit is contained in:
薛佳帆 committed 2026-09-08 16:20:53 +08:00
1 parent 0aea949b49
commit 4395e900e9
1 file changed
+2 -12
@@ -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