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:
1 parent
0aea949b49
commit
4395e900e9
1 file changed
+2
-12
@@ -51,13 +51,10 @@ spec:
|
|||||||
- name: K3S_RESTART_ON_IP_CHANGE
|
- name: K3S_RESTART_ON_IP_CHANGE
|
||||||
value: {{ .Values.k3sRestartOnIpChange | quote }}
|
value: {{ .Values.k3sRestartOnIpChange | quote }}
|
||||||
securityContext:
|
securityContext:
|
||||||
# 只需 root + D-Bus socket,无需 privileged
|
# 只需 root + D-Bus socket,无需 privileged 与额外 capability:
|
||||||
# NET_ADMIN: 清除切换静态后残留的动态地址(ip addr del 需要此能力)
|
# nmcli 经 D-Bus 操作主机 NM,特权动作(改 IP/路由)全部由 NM 进程执行
|
||||||
runAsUser: 0
|
runAsUser: 0
|
||||||
allowPrivilegeEscalation: false
|
allowPrivilegeEscalation: false
|
||||||
capabilities:
|
|
||||||
add:
|
|
||||||
- NET_ADMIN
|
|
||||||
livenessProbe:
|
livenessProbe:
|
||||||
httpGet:
|
httpGet:
|
||||||
path: /api/network/health
|
path: /api/network/health
|
||||||
@@ -80,15 +77,8 @@ spec:
|
|||||||
# 主机 system bus: nmcli 与 systemd 重启都走它
|
# 主机 system bus: nmcli 与 systemd 重启都走它
|
||||||
- name: dbus
|
- name: dbus
|
||||||
mountPath: /run/dbus/system_bus_socket
|
mountPath: /run/dbus/system_bus_socket
|
||||||
- name: nm-run
|
|
||||||
mountPath: /run/NetworkManager
|
|
||||||
readOnly: true
|
|
||||||
volumes:
|
volumes:
|
||||||
- name: dbus
|
- name: dbus
|
||||||
hostPath:
|
hostPath:
|
||||||
path: /run/dbus/system_bus_socket
|
path: /run/dbus/system_bus_socket
|
||||||
type: Socket
|
type: Socket
|
||||||
- name: nm-run
|
|
||||||
hostPath:
|
|
||||||
path: /run/NetworkManager
|
|
||||||
type: DirectoryOrCreate
|
|
||||||
Reference in new issue
Block a user