Skip to main content
The template gallery runs in the web service (the template-gallery module) of every Ayakaleaf Pro pod; the filestore service in the same pod stores the template files and renders their previews. Categories, permissions and publishing are described in Templates.

Configuration

1

ConfigMap

30-config.yaml (additions)
2

A templates user (optional)

Admins can always publish. To let a non-admin user manage the gallery, create the user, read its ID from MongoDB and put it into the ConfigMap:
3

Apply and restart

Several replicas

  • The template files must be in S3: with files on each replica’s own disk, every node would show a different gallery. The Horizontal scaling setup already uses the bucket overleaf-template-files.
  • Publishing takes the PDF of the project’s last compile, which exists only on the replica that compiled it. The load balancer’s sticky cookie keeps a user on that replica, so publish from the same browser session that compiled.

Tested on Kubernetes

On Kubernetes 1.37 with three replicas behind HAProxy and the template files in the S3 bucket overleaf-template-files (Garage), our end-to-end tests for the template gallery pass (41 cases): publishing a compiled project from the File menu and the PDF, preview images and source ZIP served from the bucket; creating projects from a template; categories, search, sorting and pages of the gallery; editing, overwriting and deleting templates; permissions of admins, regular users and the templates user from OVERLEAF_TEMPLATES_USER_ID (its ID read from MongoDB as described above); and malformed requests.
Last modified on November 2, 2026