Files
monitoring-tg/k8s/server-deployment.yaml
Grendgi a924cd832b
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 45s
Store monitoring TG media in MinIO
2026-06-05 16:58:08 +03:00

140 lines
3.7 KiB
YAML

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: monitoring-tg-data
namespace: monitoring-tg
spec:
accessModes: ["ReadWriteOnce"]
storageClassName: local-path
resources:
requests:
storage: 10Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: monitoring-tg-server
namespace: monitoring-tg
spec:
replicas: 1
strategy:
type: Recreate
selector:
matchLabels:
app: monitoring-tg-server
template:
metadata:
labels:
app: monitoring-tg-server
spec:
hostAliases:
- ip: "77.105.173.42"
hostnames:
- "s3-minio.estateliga.work"
terminationGracePeriodSeconds: 20
securityContext:
fsGroup: 1000
initContainers:
- name: monitoring-tg-migrate
image: localhost:30300/admin/monitoring-tg-server:latest
command: ["alembic"]
args: ["upgrade", "head"]
envFrom:
- configMapRef:
name: monitoring-tg-config
- secretRef:
name: monitoring-tg-secrets
containers:
- name: monitoring-tg-server
image: localhost:30300/admin/monitoring-tg-server:latest
command: ["/usr/local/bin/monitoring-tg-server"]
ports:
- containerPort: 8000
envFrom:
- configMapRef:
name: monitoring-tg-config
- secretRef:
name: monitoring-tg-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: 256Mi
limits:
cpu: 800m
memory: 1Gi
- name: monitoring-tg-telegram
image: localhost:30300/admin/monitoring-tg-server:latest
command: ["python", "-m", "parser_bot.main"]
envFrom:
- configMapRef:
name: monitoring-tg-config
- secretRef:
name: monitoring-tg-secrets
env:
- name: API_PORT
value: "8001"
volumeMounts:
- name: app-data
mountPath: /data
startupProbe:
httpGet:
path: /healthz
port: 8001
periodSeconds: 5
failureThreshold: 30
livenessProbe:
httpGet:
path: /healthz
port: 8001
periodSeconds: 10
readinessProbe:
httpGet:
path: /healthz
port: 8001
periodSeconds: 5
resources:
requests:
cpu: 80m
memory: 256Mi
limits:
cpu: 800m
memory: 1Gi
- name: monitoring-tg-classifier
image: localhost:30300/admin/monitoring-tg-server:latest
command: ["/usr/local/bin/monitoring-tg-classifier"]
envFrom:
- configMapRef:
name: monitoring-tg-config
- secretRef:
name: monitoring-tg-secrets
resources:
requests:
cpu: 50m
memory: 96Mi
limits:
cpu: 500m
memory: 512Mi
volumes:
- name: app-data
persistentVolumeClaim:
claimName: monitoring-tg-data