29 lines
539 B
YAML
29 lines
539 B
YAML
apiVersion: networking.k8s.io/v1
|
|
kind: NetworkPolicy
|
|
metadata:
|
|
name: app-control
|
|
namespace: database
|
|
spec:
|
|
policyTypes:
|
|
- Ingress
|
|
- Egress
|
|
podSelector:
|
|
matchLabels:
|
|
app: db
|
|
ingress:
|
|
- from:
|
|
- nameSpaceSelector:
|
|
matchLabels:
|
|
kubernetes.io/metadata: payments
|
|
podSelector:
|
|
matchLabels:
|
|
app: payments
|
|
ports:
|
|
- port: 5432
|
|
protocol: TCP
|
|
egress:
|
|
- ports:
|
|
- protocol: TCP
|
|
port: 53
|
|
- protocol: UDP
|
|
port: 53 |