The deployment defines multiple service (or application), each being a
collection of kubernetes manifests located in src/<service>/.
external/: third party resourcessrc/: deployable manifests- secrets are encrypted with sops+age and persisted in
src/secrets/
Each service is structured as follows (supported tools are ytt and helm):
├── external
│ └── <tool>
│ └── <service>/... # <- third party templates
└── src
└── <service>
├── additional-manifest.yaml # <- custom manifests for this deployment
├── kustomization.yaml # <- kustomization file to select resources
└── <tool>
├── out/... # <- rendered manifests
└── values.yaml # <- values used for templating
ytt is the preferred rendering engine, but helm is also supported as many upstream templates are distributed with helm.
When running just render, we attempt to render each service with helm and then
with ytt and save the rendered manifests in the repository.
When deploying with just deploy, deployment is done with kustomize
(kubectl -k). This means that the src and each of its subdirectories contain
a kustomization.yaml file which determine what manifests are included in the
deployment.
For example, running just deploy src/ will recursively parse
src/kustomization.yaml and the kustomization.yaml from each resources
declared in that file. This allows to simply exclude services or manifests by
commenting them out of kustomization.yaml.
Here is the typical workflow to re-deploy a service that has been updated upstream.
- Update the external manifest templates. This will update the
vendirlock file and fetch the latest templates intoexternal/<tool>/<service>.
just external::refresh- Render the manifests with the new templates.
just renderNote
This may fail if the new templates broke compatibility with existing values,
in which case you will need to update your values in
src/<service>/<tool>/values.yaml. Also watch out in case the upstream added
new template files, as you may need to include them in the service
kustomization.yaml.
- Deploy the updated manifests.
just deploy src/<service>Important
In some cases, you may want to manually delete resources related to the
service. You can achieve that with just delete src/<service> or use
kubectl delete to delete specific resoruces.
Custom manifests (e.g. additional volumes) can be added inside src/<service>/,
but they need to be added as a resource in kustomization.yaml file in the same
directory.