CKS Mock Exam 1 Q1 apparamor

Solution for this task is to use annotations to get apparmor working. But cluster is on 1.30 so why new approach don’t work?

securityContext:
  appArmorProfile:
    type: <profile_type>

Prior to Kubernetes v1.30, AppArmor was specified through annotations. Use the documentation version selector to view the documentation with this deprecated API.

I got warninig when I try to use annotations:

Warning: metadata.annotations[container.apparmor.security.beta.kubernetes.io/nginx]: deprecated since v1.30; use the “appArmorProfile” field instead

The grader accepts either the old annotation based answer, or the new securityContext based answer. The posted answer has not yet been updated, although we have an issue in our tracking system to fix this. I’d suggest using the new approach both for the mock exam and for the actual exam.