Deploy guide

Palace Server on Kubernetes (Helm)

A Helm chart for any Kubernetes cluster (EKS, GKE, AKS, DOKS, k3s and others) with a managed or self-run PostgreSQL that has pgvector.

At a glance

WhatValue
Good forTeams that already run Kubernetes
NeedsKubernetes 1.25+, Helm 3, PostgreSQL 14+ with pgvector, an ingress controller
Time to deployAbout 20 minutes with an existing cluster and database
CostYour cluster and database. Palace needs about 512 MiB requested per replica
Prefer plain YAML and kubectl apply, without Helm?

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, RuntimeDefault seccomp, no service account token. Readiness on /readyz, liveness on /healthz.
  • A Service, and an Ingress when enabled. The Ingress sends /metrics and /bootstrap to 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

01

Prepare the database

Create a database named palace, then run db-setup.sql ↗ once as the database admin:

Set up the database
APP_PW=$(openssl rand -hex 24)
psql "postgres://ADMIN:PASSWORD@HOST:5432/palace?sslmode=require" \
  -v app_password="$APP_PW" -f db-setup.sql

It 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.

02

Create the secret

Create the secret and CA config map
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.crt
03

Install

Install the chart
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=true

See values.yaml ↗ for every option. With cert-manager installed, the annotation above gets a certificate automatically.

04

Create the first admin

Bootstrap 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:

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/palace
05

Connect your team

Follow Connect clients with your URL.

Sizing

Starting points, not load-tested limits:

TeamReplicasDBPALACE_DB_MAX_CONNECTIONS
Up to 2521 to 2 GB RAM10
25 to 1002 to 34 GB RAM10

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.ingressNamespaceSelector to your controller's namespace labels.
  • Something else? Open an issue ↗

View on GitHub ↗

Running something different?

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)

Put your knowledge to work

Give your next session
a head start.

Start your team trial

60 days · 10 seats · No credit card