Hello,
my network rule is checked as wrong due “NetworkPolicy: Is it not applied to all sources (Incoming traffic from all pods)”
My yaml is the follow. At the end the proposed correct one. Why the mine is wrong?
My yaml:
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: ingress-to-nptest
namespace: default
spec:
ingress:
- from:
- podSelector: {}
ports:
- port: 80
protocol: TCP
podSelector:
matchLabels:
run: np-test-1
policyTypes:
- Ingress
right yaml:
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: ingress-to-nptest
namespace: default
spec:
podSelector:
matchLabels:
run: np-test-1
policyTypes:
- Ingress
ingress:
- ports:
- protocol: TCP
port: 80