This repository showcases the use of ytt + vendir to reuse manifests from other repositories.
This repository is structured as follows:
./build
: rendered manifests (not checked out in git)../external
: vendored manifests from third-party repositories../justfile
: commands to work with the manifests../src
: manifests and values specific to this repository../tools
: tooling to work with the manifests.
This repository contains a justfile, and we use just
as a command runner.
We provide all the tools you need to work on this project in a nix development shell. See here to install nix: https://determinate.systems/nix-installer/
To enter the dev-shell, run:
just dev
Note
Alternatively, you may enter the devshell directly with :
nix develop ./tools/nix#default --accept-flake-config --command "zsh"
First, the manifests are fetched from the source repository using vendir
.
See the vendir.yaml file for the configuration. You can fetch the manifests with:
just fetch
The third-party manifests are made available in the ./external
directory.
Next, you can render the manifests via ytt
using:
just render
The rendered manifests are available in ./build/manifests
.
Note
External helm charts will be rendered first and included in the outputs.
To render an external helm chart in external/helm/<service>
, include your values in src/<service>/helm/values.yaml
.
Finally, you can apply the rendered manifests to your cluster using kubectl
:
just deploy
Tip
just deploy
automatically fetches and renders the manifests before applying them.