Installation
Prerequisites
- Kubernetes cluster (1.28+)
- PostgreSQL database
- Kafka cluster (or Strimzi operator)
Quick Install
Deploy Senren to your Kubernetes cluster:
# Install CRDs
kubectl apply -f https://raw.githubusercontent.com/pydantic/senren/main/deploy/crds/platform.yaml
kubectl apply -f https://raw.githubusercontent.com/pydantic/senren/main/deploy/crds/redis.yaml
# Deploy control plane
kubectl apply -f https://raw.githubusercontent.com/pydantic/senren/main/deploy/k8s/control-plane/
# Deploy regional plane (per region)
kubectl apply -f https://raw.githubusercontent.com/pydantic/senren/main/deploy/k8s/regional-plane/
# Deploy controllers
kubectl apply -f https://raw.githubusercontent.com/pydantic/senren/main/deploy/k8s/controllers/
Configuration
Control Plane
The control plane requires PostgreSQL and Kafka configuration:
apiVersion: apps/v1
kind: Deployment
metadata:
name: senren-api
spec:
template:
spec:
containers:
- name: senren-api
image: senren-api:latest
env:
- name: MODE
value: "control"
- name: DATABASE_URL
value: "postgres://user:pass@postgres:5432/senren"
- name: KAFKA_BOOTSTRAP_SERVERS
value: "kafka:9092"
- name: KAFKA_TOPIC_PREFIX
value: "prod"
Regional Plane
Each regional cluster needs a regional plane deployment:
apiVersion: apps/v1
kind: Deployment
metadata:
name: regional-plane
spec:
template:
spec:
containers:
- name: regional-plane
image: senren-api:latest
env:
- name: MODE
value: "regional"
- name: KAFKA_BOOTSTRAP_SERVERS
value: "kafka:9092"
- name: KAFKA_TOPIC_PREFIX
value: "prod"
- name: K8S_NAMESPACE
value: "default" # or watch all namespaces
Controllers
Controllers provision actual infrastructure:
apiVersion: apps/v1
kind: Deployment
metadata:
name: senren-controller
spec:
template:
spec:
serviceAccountName: senren-controller
containers:
- name: controller
image: senren-controller:latest
env:
- name: RECONCILE_INTERVAL_SECS
value: "15" # Check resources every 15 seconds
Verify Installation
# Check control plane
kubectl get pods -l app=senren-api
# Check regional plane
kubectl get pods -l app=regional-plane
# Check controllers
kubectl get pods -l app=senren-controller
# Verify CRDs are installed
kubectl get crds | grep senren.ai