36 lines
687 B
YAML
36 lines
687 B
YAML
apiVersion: networking.k8s.io/v1
|
|
kind: NetworkPolicy
|
|
metadata:
|
|
name: test-network-policy
|
|
namespace: storefront
|
|
spec:
|
|
podSelector:
|
|
matchLabels:
|
|
app: frontend
|
|
policyTypes:
|
|
- Egress
|
|
egress:
|
|
- to:
|
|
- namespaceSelector:
|
|
matchLabels:
|
|
kubernetes.io/metadata.name: payments-mesh
|
|
podSelector:
|
|
matchLabels:
|
|
app: payments-api
|
|
ports:
|
|
- protocol: TCP
|
|
port: 8080
|
|
- to:
|
|
- namespaceSelector:
|
|
matchLabels:
|
|
kubernetes.io/metadata.name: kube-system
|
|
podSelector:
|
|
matchLabels:
|
|
k8s-app: kube-dns
|
|
ports:
|
|
- port: 53
|
|
protocol: TCP
|
|
- port: 53
|
|
protocol: UDP
|
|
|