From 0a451f6070f5f2713e02c291553ce7742bb2fb98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=96=9B=E4=BD=B3=E5=B8=86?= <452531855@qq.com> Date: Wed, 11 Nov 2026 16:38:24 +0800 Subject: [PATCH] =?UTF-8?q?fix(dotnet):=20=E5=85=A8=E9=83=A8=20.NET=20?= =?UTF-8?q?=E4=B8=BB=E5=AE=B9=E5=99=A8=E5=8A=A0=20appArmorProfile=20Unconf?= =?UTF-8?q?ined=E2=80=94=E2=80=94AppArmor=20=E6=8B=92=E7=BA=BF=E7=A8=8B?= =?UTF-8?q?=E5=AE=9A=E5=90=91=E4=BF=A1=E5=8F=B7=E8=87=B4=20GC=20abort?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 根因(dotnet/runtime#136603,已由同事在 sciveda 现场实测验证):Ubuntu 26.04 新内核 配套 AppArmor 行为禁止容器内进程向自身线程发信号(pthread_kill/tgkill → EACCES), CoreCLR GC 挂起线程失败 → 运行时 abort → dmesg 表现为 'general protection fault in libc.so.6[+0x289a2]'(.NET BGC/Server GC/TP Worker 线程),容器 exit 139 CrashLoop,负载越高崩得越频,且 journalctl 无 apparmor=DENIED 记录。 同机制亦解释此前 postgres 'could not signal for checkpoint: Permission denied' (privileged 之所以有效 = privileged 容器不受 AppArmor 约束)。 修复:agent/sso/ultra/edge/gateway/platform 六处 .NET 主容器 securityContext.appArmorProfile.type: Unconfined。 --- release-charts/mixingx-agent-unit/templates/unit.yaml | 3 +++ release-charts/mixingx-edge-unit/templates/unit.yaml | 3 +++ release-charts/mixingx-gateway/templates/gateway.yaml | 3 +++ release-charts/mixingx-platform/templates/_workloads.tpl | 3 +++ release-charts/mixingx-sso/templates/sso.yaml | 3 +++ release-charts/mixingx-ultra/templates/ultra.yaml | 3 +++ 6 files changed, 18 insertions(+) diff --git a/release-charts/mixingx-agent-unit/templates/unit.yaml b/release-charts/mixingx-agent-unit/templates/unit.yaml index 2706ba0..7df8cd5 100644 --- a/release-charts/mixingx-agent-unit/templates/unit.yaml +++ b/release-charts/mixingx-agent-unit/templates/unit.yaml @@ -81,6 +81,9 @@ spec: - name: {{ $name }} image: {{ include "mixingx-agent-unit.image" (dict "registry" .Values.global.imageRegistry "image" .Values.images.agent) | quote }} imagePullPolicy: IfNotPresent + securityContext: + appArmorProfile: + type: Unconfined ports: - name: http containerPort: {{ .Values.ports.backend }} diff --git a/release-charts/mixingx-edge-unit/templates/unit.yaml b/release-charts/mixingx-edge-unit/templates/unit.yaml index 10fc0f3..d0a68af 100644 --- a/release-charts/mixingx-edge-unit/templates/unit.yaml +++ b/release-charts/mixingx-edge-unit/templates/unit.yaml @@ -59,6 +59,9 @@ spec: - name: {{ $name }} image: {{ include "mixingx-edge-unit.image" (dict "registry" .Values.global.imageRegistry "image" .Values.images.edge) | quote }} imagePullPolicy: IfNotPresent + securityContext: + appArmorProfile: + type: Unconfined ports: - name: http containerPort: {{ .Values.ports.backend }} diff --git a/release-charts/mixingx-gateway/templates/gateway.yaml b/release-charts/mixingx-gateway/templates/gateway.yaml index b22a2c3..67160ec 100644 --- a/release-charts/mixingx-gateway/templates/gateway.yaml +++ b/release-charts/mixingx-gateway/templates/gateway.yaml @@ -30,6 +30,9 @@ spec: - name: gateway image: {{ include "mixingx-gateway.image" (dict "registry" .Values.global.imageRegistry "image" $gatewayImage) | quote }} imagePullPolicy: IfNotPresent + securityContext: + appArmorProfile: + type: Unconfined ports: - name: http containerPort: {{ .Values.gateway.port | default 8080 }} diff --git a/release-charts/mixingx-platform/templates/_workloads.tpl b/release-charts/mixingx-platform/templates/_workloads.tpl index 88b3de2..079a55f 100644 --- a/release-charts/mixingx-platform/templates/_workloads.tpl +++ b/release-charts/mixingx-platform/templates/_workloads.tpl @@ -30,6 +30,9 @@ spec: {{ $image := index $root.Values.images .image }} image: {{ include "mixingx-platform.image" (dict "registry" $root.Values.global.imageRegistry "image" $image) | quote }} imagePullPolicy: IfNotPresent + securityContext: + appArmorProfile: + type: Unconfined ports: - name: http containerPort: {{ $port }} diff --git a/release-charts/mixingx-sso/templates/sso.yaml b/release-charts/mixingx-sso/templates/sso.yaml index 77f2551..2a9d535 100644 --- a/release-charts/mixingx-sso/templates/sso.yaml +++ b/release-charts/mixingx-sso/templates/sso.yaml @@ -32,6 +32,9 @@ spec: - name: {{ $name }} image: {{ include "mixingx-sso.image" (dict "registry" $root.Values.global.imageRegistry "image" $root.Values.images.sso) | quote }} imagePullPolicy: IfNotPresent + securityContext: + appArmorProfile: + type: Unconfined ports: - name: http containerPort: {{ $backendPort }} diff --git a/release-charts/mixingx-ultra/templates/ultra.yaml b/release-charts/mixingx-ultra/templates/ultra.yaml index 5d998df..ba0635e 100644 --- a/release-charts/mixingx-ultra/templates/ultra.yaml +++ b/release-charts/mixingx-ultra/templates/ultra.yaml @@ -37,6 +37,9 @@ spec: - name: {{ $name }} image: {{ include "mixingx-ultra.image" (dict "registry" $root.Values.global.imageRegistry "image" $root.Values.images.ultra) | quote }} imagePullPolicy: IfNotPresent + securityContext: + appArmorProfile: + type: Unconfined ports: - name: http containerPort: {{ $port }}