Co-authored-by: denis.patrakeev <denis.patrakeev@avroid.tech> Reviewed-on: https://git.avroid.tech/K8s/k8s-configs/pulls/105
51 lines
1.1 KiB
YAML
51 lines
1.1 KiB
YAML
---
|
|
apiVersion: networking.k8s.io/v1
|
|
kind: NetworkPolicy
|
|
metadata:
|
|
name: cloud-prometheus-in
|
|
namespace: cloud-prod
|
|
labels:
|
|
app.kubernetes.io/managed-by: manually
|
|
spec:
|
|
podSelector:
|
|
matchLabels:
|
|
app.kubernetes.io/name: prometheus
|
|
policyTypes:
|
|
- Ingress
|
|
ingress:
|
|
- from:
|
|
- namespaceSelector:
|
|
matchLabels:
|
|
kubernetes.io/metadata.name: ingress-nginx
|
|
---
|
|
apiVersion: networking.k8s.io/v1
|
|
kind: NetworkPolicy
|
|
metadata:
|
|
name: cloud-prometheus-out
|
|
namespace: cloud-prod
|
|
labels:
|
|
app.kubernetes.io/managed-by: manually
|
|
spec:
|
|
podSelector:
|
|
matchLabels:
|
|
app.kubernetes.io/name: prometheus
|
|
policyTypes:
|
|
- Egress
|
|
ingress: []
|
|
egress:
|
|
- ports:
|
|
- port: 443
|
|
protocol: TCP
|
|
- port: 80
|
|
protocol: TCP
|
|
- port: 8008
|
|
protocol: TCP
|
|
- to:
|
|
- podSelector:
|
|
matchLabels:
|
|
app.kubernetes.io/name: prometheus-redis-exporter
|
|
- to:
|
|
- podSelector:
|
|
matchLabels:
|
|
app: prometheus-postgres-exporter
|