42 lines
884 B
YAML
42 lines
884 B
YAML
apiVersion: networking.k8s.io/v1
|
|
kind: NetworkPolicy
|
|
metadata:
|
|
name: cnpg
|
|
namespace: cnpg-system
|
|
spec:
|
|
egress:
|
|
- ports:
|
|
- port: 53
|
|
protocol: UDP
|
|
- port: 53
|
|
protocol: TCP
|
|
to:
|
|
- namespaceSelector:
|
|
matchLabels:
|
|
kubernetes.io/metadata.name: kube-system
|
|
podSelector:
|
|
matchLabels:
|
|
k8s-app: kube-dns
|
|
- ports:
|
|
- port: 6443
|
|
protocol: TCP
|
|
- ports:
|
|
- port: 8000
|
|
protocol: TCP
|
|
to:
|
|
- namespaceSelector: {}
|
|
podSelector:
|
|
matchExpressions:
|
|
- key: cnpg.io/cluster
|
|
operator: Exists
|
|
ingress:
|
|
- ports:
|
|
- port: 9443
|
|
protocol: TCP
|
|
podSelector:
|
|
matchLabels:
|
|
app.kubernetes.io/name: cloudnative-pg
|
|
policyTypes:
|
|
- Ingress
|
|
- Egress
|