From bf0170aa2650472322e2f005c71138a4c0b7c500 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 d45364d..5eb7415 100644 --- a/release-charts/mixingx-agent-unit/templates/unit.yaml +++ b/release-charts/mixingx-agent-unit/templates/unit.yaml @@ -38,6 +38,9 @@ spec: {{ $backendTag := $agentImg.tag | default $backendImg.tag | default .Values.tag | default "latest" }} image: {{ .Values.registry }}/{{ $backendRepo }}:{{ $backendTag }} 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 c6c9bc3..fdcec7d 100644 --- a/release-charts/mixingx-edge-unit/templates/unit.yaml +++ b/release-charts/mixingx-edge-unit/templates/unit.yaml @@ -71,6 +71,9 @@ spec: {{ $backendTag := $edgeImg.tag | default $backendImg.tag | default .Values.tag | default "latest" }} image: {{ .Values.registry }}/{{ $backendRepo }}:{{ $backendTag }} 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 dfdaf34..43f3bd1 100644 --- a/release-charts/mixingx-gateway/templates/gateway.yaml +++ b/release-charts/mixingx-gateway/templates/gateway.yaml @@ -34,6 +34,9 @@ spec: - name: gateway image: {{ .Values.registry }}/{{ $gatewayImage.repository | default "gateway" }}:{{ $gatewayImage.tag | default .Values.tag | default "latest" }} 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 d955645..8f9267b 100644 --- a/release-charts/mixingx-platform/templates/_workloads.tpl +++ b/release-charts/mixingx-platform/templates/_workloads.tpl @@ -33,6 +33,9 @@ spec: - name: {{ .name }} image: {{ $root.Values.registry }}/{{ .image }}:{{ $root.Values.tag | default "latest" }} 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 54481b5..ca7df41 100644 --- a/release-charts/mixingx-sso/templates/sso.yaml +++ b/release-charts/mixingx-sso/templates/sso.yaml @@ -36,6 +36,9 @@ spec: - name: {{ $name }} image: {{ $root.Values.registry }}/{{ $root.Values.images.sso.repository | default "sso" }}:{{ $root.Values.images.sso.tag | default $root.Values.tag | default "latest" }} 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 b53523d..254e7fc 100644 --- a/release-charts/mixingx-ultra/templates/ultra.yaml +++ b/release-charts/mixingx-ultra/templates/ultra.yaml @@ -41,6 +41,9 @@ spec: - name: {{ $name }} image: {{ $root.Values.registry }}/{{ $root.Values.images.ultra.repository | default "ultra" }}:{{ $root.Values.images.ultra.tag | default $root.Values.tag | default "latest" }} imagePullPolicy: IfNotPresent + securityContext: + appArmorProfile: + type: Unconfined ports: - name: http containerPort: {{ $port }}