OpenL Studio — Kubernetes Example
OpenL Studio — Kubernetes Example
Deploys OpenL Studio in multi-user mode on Kubernetes with PostgreSQL as the user management database.
Files
01-postgres-config.yaml— PostgreSQL deployment, PVC, ClusterIP Service, and the shared credentials Secret02-openl-studio.yaml— OpenL Studio deployment, two PVCs (local and shared workspaces), and a LoadBalancer Service
Prerequisites
- A running Kubernetes cluster (tested with Rancher Desktop on macOS)
kubectlconfigured to talk to that cluster- Outbound HTTPS from the cluster — the init container downloads the PostgreSQL JDBC driver from
jdbc.postgresql.org
Quick start
kubectl apply -f 01-postgres-config.yaml
kubectl apply -f 02-openl-studio.yaml
Wait for both pods to become ready:
kubectl get pods -w
Access Studio at http://localhost:8080 (Rancher Desktop routes the LoadBalancer Service to localhost automatically).
Design notes
- Single replica — the example runs one pod: its sessions stay in the memory of the pod, and its volumes are
ReadWriteOnce. Several instances need the setup of
Cluster Mode Configuration.
The Deployment strategy is set to
Recreateto avoid PVC conflicts during rollout. - Rootless — the container runs as UID 1000 (
openlsystem user baked into the image). Pod and container security contexts enforcerunAsNonRootand drop all Linux capabilities. - JDBC driver — an init container using
busyboxdownloads the PostgreSQL JDBC driver and places it in anemptyDirvolume. The jar is mounted into/opt/openl/lib/jdbc.jar, where Jetty picks it up via--lib. - Persistence —
/opt/openl/local(instance data, repository clones) and/opt/openl/shared(user workspaces, locks, saved settings) are backed by separate ReadWriteOnce PVCs so data survives pod restarts. - Health checks — the startup probe calls
/healthcheck/startup; the readiness probe calls/healthcheck/readiness. Both endpoints are available without authentication. The readiness probe returns success only after the Spring context is initialized, while it is not being refreshed, and before shutdown begins. - Credentials — stored in a Kubernetes Secret (
openl-db-credentials). Both the PostgreSQL pod and the Studio pod reference it. For production, replace it with an external secrets manager. - Configuration — OpenL Studio properties are set via environment variables in upper case with dots and dashes
replaced by underscores (
USER_MODE→user.mode,DB_URL→db.url, etc.).JAVA_OPTSis not overridden so the image default (-XX:MaxRAMPercentage=90.0) applies; the JVM heap scales with the pod memory limit.
Customisation
- Credentials — edit
stringDatain01-postgres-config.yamlbefore the firstapply. - Storage — adjust the
storagefield in each PVC (1Gifor Postgres,2Gilocal,5Gishared). - Memory — raise
resources.limits.memoryin02-openl-studio.yamlfor large rule sets; the JVM adjusts automatically. - JDBC version — update the
wgetURL in the init container of02-openl-studio.yaml. - Air-gapped clusters — host the JDBC jar internally and change the
wgetURL to point to your internal registry. - Ingress — change the Service type in
02-openl-studio.yamltoClusterIPand add an Ingress resource for TLS termination or a custom domain.