Flight Engineer
Flight Engineer

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:
podSelector: {}

I did it differently, pls comment...

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

1 Reply
Flight Engineer
Flight Engineer

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.