feat: 🎉 Initial commit to Nyeki's Git.
This commit is contained in:
+32
-14
@@ -1,18 +1,19 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
kind: StatefulSet
|
||||
metadata:
|
||||
name: discord-bot
|
||||
name: bot
|
||||
labels:
|
||||
app: discord-bot
|
||||
app: bot
|
||||
spec:
|
||||
replicas: 11
|
||||
serviceName: "bot-headless"
|
||||
replicas: 2
|
||||
selector:
|
||||
matchLabels:
|
||||
app: discord-bot
|
||||
app: bot
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: discord-bot
|
||||
app: bot
|
||||
spec:
|
||||
containers:
|
||||
- name: bot
|
||||
@@ -20,16 +21,12 @@ spec:
|
||||
env:
|
||||
- name: IS_DEBUG
|
||||
value: "false"
|
||||
- name: SHARD_NAME
|
||||
- name: SHARD_ID
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: metadata.name
|
||||
fieldPath: metadata.labels['apps.kubernetes.io/pod-index']
|
||||
- name: TOTAL_SHARDS
|
||||
value: "11"
|
||||
- name: REDIS_HOST
|
||||
value: "redis"
|
||||
- name: REDIS_PORT
|
||||
value: "6379"
|
||||
value: "2" # Adjust this manually or with a ConfigMap
|
||||
resources:
|
||||
limits:
|
||||
cpu: "500m"
|
||||
@@ -37,4 +34,25 @@ spec:
|
||||
requests:
|
||||
cpu: "250m"
|
||||
memory: "256Mi"
|
||||
restartPolicy: Always
|
||||
imagePullSecrets:
|
||||
- name: regcred
|
||||
volumeClaimTemplates:
|
||||
- metadata:
|
||||
name: bot-storage
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce # Ensures only one node can mount the volume at a time
|
||||
resources:
|
||||
requests:
|
||||
storage: 1Gi # Defines the storage size
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: bot-headless
|
||||
labels:
|
||||
app: bot
|
||||
spec:
|
||||
clusterIP: None
|
||||
selector:
|
||||
app: bot
|
||||
|
||||
@@ -1,57 +0,0 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: citus-coordinator
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: citus
|
||||
role: coordinator
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: citus
|
||||
role: coordinator
|
||||
spec:
|
||||
containers:
|
||||
- name: coordinator
|
||||
image: citusdata/citus:latest
|
||||
env:
|
||||
- name: POSTGRES_DB
|
||||
value: "payphone"
|
||||
- name: POSTGRES_USER
|
||||
value: "payphone"
|
||||
- name: POSTGRES_PASSWORD
|
||||
value: "payphone"
|
||||
volumeMounts:
|
||||
- name: citus-coordinator-storage
|
||||
mountPath: /var/lib/postgresql/data
|
||||
ports:
|
||||
- containerPort: 5432
|
||||
resources:
|
||||
requests:
|
||||
memory: "2Gi"
|
||||
cpu: "1"
|
||||
limits:
|
||||
memory: "2Gi"
|
||||
cpu: "2"
|
||||
volumes:
|
||||
- name: citus-coordinator-storage
|
||||
persistentVolumeClaim:
|
||||
claimName: citus-coordinator-pvc
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: citus-coordinator
|
||||
spec:
|
||||
selector:
|
||||
app: citus
|
||||
role: coordinator
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 5432
|
||||
targetPort: 5432
|
||||
type: ClusterIP
|
||||
@@ -1,22 +0,0 @@
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: citus-coordinator-pvc
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 10Gi # Change this size as needed
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: citus-worker-pvc
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 10Gi # Change this size as needed
|
||||
@@ -1,22 +1,34 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: citus-headless
|
||||
spec:
|
||||
selector:
|
||||
app: citus
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 5432
|
||||
targetPort: 5432
|
||||
clusterIP: None # Headless service for direct pod access
|
||||
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: StatefulSet
|
||||
metadata:
|
||||
name: citus-worker
|
||||
name: citus
|
||||
spec:
|
||||
replicas: 2 # Increase as needed for more workers
|
||||
serviceName: citus-headless
|
||||
replicas: 3 # Set the desired number of replicas
|
||||
selector:
|
||||
matchLabels:
|
||||
app: citus
|
||||
role: worker
|
||||
serviceName: citus-worker-headless
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: citus
|
||||
role: worker
|
||||
spec:
|
||||
containers:
|
||||
- name: worker
|
||||
- name: citus
|
||||
image: citusdata/citus:latest
|
||||
env:
|
||||
- name: POSTGRES_DB
|
||||
@@ -27,37 +39,15 @@ spec:
|
||||
value: "payphone"
|
||||
ports:
|
||||
- containerPort: 5432
|
||||
resources:
|
||||
requests:
|
||||
memory: "2Gi"
|
||||
cpu: "1"
|
||||
limits:
|
||||
memory: "2Gi"
|
||||
cpu: "2"
|
||||
volumeMounts:
|
||||
- name: citus-worker-storage
|
||||
- name: citus-storage
|
||||
mountPath: /var/lib/postgresql/data
|
||||
volumeClaimTemplates:
|
||||
- metadata:
|
||||
name: citus-worker-storage
|
||||
name: citus-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
|
||||
storage: 5Gi # Size for each pod's storage
|
||||
Reference in New Issue
Block a user