feat(bot): 🚧 Start migrating to k8s.

This commit is contained in:
Nyeki.py
2024-10-30 15:38:00 -03:00
parent 01c4a95ff3
commit 345e44137a
17 changed files with 304 additions and 40 deletions
+63
View File
@@ -0,0 +1,63 @@
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: citus-worker
spec:
replicas: 2 # Increase as needed for more workers
selector:
matchLabels:
app: citus
role: worker
serviceName: citus-worker-headless
template:
metadata:
labels:
app: citus
role: worker
spec:
containers:
- name: worker
image: citusdata/citus:latest
env:
- name: POSTGRES_DB
value: "payphone"
- name: POSTGRES_USER
value: "payphone"
- name: POSTGRES_PASSWORD
value: "payphone"
ports:
- containerPort: 5432
resources:
requests:
memory: "2Gi"
cpu: "1"
limits:
memory: "2Gi"
cpu: "2"
volumeMounts:
- name: citus-worker-storage
mountPath: /var/lib/postgresql/data
volumeClaimTemplates:
- metadata:
name: citus-worker-storage
spec:
accessModes: [ "ReadWriteOnce" ]
storageClassName: "standard" # Update based on your storage class
resources:
requests:
storage: 5Gi # Size per worker
---
apiVersion: v1
kind: Service
metadata:
name: citus-worker-headless
spec:
selector:
app: citus
role: worker
ports:
- protocol: TCP
port: 5432
targetPort: 5432
clusterIP: None # Defines the service as headless, allowing direct pod DNS entries