CKS challenge 1 Issue

HI,

I have completed all tasks within the challenge except for one task i.e. apparmor profile not being applied to the alpha-xyz deployment. Here is my deployment yaml where have I gone wrong ?


apiVersion: apps/v1
kind: Deployment
metadata:
  creationTimestamp: null
  labels:
    app: alpha-xyz
  name: alpha-xyz
  namespace: alpha
  annotations:
    container.apparmor.security.beta.kubernetes.io/nginx: localhost/custom-nginx
spec:
  replicas: 1
  selector:
    matchLabels:
      app: alpha-xyz
  strategy: {}
  template:
    metadata:
      creationTimestamp: null
      labels:
        app: alpha-xyz
    spec:
      containers:
      - image: nginx:alpine
        name: nginx
        volumeMounts:
        - mountPath: /usr/share/nginx/html
          name: data-volume
      volumes:
      - name: data-volume
        persistentVolumeClaim:
          claimName: alpha-pvc

Here is the screenshot of my progress:


kodekloud-cks-issue-2

Hi,

Click on the red arrow to reveal a task you missed.

Note that we cannot post solutions due to the competition status of CKS challenges.

Thanks,

Hi this happend a year ago but I am still not able to understand the apparmor issue, is is that apparmor cannot be applied to deployments and only pods?? Please atleast give me hints

The annotation only works at the pod level. Since you set it at the deployment .metadata level and not at the template.metadata level, it didn’t work.

ok thats what I thought as well, now I get it. Thanks for the response!!!