Page MenuHomePhabricator

Set AppArmor profile via SecurityContext rather than annotations (k8s >=1.30)
Closed, ResolvedPublic

Description

With Kubernetes 1.30+, AppArmor profiles can now be configured through fields on the PodSecurityContext and container SecurityContext. The beta AppArmor annotations are deprecated, and AppArmor status is no longer included in the node ready condition. (https://github.com/kubernetes/kubernetes/pull/123435)

See also: T273507: PodSecurityPolicies will be deprecated with Kubernetes 1.21

Event Timeline

Change #1254338 had a related patch set uploaded (by RLazarus; author: RLazarus):

[operations/deployment-charts@master] function-{evaluator,orchestrator}: set AppArmor profile in pod SecurityContext

https://gerrit.wikimedia.org/r/1254338

JMeybohm added a subscriber: RLazarus.

@RLazarus: Given wikifunctions is the only chart with apparmor annotations I'll hand this over to you to close when the change has been merged.

Change #1254338 merged by jenkins-bot:

[operations/deployment-charts@master] function-{evaluator,orchestrator}: set AppArmor profile in pod SecurityContext

https://gerrit.wikimedia.org/r/1254338

Weirdly, Envoy failed to start after the change, with this in the logs:

[2026-04-08 21:23:16.649][1][critical][assert] [source/server/hot_restart_impl.cc:44] panic: cannot open shared memory region /envoy_shared_memory_0 check user permissions. Error: Permission denied

That wouldn't be that surprising if we were setting up a new AppArmor profile, but nothing is supposed to be changing with the actual policy.

Change #1269064 had a related patch set uploaded (by RLazarus; author: RLazarus):

[operations/deployment-charts@master] Revert "function-{evaluator,orchestrator}: set AppArmor profile in pod SecurityContext"

https://gerrit.wikimedia.org/r/1269064

Change #1269064 merged by jenkins-bot:

[operations/deployment-charts@master] Revert "function-{evaluator,orchestrator}: set AppArmor profile in pod SecurityContext"

https://gerrit.wikimedia.org/r/1269064

Change #1269069 had a related patch set uploaded (by RLazarus; author: RLazarus):

[operations/deployment-charts@master] function-{evaluator,orchestrator}: set AppArmor profile in container SecurityContext

https://gerrit.wikimedia.org/r/1269069

Change #1269069 merged by jenkins-bot:

[operations/deployment-charts@master] function-{evaluator,orchestrator}: set AppArmor profile in container SecurityContext

https://gerrit.wikimedia.org/r/1269069