At a glance
| What | Value |
|---|---|
| Good for | Teams that already run Kubernetes |
| Needs | Kubernetes 1.25+, Helm 3, PostgreSQL 14+ with pgvector, an ingress controller |
| Time to deploy | About 20 minutes with an existing cluster and database |
| Cost | Your cluster and database. Palace needs about 512 MiB requested per replica |
The same setup is in the plain kubectl guide as plain files for kubectl apply -k.
What this sets up
- A Deployment (2 replicas) as non-root UID 10001, read-only root filesystem, all capabilities dropped,
RuntimeDefaultseccomp, no service account token. Readiness on/readyz, liveness on/healthz. - A Service, and an Ingress when enabled. The Ingress sends
/metricsand/bootstrapto a tiny backend that answers 404, so neither is reachable from outside. - A PodDisruptionBudget (keeps one replica up during node drains).
- A NetworkPolicy when enabled: only your ingress controller's namespace (and sources you add) can reach port 8080.
Steps
Prepare the database
Create a database named palace, then run db-setup.sql ↗ once as the database admin:
APP_PW=$(openssl rand -hex 24)
psql "postgres://ADMIN:PASSWORD@HOST:5432/palace?sslmode=require" \
-v app_password="$APP_PW" -f db-setup.sqlIt creates the vector and pgcrypto extensions and palace_app, the role Palace connects as. palace_app cannot bypass row-level security, so tenant isolation holds. Never give Palace the admin user.
Create the secret
kubectl create namespace palace
kubectl -n palace create secret generic palace-server \
--from-literal=database-url="postgres://palace_app:$APP_PW@HOST:5432/palace?sslmode=verify-full&sslrootcert=/etc/palace/db-ca/ca.crt" \
--from-literal=license-key='your-license-key' \
--from-literal=jwt-secret="$(openssl rand -hex 32)" \
--from-literal=bootstrap-token="$(openssl rand -hex 24)"
# Your database's CA certificate, for sslmode=verify-full:
kubectl -n palace create configmap palace-db-ca --from-file=ca.crt=./db-ca.crtInstall
git clone https://github.com/AncientiCe/palace-server-examples.git
cd palace-server-examples/kubernetes
helm install palace ./helm/palace-server -n palace \
--set publicUrl=https://palace.yourco.com \
--set dbCaConfigMap=palace-db-ca \
--set ingress.enabled=true \
--set ingress.className=nginx \
--set ingress.host=palace.yourco.com \
--set ingress.annotations."cert-manager\.io/cluster-issuer"=letsencrypt \
--set networkPolicy.enabled=trueSee values.yaml ↗ for every option. With cert-manager installed, the annotation above gets a certificate automatically.
Create the first admin
kubectl -n palace exec deploy/palace -- sh -c \
'curl -s -X POST http://127.0.0.1:8080/bootstrap \
-H "X-Bootstrap-Token: $PALACE_BOOTSTRAP_TOKEN" -H "Content-Type: application/json" \
-d "{\"org_name\":\"Your Co\",\"org_slug\":\"yourco\",\"admin_email\":\"[email protected]\"}"'Save the api_key and org_id. Then remove the bootstrap token:
kubectl -n palace patch secret palace-server --type=json \
-p='[{"op":"remove","path":"/data/bootstrap-token"}]'
kubectl -n palace rollout restart deploy/palaceConnect your team
Follow Connect clients with your URL.
Sizing
Starting points, not load-tested limits:
| Team | Replicas | DB | PALACE_DB_MAX_CONNECTIONS |
|---|---|---|---|
| Up to 25 | 2 | 1 to 2 GB RAM | 10 |
| 25 to 100 | 2 to 3 | 4 GB RAM | 10 |
Keep replicas × PALACE_DB_MAX_CONNECTIONS well under your database's connection limit. For more, split the API and the embedding worker into two releases with env.PALACE_ROLE=api and env.PALACE_ROLE=worker. Workers can run side by side safely.
Monthly plans
Set env.PALACE_LICENSE_API_URL=https://api.palacememory.com/api/licenses/validate so the license renews itself. Annual licenses work offline; leave it empty.
Tested
Installed and upgraded on k3s (Kubernetes 1.31) with Traefik: both replicas ran as UID 10001, bootstrap, storing a memory and search worked through the Ingress, /metrics and /bootstrap returned 404 from outside, and the NetworkPolicy blocked a pod in another namespace.
Troubleshooting
- Pods not ready:
kubectl -n palace logs deploy/palace. A wrong or expired license, or a database the pods cannot reach, stops startup. - NetworkPolicy blocks your ingress: set
networkPolicy.ingressNamespaceSelectorto your controller's namespace labels. - Something else? Open an issue ↗
Nomad, Hetzner, OpenShift, another IaC tool? Request a setup ↗. Never paste license keys, passwords, tokens or database URLs in an issue.
Other setups
Docker Compose on one machine · DigitalOcean (Terraform) · AWS (Terraform, ECS Fargate + RDS) · Google Cloud (Terraform, Cloud Run + Cloud SQL) · Azure (Terraform, Container Apps + PostgreSQL Flexible Server) · Kubernetes (plain kubectl) · Air-gapped (no internet) · Linux without Docker (systemd)