Add monitoring PF service

This commit is contained in:
Grendgi
2026-06-04 14:55:41 +03:00
commit dd3edd7088
41 changed files with 3194 additions and 0 deletions

11
k8s/configmap.yaml Normal file
View File

@@ -0,0 +1,11 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: monitoring-pf-config
namespace: monitoring-pf
data:
WEB_HOST: "0.0.0.0"
WEB_PORT: "8000"
PUBLIC_BASE_PATH: "/api/monitoring-pf"
DATABASE_URL: "sqlite:////data/monitor.db"
SCRAPE_INTERVAL_HOURS: "4"

11
k8s/kustomization.yaml Normal file
View File

@@ -0,0 +1,11 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: monitoring-pf
resources:
- namespace.yaml
- configmap.yaml
- secrets.yaml
- server-deployment.yaml
- server-service.yaml

4
k8s/namespace.yaml Normal file
View File

@@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: monitoring-pf

10
k8s/secrets.yaml Normal file
View File

@@ -0,0 +1,10 @@
apiVersion: v1
kind: Secret
metadata:
name: monitoring-pf-secrets
namespace: monitoring-pf
type: Opaque
stringData:
TG_BOT_TOKEN: "CHANGE_ME"
ADMIN_CHAT_ID: ""
ADMIN_PIN: "CHANGE_ME"

107
k8s/server-deployment.yaml Normal file
View File

@@ -0,0 +1,107 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: monitoring-pf-data
namespace: monitoring-pf
spec:
accessModes: ["ReadWriteOnce"]
storageClassName: local-path
resources:
requests:
storage: 5Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: monitoring-pf-server
namespace: monitoring-pf
spec:
replicas: 1
selector:
matchLabels:
app: monitoring-pf-server
template:
metadata:
labels:
app: monitoring-pf-server
spec:
terminationGracePeriodSeconds: 20
securityContext:
fsGroup: 1000
containers:
- name: web
image: localhost:30300/admin/monitoring-pf-server:latest
command: ["python", "run_web.py"]
ports:
- containerPort: 8000
envFrom:
- configMapRef:
name: monitoring-pf-config
- secretRef:
name: monitoring-pf-secrets
volumeMounts:
- name: app-data
mountPath: /data
startupProbe:
httpGet:
path: /healthz
port: 8000
periodSeconds: 5
failureThreshold: 30
livenessProbe:
httpGet:
path: /healthz
port: 8000
periodSeconds: 10
readinessProbe:
httpGet:
path: /healthz
port: 8000
periodSeconds: 5
resources:
requests:
cpu: 100m
memory: 128Mi
limits:
cpu: 800m
memory: 768Mi
- name: bot
image: localhost:30300/admin/monitoring-pf-server:latest
command: ["python", "-m", "app.bot"]
envFrom:
- configMapRef:
name: monitoring-pf-config
- secretRef:
name: monitoring-pf-secrets
volumeMounts:
- name: app-data
mountPath: /data
resources:
requests:
cpu: 25m
memory: 96Mi
limits:
cpu: 300m
memory: 384Mi
- name: scheduler
image: localhost:30300/admin/monitoring-pf-server:latest
command: ["python", "-m", "app.scheduler"]
envFrom:
- configMapRef:
name: monitoring-pf-config
- secretRef:
name: monitoring-pf-secrets
volumeMounts:
- name: app-data
mountPath: /data
resources:
requests:
cpu: 50m
memory: 128Mi
limits:
cpu: 600m
memory: 768Mi
volumes:
- name: app-data
persistentVolumeClaim:
claimName: monitoring-pf-data

18
k8s/server-service.yaml Normal file
View File

@@ -0,0 +1,18 @@
apiVersion: v1
kind: Service
metadata:
name: monitoring-pf-server
namespace: monitoring-pf
annotations:
portal.estateliga.work/enabled: "true"
portal.estateliga.work/name: "Мониторинг PF"
portal.estateliga.work/description: "Мониторинг объявлений PropertyFinder/Bayut по DLD Permit"
portal.estateliga.work/icon: "pulse"
portal.estateliga.work/path: "/api/monitoring-pf"
portal.estateliga.work/code: "monitoring_pf"
spec:
selector:
app: monitoring-pf-server
ports:
- port: 80
targetPort: 8000