Exercise 6.6: Domain Review
Create a new deployment which uses the nginx image
Create a new LoadBalancer service to expose the newly created deployment. Test that it works
Create a new NetworkPolicy called netblock which blocks all traffic to pods in this deployment only. Test that all traffic is blocked to deployment
Update the netblock policy to allow traffic to the pod on port 80 only. Test that you can access the default nginx web page
Find and use the security-review1.yaml file to create a pod
kubectl apply -f \ https://raw.githubusercontent.com/youngwjung/lf-training/main/LFD459/v1.24.1/solutions/s_06/security-review1.yamlView the status of the pod
Use the following commands to figure out why the pod has issues
kubectl get pod securityreview kubectl describe pod securityreview kubectl logs securityreviewAfter finding the errors, log into the container and find the proper id of the nginx user
Edit the yaml and re-create the pod such that the pod runs without error
Create a new serviceAccount called securityaccount
Create a ClusterRole named secrole which only allows create, delete, and list of pods in all apiGroups
Bind the clusterRole to the serviceAccount
Locate the token of the securityaccount. Create a file called /tmp/securitytoken. Put only the value of token: is equal to, a long string that may start with eyJh and be several lines long. Careful that only that string exists in the file
Remove any resources you have added during this review
Last updated