Hi frnds, i think in this question(ckad mock1), while creating ingress network policy the labels should be used as app=redis instead of access=redis(maintained in question) to access the deployment, as deployment has the label app=redis. pls correct me if i amwrong. need to clear this doubt.
I believe the question says you need to provide ingress to pods with label access=redis to the pod having label app=redis
So its ingress network from app=redis to access=redis
You should add the label access-redis to match it in netpolicy after creating the deployment by following those steps
1- kubectl create deployment redis --image=redis:alpine 2- add the required label by running kubectl expose deployment redis --port-6379 --labels=app=redis
3- Create the network policy using $ vi <newfilename.yaml> as below apiVersion: http://networking.k8s.io/v1|networking.k8s.io/v1
4- create it using $ kubectl apply -f <newfilename.yaml>