fix(dotnet): 全部 .NET 主容器加 appArmorProfile Unconfined——AppArmor 拒线程定向信号致 GC abort

根因(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。
This commit is contained in:
薛佳帆 committed 2026-11-11 16:38:24 +08:00
1 parent dcc948188b
commit bf0170aa26
6 files changed
+18

No files matched your search

@@ -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 }}
@@ -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 }}
@@ -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 }}
@@ -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 }}
@@ -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 }}
@@ -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 }}