64 lines
1.5 KiB
YAML
64 lines
1.5 KiB
YAML
apiVersion: apps/v1
|
|
kind: StatefulSet
|
|
metadata:
|
|
name: bot
|
|
labels:
|
|
app: bot
|
|
spec:
|
|
serviceName: "bot-headless"
|
|
replicas: 30 # Adjust this manually together with env.TOTAL_SHARDS down below.
|
|
selector:
|
|
matchLabels:
|
|
app: bot
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: bot
|
|
spec:
|
|
containers:
|
|
- name: bot
|
|
image: registry.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: "30" # 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
|