Linux Foundation CKS Exam - Topic 1 Question 27 Discussion
You must complete this task on the following cluster/nodes:Cluster:apparmorMaster node:masterWorker node:worker1You can switch the cluster/configuration context using the following command:[desk@cli] $kubectl config use-context apparmorGiven: AppArmor is enabled on the worker1 node.Task:On the worker1 node,1. Enforce the prepared AppArmor profile located at:/etc/apparmor.d/nginx2. Edit the prepared manifest file located at/home/cert_masters/nginx.yamlto apply the apparmor profile3. Create the Pod using this manifest
A) Explanation:
[desk@cli] $ssh worker1
[worker1@cli] $apparmor_parser -q /etc/apparmor.d/nginx
[worker1@cli] $aa-status | grep nginx
nginx-profile-1
[worker1@cli] $logout
[desk@cli] $vim nginx-deploy.yaml
Add these lines under metadata:
annotations: # Add this line
container.apparmor.security.beta.kubernetes.io/<container-name>: localhost/nginx-profile-1
[desk@cli] $kubectl apply -f nginx-deploy.yaml
Explanation
[desk@cli] $ssh worker1
[worker1@cli] $apparmor_parser -q /etc/apparmor.d/nginx
[worker1@cli] $aa-status | grep nginx
nginx-profile-1
[worker1@cli] $logout
[desk@cli] $vim nginx-deploy.yaml
[desk@cli] $kubectl apply -f nginx-deploy.yaml
pod/nginx-deploy created
Reference:https://kubernetes.io/docs/tutorials/clusters/apparmor/
pod/nginx-deploy created
[desk@cli] $kubectl apply -f nginx-deploy.yaml
pod/nginx-deploy created
Reference:https://kubernetes.io/docs/tutorials/clusters/apparmor/
Lizbeth
10 months agoOren
11 months agoGladys
11 months agoJettie
11 months agoFelicidad
11 months agoLatrice
11 months agoEstrella
11 months agoLynette
11 months agoMuriel
12 months agoJanessa
12 months agoKatina
12 months ago