k8s-samples/CKA_Course/networkpolicy.yaml
2022-08-16 21:59:58 -05:00

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