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 selector: matchLabels: app: monitoring-tg-server template: metadata: labels: app: monitoring-tg-server spec: 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