Kubernetes deployment for curatedotfun using Helm charts. This repository offers a hosted service of curatedotfun bots, each with their own PostgreSQL database.
The deployment architecture consists of multiple bot instances, each with its own PostgreSQL database. Each bot is exposed via an Ingress resource.
flowchart TD
subgraph "Kubernetes Cluster"
subgraph "Bot 1 Namespace"
B1[Bot 1 Deployment] --> BS1[Bot 1 Service]
BS1 --> I1[Ingress]
I1 --> E1[External Access]
B1 --> P1[PostgreSQL 1]
P1 --> PS1[PostgreSQL 1 Service]
CM1[ConfigMap] --> B1
S1[Secrets] --> B1
S1 --> P1
end
subgraph "Bot 2 Namespace"
B2[Bot 2 Deployment] --> BS2[Bot 2 Service]
BS2 --> I2[Ingress]
I2 --> E2[External Access]
B2 --> P2[PostgreSQL 2]
P2 --> PS2[PostgreSQL 2 Service]
CM2[ConfigMap] --> B2
S2[Secrets] --> B2
S2 --> P2
end
end
Before you begin, you'll need to set up your local environment:
-
Install either:
- Docker Desktop with Kubernetes enabled, or
- Orbstack (a lightweight alternative)
-
Install command-line tools:
brew install kubectl helm
-
Install Docker Desktop with Kubernetes enabled
-
Install command-line tools:
choco install kubernetes-cli choco install kubernetes-helm
The deployment is configured via the values.yaml
file. This file contains the configuration for all bot instances and their associated PostgreSQL databases.
Each bot is configured in the bots
array in the values.yaml
file:
bots:
- name: bot1
domain: bot1.example.com
postgresUser: botuser1
postgresDB: botdb1
# dbPassword and encryptionKey are auto-generated
You can add as many bots as needed by adding more entries to the bots
array.
Default configuration for all bots is specified in the botDefaults
section:
botDefaults:
bot:
image: your-registry/bot-image:latest
replicaCount: 1
servicePort: 8080
resources:
requests:
cpu: 200m
memory: 512Mi
limits:
cpu: 500m
memory: 1Gi
To deploy the Helm chart:
helm install curatedotfun ./
To upgrade an existing deployment (when you've made changes to the configuration or when a new version is available):
helm upgrade curatedotfun ./
This allows you to update your deployment without downtime, applying only the changes that are needed while preserving the state of your application.
To uninstall the deployment:
helm uninstall curatedotfun
Each bot is exposed via an Ingress resource at the domain specified in the bots
array. For example, if you have a bot with domain: bot1.example.com
, you can access it at http://bot1.example.com
.
Make sure your DNS is configured to point to your Kubernetes cluster's ingress controller.
To check the status of your pods:
kubectl get pods
To view the logs of a specific pod:
kubectl logs <pod-name>
To check the status of your ingress resources:
kubectl get ingress
- Pods in CrashLoopBackOff state: Check the pod logs for errors.
- Database connection issues: Check the pod logs for database connection errors.
- Ingress not working: Ensure your ingress controller is properly configured and your DNS is pointing to the correct IP address.