Networkpolicy doubt

what’s the difference between below two ingress rules

spec:
  ingress:
  - from:
    - namespaceSelector:
        matchLabels:
          name: dev
spec:       
  ingress:
  - from:
    - namespaceSelector:
        matchLabels:
          name: dev
    - podSelector: {}

Hello @mohitttsingh,

They’re the same, as an empty podSelector ({}) selects all pods in the namespace.

Thanks,
Trung.

Hi @trung-kodekloud

podSelector{} means it will select all the pods in cluster or pods only from dev namespace?

Thanks,
Mohit

Hello @mohitttsingh, in the dev namespace.
Read this page could give more insights of the netpol: Network Policies | Kubernetes

Thanks,
Trung.