fix(network-agent): 容器加 apparmor=unconfined 注解——Ubuntu dbus-daemon 的 AppArmor 仲裁拦截容器内 nmcli 的 D-Bus 调用(AccessDenied)

This commit is contained in:
薛佳帆 committed 2026-09-04 17:24:10 +08:00
1 parent da7762b0cf
commit bcc5e0d4d0
1 file changed
+4
@@ -14,6 +14,10 @@ spec:
metadata:
labels:
app.kubernetes.io/component: network-agent
annotations:
# 容器内 nmcli 通过 D-Bus 操作主机 NetworkManager,
# 需要 unconfined 才能通过 dbus-daemon 的 AppArmor 仲裁
container.apparmor.security.beta.kubernetes.io/network-agent: unconfined
spec:
# hostNetwork: IP 变更后 agent 在新 IP 上继续存活,负责回滚与 k3s 自愈;
# 前端弹窗直连 http://<节点IP>:9750 即命中该节点的 agent