monocle
monocle copied to clipboard
[spec] Provide a monoclectl script to manage a deployment
12. Deployment of monocle services
- Date: 2021-08-09
Context and Problem Statement
There are two strategies to deploy the Monocle services:
- docker-compose (and soon kubectl apply), or,
- shell scripts to start the service on the local host.
We would like to use a single strategy to provide a consistent experience between local dev and production deployment.
Considered Options
- Nix
- Containers
Decision Outcome
Chosen option: "Containers", because it comes out best (see below).
Positive Consequences
- We simplify the deployment and contributor story.
- We improve the developer experience by offering a production like environment.
To achieve that we provide a monoclectl command to manage the service, for example using podman, compose or kubernete. The command feature three functions:
deployto start the service using the existing images.developto start the service using the local source and development images.buildto build the images.
Negative Consequences
- Increased disk space requirement.
Pros and Cons of the Options
Nix
- Bad, because it is not readily available.
Containers
- Bad, because it needs lot of diskspace.
- Good, because it is the target environment.
To realize this spec, I suggest these 2 stories:
- [ ] Minimal
monoclectl develworking with kind to validate hot-reload. - [ ]
monoclectl buildto replacedocker-compose build. - [ ]
monoclectl compose deployto replacedocker-compose.yml.img.
Then assuming this is working as expected, we can finish the migration:
- [ ] Use monoclectl in the CI.
- [ ] Publish the compose/kubernetes configuration with the release.
- [ ] Remove the Dockerfiles and compose/kubernetes configuration from the repo.