26 lines
498 B
YAML
26 lines
498 B
YAML
# Allow any pod in this namespace to connect to MongoDB and
|
|
# allow cluster members to talk to eachother
|
|
apiVersion: networking.k8s.io/v1
|
|
kind: NetworkPolicy
|
|
metadata:
|
|
name: mongodb-operator
|
|
spec:
|
|
podSelector:
|
|
matchLabels:
|
|
app: mongodb-svc
|
|
policyTypes:
|
|
- Ingress
|
|
- Egress
|
|
ingress:
|
|
- from:
|
|
- podSelector: {}
|
|
ports:
|
|
- port: 27017
|
|
egress:
|
|
- to:
|
|
- podSelector:
|
|
matchLabels:
|
|
app: mongodb-svc
|
|
ports:
|
|
- port: 27017
|