Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/onesoft-sudo/sudobot/llms.txt

Use this file to discover all available pages before exploring further.

SudoBot ships with Kubernetes manifests in the kubernetes/ directory. These cover a full production deployment: the bot, a PostgreSQL StatefulSet, PersistentVolumes, Services, and a Secrets resource for credentials.

Included manifests

FileResourceDescription
sudobot-deployment.ymlDeploymentSudoBot bot process
sudobot-service.ymlServiceExposes the SudoBot API port
sudobot-pv.ymlPersistentVolumeStorage for bot data
sudobot-pvc.ymlPersistentVolumeClaimClaim for bot storage
sudobot-secrets.ymlSecretDiscord token, DB password, JWT secret
postgres-statefulset.ymlStatefulSetPostgreSQL database
postgres-service.ymlServiceInternal DB service
postgres-pv.ymlPersistentVolumeStorage for PostgreSQL
postgres-pvc.ymlPersistentVolumeClaimClaim for PostgreSQL storage

Setup

1

Create the Secrets resource

Edit kubernetes/sudobot-secrets.yml and fill in your base64-encoded credentials:
# Encode your values
echo -n "your-discord-token" | base64
echo -n "your-client-id" | base64
echo -n "your-home-guild-id" | base64
echo -n "your-jwt-secret" | base64
echo -n "your-db-password" | base64
The secrets file maps to these keys used by the Deployment: discord_token, client_id, home_guild_id, jwt_secret, db_password.Apply the secrets:
kubectl apply -f kubernetes/sudobot-secrets.yml
2

Create PersistentVolumes and Claims

kubectl apply -f kubernetes/postgres-pv.yml
kubectl apply -f kubernetes/postgres-pvc.yml
kubectl apply -f kubernetes/sudobot-pv.yml
kubectl apply -f kubernetes/sudobot-pvc.yml
3

Deploy PostgreSQL

kubectl apply -f kubernetes/postgres-statefulset.yml
kubectl apply -f kubernetes/postgres-service.yml
Wait for PostgreSQL to be ready:
kubectl wait --for=condition=ready pod -l app=postgres --timeout=60s
4

Deploy SudoBot

kubectl apply -f kubernetes/sudobot-deployment.yml
kubectl apply -f kubernetes/sudobot-service.yml
5

Verify the deployment

kubectl get pods
kubectl logs deployment/sudobot

Resource limits

The default Deployment sets these resource limits:
resources:
  limits:
    memory: "2Gi"
    cpu: "500m"
Adjust these in sudobot-deployment.yml based on your cluster capacity and server load.

Environment variables in the Deployment

The Deployment reads sensitive values from the sudobot Secret and constructs DB_URL dynamically using Kubernetes service environment variables:
env:
  - name: DB_URL
    value: postgresql://postgres:$(DB_PASSWORD)@$(POSTGRES_SERVICE_SERVICE_HOST):$(POSTGRES_SERVICE_SERVICE_PORT)/sudobot
  - name: SUDO_PREFIX
    value: /data
  - name: NODE_ENV
    value: production
The bot data directory is mounted at /data from the PersistentVolumeClaim.
For production clusters, consider using an external managed PostgreSQL service (e.g. AWS RDS, Cloud SQL, or Neon) instead of the in-cluster StatefulSet for better reliability and backup support.

Build docs developers (and LLMs) love