No description
| .gitignore | ||
| castopod-deployment.yaml | ||
| castopod-service.yaml | ||
| configmap.yaml | ||
| ingress.yaml | ||
| namespace.yaml | ||
| README.md | ||
| secret.yaml | ||
Castopod on Kubernetes
Kubernetes manifests for running Castopod with horizontal scaling support.
Architecture
- Castopod app — scales horizontally (2–10 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
kubectlconfigured- 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.comwith your actual domain - Set
ingressClassNameto match your ingress controller - Uncomment the
cert-manager.io/cluster-issuerannotation 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.