The deploy demo#
This morning we built the cluster.
This afternoon we follow a Plone project from a git push to a running site on it.
The project is training-deployment-gitlabdeploy, and it is already running: https://playcluster.plone.org. Everything shown this afternoon is in that repository, and every path mentioned is real. The reference documentation for it is included in this training, starting at From repository to running site.
One place for everything host-specific#
In a vanilla Cookieplone project, the host name sits in the stack file, the stack name in the Makefile, and the data path in both. Renaming a site meant editing four files, and the name of one of them.
Here, every value that differs between one deployment and the next is in repository.toml, once:
[deployment]
gitlab_project = "plone-training1/training-deployment-gitlabdeploy"
hostname = "playcluster.plone.org"
stack_name = "playcluster-plone-org"
stack_prefix = "reference"
stack_file = "devops/stacks/stack.yml"
data_path = "/srv/playcluster-demo/data"
db_placement = "node.labels.storage == persistent"
app_placement = "node.labels.type == worker"
[deployment.traefik]
network = "nw-public"
constraint_label = "public"
entrypoint = "https"
certresolver = "le"
The pipeline reads it, the local Docker stack reads it, and the swarm stack file is filled in from it at deploy time. Change the host name here, and it reaches the router rule, the Volto API path and the Plone virtual host rewrites without touching another file.
Some of these values connect straight to this morning:
db_placementpins the database to the node labelledstorage=persistent:play3.app_placementkeeps the frontend and backend on the workers,play2andplay3, and off the manager.[deployment.traefik]has to match the cluster's Traefik exactly: its network, the label it filters on, its entrypoint and its certificate resolver. Get one wrong, and the site is simply not routed, usually without an error anywhere.
gitlab_project is a safety catch that we will meet again when you deploy a copy of this project.
The images#
The pipeline builds two container images, and so can you, with make build-images.
- The backend
Plone installed with
uvfrom a locked dependency tree, on top ofplone/server-builderandplone/server-prod-config. The dependencies are installed before the source code is copied in, so a code change does not rebuild the dependency layer.- The frontend
Volto, on top of
plone/frontend-builder. Volto itself is not in the repository:mrs.developer.jsonpins a version, and the build fetches it from GitHub.
Both land in the cluster's own registry, under the project's path:
registry.playcluster.plone.org/plone-training1/training-deployment-gitlabdeploy/backend
registry.playcluster.plone.org/plone-training1/training-deployment-gitlabdeploy/frontend
Where it runs#
This is how the reference deployment is spread over the cluster right now:
Service |
Replicas |
Runs on |
|---|---|---|
|
1 |
|
|
2 |
|
|
2 |
|
The manager, play1, runs none of it: it runs Traefik, which routes playcluster.plone.org to the frontends, and the frontends and Traefik on to the backends.
The next chapter follows the pipeline that put it there.