2dd5e318d7
Allow Web SMTP egress on TCP 587 and reuse the saved channel password only when connection settings match. Ref: IT-1601
115 lines
3.0 KiB
YAML
115 lines
3.0 KiB
YAML
apiVersion: networking.k8s.io/v1
|
|
kind: NetworkPolicy
|
|
metadata:
|
|
name: production-to-rabbitmq
|
|
namespace: invemory-production
|
|
spec:
|
|
podSelector:
|
|
matchLabels:
|
|
app.kubernetes.io/instance: invemory-production
|
|
matchExpressions:
|
|
- key: app.kubernetes.io/component
|
|
operator: In
|
|
values: [api, worker]
|
|
policyTypes: [Egress]
|
|
egress:
|
|
- to:
|
|
- namespaceSelector:
|
|
matchLabels:
|
|
kubernetes.io/metadata.name: shared-notification
|
|
podSelector:
|
|
matchLabels:
|
|
app.kubernetes.io/component: rabbitmq
|
|
app.kubernetes.io/name: hrynco-shared-notification
|
|
app.kubernetes.io/managed-by: hrynco-shared-notification
|
|
ports:
|
|
- protocol: TCP
|
|
port: 5672
|
|
---
|
|
apiVersion: networking.k8s.io/v1
|
|
kind: NetworkPolicy
|
|
metadata:
|
|
name: rabbitmq-from-invemory-production
|
|
namespace: shared-notification
|
|
spec:
|
|
podSelector:
|
|
matchLabels:
|
|
app.kubernetes.io/component: rabbitmq
|
|
app.kubernetes.io/name: hrynco-shared-notification
|
|
app.kubernetes.io/managed-by: hrynco-shared-notification
|
|
policyTypes: [Ingress]
|
|
ingress:
|
|
- from:
|
|
- namespaceSelector:
|
|
matchLabels:
|
|
kubernetes.io/metadata.name: invemory-production
|
|
podSelector:
|
|
matchLabels:
|
|
app.kubernetes.io/instance: invemory-production
|
|
invemory.com/environment: production
|
|
matchExpressions:
|
|
- key: app.kubernetes.io/component
|
|
operator: In
|
|
values: [api, worker]
|
|
ports:
|
|
- protocol: TCP
|
|
port: 5672
|
|
---
|
|
apiVersion: networking.k8s.io/v1
|
|
kind: NetworkPolicy
|
|
metadata:
|
|
name: worker-to-external-smtp
|
|
namespace: shared-notification
|
|
spec:
|
|
podSelector:
|
|
matchLabels:
|
|
app.kubernetes.io/component: worker
|
|
app.kubernetes.io/name: hrynco-shared-notification
|
|
app.kubernetes.io/managed-by: hrynco-shared-notification
|
|
policyTypes: [Egress]
|
|
egress:
|
|
- to:
|
|
- ipBlock:
|
|
cidr: 0.0.0.0/0
|
|
except:
|
|
- 10.0.0.0/8
|
|
- 100.64.0.0/10
|
|
- 127.0.0.0/8
|
|
- 169.254.0.0/16
|
|
- 172.16.0.0/12
|
|
- 192.168.0.0/16
|
|
- 224.0.0.0/4
|
|
- 240.0.0.0/4
|
|
ports:
|
|
- protocol: TCP
|
|
port: 587
|
|
---
|
|
apiVersion: networking.k8s.io/v1
|
|
kind: NetworkPolicy
|
|
metadata:
|
|
name: web-to-external-smtp
|
|
namespace: shared-notification
|
|
spec:
|
|
podSelector:
|
|
matchLabels:
|
|
app.kubernetes.io/component: web
|
|
app.kubernetes.io/name: hrynco-shared-notification
|
|
app.kubernetes.io/managed-by: hrynco-shared-notification
|
|
policyTypes: [Egress]
|
|
egress:
|
|
- to:
|
|
- ipBlock:
|
|
cidr: 0.0.0.0/0
|
|
except:
|
|
- 10.0.0.0/8
|
|
- 100.64.0.0/10
|
|
- 127.0.0.0/8
|
|
- 169.254.0.0/16
|
|
- 172.16.0.0/12
|
|
- 192.168.0.0/16
|
|
- 224.0.0.0/4
|
|
- 240.0.0.0/4
|
|
ports:
|
|
- protocol: TCP
|
|
port: 587
|