Pod selector
Select which pods the policy applies to.
Ingress sources
Add namespace or pod selector sources allowed into this policy.
Ingress ports
Optional port restrictions.
Generated YAML
Client-side. Nothing is sent to a server.
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: default-deny
namespace: default
spec:
podSelector:
matchLabels:
app: web
policyTypes:
- Ingress
ingress:
-
from:
- namespaceSelector:
matchLabels:
team: frontend
ports:
- protocol: TCP
port: 80
