Kubernetes
Deploy Sling Platform and agents on Kubernetes
This page has a full Kubernetes manifest for the platform and a single agent. For agent replicas that the platform provisions and scales, see High-Availability Agents.
If you build the Secret from an env file (kubectl create secret generic ... --from-env-file=.env), do not put quotes around the JSON values. Docker Compose removes the quotes, but --from-env-file keeps them, and the platform then stops with a JSON parse error such as ReadMapCB: expect { or n, but found '. Write SLING_PLATFORM_ADMIN_CREDENTIALS={"email":"...","password":"..."} with no quotes around it. Also make sure the file ends with a new line, or the last variable merges with the next one you add.
Keep strategy: Recreate on the platform Deployment. The platform keeps its data in an embedded PostgreSQL database on the sling-platform-data volume. With the default RollingUpdate strategy, Kubernetes starts the new pod before it stops the old pod. Then two PostgreSQL servers write to the same data directory, and the database can become corrupt. The platform then does not start, and its logs show PANIC: could not locate a valid checkpoint record. Recreate stops the old pod first. Also keep terminationGracePeriodSeconds: 60, so that PostgreSQL has time to stop cleanly. If you use an external database (SLING_PLATFORM_POSTGRES_URL), these settings are not necessary.
Last updated
Was this helpful?