ahmetb / kubernetes-network-policy-recipes

Example recipes for Kubernetes Network Policies that you can just copy paste
Apache License 2.0
5.69k stars 1.73k forks source link

Add a case for allowing traffic from namespace without labels , like using namespaceselector with matchExpressions or some other option #76

Closed learning813 closed 2 years ago

learning813 commented 3 years ago

There are chances for challenges where there is no labels given to pod to a namespace but we need to allow all pods from that namespace

Can we please add an example for a namespace selector where a namespace is selected based on the namespace's name rather than the labels on its pod ( a common CKA question), I tried namespace selector with matchExpressions but that did not work in exam

boredabdel commented 3 years ago

Will this be a good example

https://github.com/ahmetb/kubernetes-network-policy-recipes/blob/master/05-allow-traffic-from-all-namespaces.md ?