cancel
Showing results for 
Search instead for 
Did you mean: 
fannullone
Flight Engineer
Flight Engineer
  • 492 Views

do280 ch4 guided exercise: Configure Network Policies - step 12 solution not correct?

The requirement is Create a network policy that allows traffic to the hello pod via the exposed route.
So this is ONLY for the hellp pod, but the solution provided grant access to all pods:
spec:
podSelector: {}

I did it differently, pls comment...


[student@workstation ~]$ oc get networkpolicies/allow-from-openshift-ingress -ojsonpath='{.spec.podSelector}{"\n"}'
{"matchLabels":{"deployment":"hello"}}

1 Reply
MalborBoss
Flight Engineer
Flight Engineer
  • 329 Views

Exercise didn't specify that you need to limit the policy just to pods with some labels, therefore solution was provided as it was provided. Otherwise I would say that your solution is correct. But just to be safe - on exam when they don't tell you to limit the policy only to some pods, I wouldn't do it.

0 Kudos
Join the discussion
You must log in to join this conversation.