Files
payphone/k8s/bot.yml
T

65 lines
1.5 KiB
YAML

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:latest
imagePullPolicy: "Always"
envFrom:
- configMapRef:
name: bot-config
- secretRef:
name: bot-secrets
env:
- name: IS_DEBUG
value: "false"
- 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
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