21 lines
368 B
YAML
21 lines
368 B
YAML
apiVersion: networking.k8s.io/v1
|
|
kind: NetworkPolicy
|
|
metadata:
|
|
name: my-network-policy
|
|
spec:
|
|
podSelector:
|
|
matchLabels:
|
|
role: db
|
|
ingress:
|
|
- from:
|
|
- podSelector:
|
|
matchLabels:
|
|
app: db
|
|
egress:
|
|
- to:
|
|
- namespaceSelector:
|
|
matchLabels:
|
|
app: web
|
|
ports:
|
|
- protocol: TCP
|
|
port: 80
|