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
7 months agoOren
8 months agoGladys
8 months agoJettie
8 months agoFelicidad
8 months agoLatrice
8 months agoEstrella
8 months agoLynette
8 months agoMuriel
9 months agoJanessa
9 months agoKatina
9 months ago