No description
Find a file
Primož Ajdišek 12f90e3680 first commit
2026-07-08 18:32:43 +00:00
.gitignore first commit 2026-07-08 18:32:43 +00:00
castopod-deployment.yaml first commit 2026-07-08 18:32:43 +00:00
castopod-service.yaml first commit 2026-07-08 18:32:43 +00:00
configmap.yaml first commit 2026-07-08 18:32:43 +00:00
ingress.yaml first commit 2026-07-08 18:32:43 +00:00
namespace.yaml first commit 2026-07-08 18:32:43 +00:00
README.md first commit 2026-07-08 18:32:43 +00:00
secret.yaml first commit 2026-07-08 18:32:43 +00:00

Castopod on Kubernetes

Kubernetes manifests for running Castopod with horizontal scaling support.

Architecture

  • Castopod app — scales horizontally (210 pods via HPA) since media is on S3 and sessions/cache are in Redis/Valkey
  • MariaDB and Redis/Valkey are expected to already exist in your cluster or as external services

Prerequisites

  • Kubernetes cluster
  • kubectl configured
  • An existing MySQL/MariaDB instance
  • An existing Redis or Valkey instance
  • An S3-compatible bucket for media storage
  • An ingress controller (nginx shown, adjust annotations as needed)
  • (Optional) cert-manager for automatic TLS

Usage

1. Configure secrets

Copy secret.yaml to secret.local.yaml (git-ignored) and fill in your values:

cp secret.yaml secret.local.yaml

Edit secret.local.yaml:

stringData:
  db-password: "your-db-password"
  redis-password: "your-redis-password"
  analytics-salt: "a-random-string"
  s3-key: "your-s3-access-key"
  s3-secret: "your-s3-secret-key"
  smtp-password: "your-smtp-password"

2. Configure the app

Edit configmap.yaml and replace all placeholder values:

Key Description
CP_BASEURL Public URL of your Castopod instance
CP_DATABASE_HOSTNAME Hostname of your MySQL/MariaDB service
CP_DATABASE_NAME / CP_DATABASE_USERNAME DB name and user
CP_REDIS_HOST Hostname of your Redis/Valkey service
CP_MEDIA_S3_ENDPOINT S3-compatible endpoint URL
CP_MEDIA_S3_REGION S3 region
CP_MEDIA_S3_BUCKET Bucket name
CP_MEDIA_BASEURL Public base URL for served media
CP_EMAIL_FROM Sender address for outgoing mail
CP_EMAIL_SMTP_HOST SMTP server hostname
CP_EMAIL_SMTP_USERNAME SMTP username

3. Configure ingress

Edit ingress.yaml:

  • Replace your.domain.com with your actual domain
  • Set ingressClassName to match your ingress controller
  • Uncomment the cert-manager.io/cluster-issuer annotation if using cert-manager

4. Apply

kubectl apply -f secret.local.yaml
kubectl apply -f namespace.yaml -f configmap.yaml -f castopod-deployment.yaml -f castopod-service.yaml -f ingress.yaml

Scaling

The Castopod deployment can be scaled horizontally since media is on S3 and sessions/cache are in Redis/Valkey. Adjust replicas in castopod-deployment.yaml as needed.