Hi
I have a question about namespace selectors in network policies:
I was playing with killer coda
There are existing Pods in Namespacespace1 and space2 .
We need a new NetworkPolicy named np that restricts all Pods in Namespacespace1 to only have outgoing traffic to Pods in Namespacespace2 . Incoming traffic not affected.
We also need a new NetworkPolicy named np that restricts all Pods in Namespacespace2 to only have incoming traffic from Pods in Namespacespace1 . Outgoing traffic not affected.
Hello @stephane.hordoir
The Kubernetes control plane sets an immutable label kubernetes.io/metadata.name on all namespaces, provided that the NamespaceDefaultLabelNamefeature gate is enabled. The value of the label is the namespace name.
While NetworkPolicy cannot target a namespace by its name with some object field, you can use the standardized label to target a specific namespace