feat(shard): Lots of code.

This commit is contained in:
Nyeki.py
2024-11-15 23:24:11 -03:00
parent d9d752c730
commit 6377cb66c2
35 changed files with 2546 additions and 105 deletions
+63
View File
@@ -0,0 +1,63 @@
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: bot
labels:
app: bot
spec:
serviceName: "bot-headless"
replicas: 1 # Adjust this manually together with env.TOTAL_SHARDS down below.
selector:
matchLabels:
app: bot
template:
metadata:
labels:
app: bot
spec:
containers:
- name: bot
image: git.nyeki.dev/payphone/payphone-shard:latest
imagePullPolicy: "Always"
envFrom:
- configMapRef:
name: bot-config
- secretRef:
name: bot-secrets
env:
- name: SHARD_ID
valueFrom:
fieldRef:
fieldPath: metadata.labels['apps.kubernetes.io/pod-index']
- name: SHARD_COUNT
value: "1" # Adjust this manually together with spec.replicas up at the top.
resources:
limits:
cpu: "1000m"
memory: "1Gi"
requests:
cpu: "250m"
memory: "256Mi"
imagePullSecrets:
- name: regcred
volumeClaimTemplates:
- metadata:
name: bot-storage
spec:
accessModes:
- ReadWriteOnce # Ensures only one node can mount the volume at a time
storageClassName: openebs-jiva-csi-default
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