diff --git a/packages/system/cilium/Makefile b/packages/system/cilium/Makefile index 14abbf54..71b47a77 100644 --- a/packages/system/cilium/Makefile +++ b/packages/system/cilium/Makefile @@ -18,7 +18,7 @@ update: # produce duplicate mapping keys on k8s<1.30. perl -i -0pe 's|\n \{\{- if not \.Values\.securityContext\.privileged \}\}\n \{\{- if semverCompare "<1\.30\.0".*?\n \{\{- end \}\}\n \{\{- end \}\}\n \{\{- end \}\}||s' \ charts/cilium/templates/cilium-agent/daemonset.yaml - @! grep -q 'container\.apparmor\.security\.beta\.kubernetes\.io/cilium-agent: "unconfined"' \ + @! grep -q 'container\.apparmor\.security\.beta\.kubernetes\.io' \ charts/cilium/templates/cilium-agent/daemonset.yaml || \ { echo 'ERROR: perl patch did not remove the upstream AppArmor block from cilium-agent/daemonset.yaml (upstream template format may have changed)' >&2; exit 1; } version=$$(awk '$$1 == "version:" {print $$2}' charts/cilium/Chart.yaml) && \ diff --git a/packages/system/cilium/values.yaml b/packages/system/cilium/values.yaml index 3902287c..8aee34d9 100644 --- a/packages/system/cilium/values.yaml +++ b/packages/system/cilium/values.yaml @@ -31,10 +31,13 @@ cilium: # The deprecated annotations are used because k8s >= 1.30 pod-level # appArmorProfile: Unconfined is not honoured by containerd CRI today # (kubernetes/kubernetes#125069). - # Safe on Talos / RHEL family without AppArmor: kubelet ignores these - # annotations when the AppArmor LSM is not loaded. - # mount-bpf-fs is intentionally excluded: it runs as privileged, and the - # kernel does not apply AppArmor profiles to privileged containers. + # On Talos mount-cgroup is not rendered (cgroup.autoMount.enabled=false in + # values-talos.yaml) so its annotation is inert there. On RHEL-family and + # other AppArmor-less hosts kubelet silently ignores these annotations + # because the AppArmor LSM is not loaded. + # mount-bpf-fs is intentionally excluded: it renders with its own + # securityContext.privileged=true, and the kernel does not apply AppArmor + # profiles to privileged containers. podAnnotations: container.apparmor.security.beta.kubernetes.io/cilium-agent: unconfined container.apparmor.security.beta.kubernetes.io/clean-cilium-state: unconfined