hi i have question about networkpolicy. If there is no label on namespaces and pods on both source and destination, should I create the labels myself to apply it? It seems that there’s no labels at all in the pods and namespaces in the real exam questions. Or is there a way to apply networkpolicy only with name of pods or namespaces?
Yes you have to label namespace. Pod should be labelled already.
no pods had no labels neither so thought there could be different way
@Pratik Patel what do you mean by “label the namespace”, can we label the namespace??!.. I do not think so !!
Deepak Kumar Sahu:
@AnasGoaln: yes we can do it which can be used in namespaceSelector in netpol.
I will check for this … thanks !!
@AnasGoaln you can label namespace and you have to, in order to use namespaceselector in NetworkPolicy.
I rechecked … you are absolutely right… thanks for the clarification !!