Getting started with Fundament development
Prerequisites
Section titled “Prerequisites”- Mise: installs the pinned
just,k3d,kubectl,helm,skaffold,mkcert,goandbunfrommise.toml - Docker or Podman with at least 16 GiB of memory; 24 GiB recommended when you also run the plugin sandbox
certutil(NSS tools), whichmkcertneeds to install the local CA:
| OS | Install |
|---|---|
| macOS | brew install nss |
| Debian/Ubuntu | apt install libnss3-tools |
| Fedora/RHEL | dnf install nss-tools |
| Arch | pacman -S nss |
The default shared memory limits are too low for PostgreSQL. For embedded-postgres, create/edit /etc/sysctl.conf:
kern.sysv.shmall=65536kern.sysv.shmmax=16777216Podman
Section titled “Podman”Put deploy/podman/bin/docker on your PATH as docker, e.g. ln -s "$PWD/deploy/podman/bin/docker" ~/bin/docker. The recipes, Skaffold and functl then run Podman through it, and the recipes detect Podman from docker --version. A plain symlink to podman is not enough: the stand-in drops Docker’s --provenance and --sbom build flags, which Podman rejects, and prints the digest after a push, which the recipes read. Set PODMAN to use another Podman binary.
Podman also needs:
- A rootful machine: k3s needs the cpuset cgroup controller, which rootless containers do not get.
podman machine stop && podman machine set --rootful && podman machine start - The machine’s memory raised from its 2–8 GiB default to the amount above:
podman machine set --memory 24576while it is stopped - The Docker API socket at
/var/run/docker.sock, which k3d and Skaffold use; on macOS,sudo podman-mac-helper installpoints it at the machine just podman-machine-setuponce per machine, whichcluster-createalso runs: it lists the local registries, which serve plain HTTP, as insecure, and lifts Podman’s 2048-process cap per container, which a k3s node running every Fundament pod exceeds. When it changes anything it stops with an error: restart the machine and run the recipe again. It configures the machine behind the default connection; Podman directly on a Linux host is not supported.
Windows
Section titled “Windows”Use PowerShell 7 (winget install Microsoft.PowerShell); mise activate depends on a hook it does not have on Windows PowerShell 5.1, where it silently fails to populate PATH.
Check your powershell version with $PSVersionTable.PSVersion.
If the profile refuses to load, run Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned.
Add to $PROFILE:
$env:PATH = "C:\Program Files\Git\bin;C:\Program Files\Git\usr\bin;$env:PATH"mise activate pwsh | Out-String | Invoke-ExpressionThose PATH entries supply the bash and cygpath that just recipes need; the postinstall hook just e2e::install fails until they are present, so rerun it afterwards.
Use Edge or Chrome for the console: mkcert cannot install its CA into Firefox on Windows (no NSS certutil), so calls to authn.fundament.localhost fail.
Install the tools
Section titled “Install the tools”mise trustmise installRun mise install without arguments; naming a tool, as in mise install go, rewrites that tool’s pinned version in mise.toml to latest.
Run the platform
Section titled “Run the platform”just cluster-startjust dev-hotreloadcluster-startcreates thek3d-fundamentcluster on first run, installs the local CA and the Envoy Gateway that serves every*.fundament.localhosthost on port 8443, and adds its contextk3d-fundamentto.dev/kubeconfigin the checkout. Thejustrecipes use that file;~/.kube/configis left alone.- In the checkout, mise puts
.dev/kubeconfigahead of your own kubeconfig, sokubectl,helmand k9s use the local clusters; your other contexts stay reachable with--context, and a context switch is written to.dev/kubeconfigonly. Outside the checkout, put it ahead of your own:export KUBECONFIG=<checkout>/.dev/kubeconfig:$HOME/.kube/config, or in PowerShell$env:KUBECONFIG = "<checkout>\.dev\kubeconfig;$HOME\.kube\config". dev-hotreloadbuilds and deploys every service, then stays attached.- Edits to existing files are synced into the running containers.
- Adding, moving or deleting a file rebuilds the image and redeploys.
- Every deploy resets the databases to the test data.
Ctrl-Cstops watching; the deployment keeps running.- Short on memory? List deployments that should run their production image instead of hot-reloading: on macOS/Linux,
FUNDAMENT_DEV_DISABLED_HOTRELOAD=marketplace-registry-frontend,marketplace-admin-frontend just dev-hotreload; in PowerShell,$env:FUNDAMENT_DEV_DISABLED_HOTRELOAD = "marketplace-registry-frontend,marketplace-admin-frontend"; just dev-hotreload. This saves about 2GB. Their code is then not hot-reloaded, and every edit to it rebuilds the image. - It runs in mock mode: clusters exist only in the database. For real clusters, see Test environment.
The cluster runs on the docker network k3d-fundament, subnet 172.19.0.0/16. If another network on your machine uses that range, creating it fails; set FUNDAMENT_K3D_SUBNET to a free subnet, e.g. export FUNDAMENT_K3D_SUBNET=172.29.0.0/16 in your shell profile or $env:FUNDAMENT_K3D_SUBNET = "172.29.0.0/16" in $PROFILE, and run just cluster-start again. It is read whenever the network is created, also after just cluster-delete; an existing network keeps the subnet it has.
A cluster created while its ports were published on every network address keeps them there: cluster-start detects it and stops; recreate it with just cluster-delete && just cluster-create, and the sandbox with just plugins cluster-delete && just plugins cluster-create && just plugins deploy. After recreating either, run just plugin-sandbox-kubeconfig and just plugins sandbox-catalog to connect them again.
A cluster created before the local edge moved to Envoy Gateway cannot run the chart. cluster-start detects it and stops; recreate it with just cluster-delete && just cluster-create.
To check the production images (the Dockerfiles CI builds), run just dev once and stop it with Ctrl-C: it rebuilds and redeploys on every file change.
Open the console
Section titled “Open the console”https://console.fundament.localhost:8443
| User | Password | Organization |
|---|---|---|
alice@acme-corp.com |
password |
acme-corp, with cluster acme-cluster |
platform-admin@fundament.io |
password |
system, which owns the first-party plugins |
The test data also has an API key for Alice in acme-corp, so you don’t have to create one in the console. functl can store it:
functl auth login fun_LocalDevAliceAcmeCorpKey0000004KyU0eauth login stores the key in functl’s credentials file (~/.config/fundament/credentials by default; see the config directory order), replacing a key you stored for another installation. The OpenTofu provider and scripts don’t read that file: give them the key in the FUNDAMENT_API_KEY environment variable, export FUNDAMENT_API_KEY=fun_LocalDevAliceAcmeCorpKey0000004KyU0e or in PowerShell $env:FUNDAMENT_API_KEY = "fun_LocalDevAliceAcmeCorpKey0000004KyU0e". Setting that variable for a functl command also works, and leaves the stored key alone.
If a host does not answer, check that the gateway is PROGRAMMED and every route is Accepted:
kubectl --context k3d-fundament -n gateway get gateway,certificatekubectl --context k3d-fundament -n fundament get httprouteSee console-frontend/README.md for the frontend commands.
The collection in bruno/ calls the stack on https://…:8443. Bruno does not read the system trust store, so point it at the mkcert CA that cluster-start installed (mkcert -CAROOT prints its folder):
- In the app: Preferences → General → Use custom CA certificate, select
rootCA.pemand keep Keep default CA certificates on. - With the CLI:
bru run --env local --cacert "$(mkcert -CAROOT)/rootCA.pem".
Edit the docs
Section titled “Edit the docs”Under just dev-hotreload, https://docs.fundament.localhost:8443 shows edits to existing pages in docs/ within seconds. Without the cluster:
just docs-dev # dev server on http://localhost:4321just docs-build # production build, fails on broken linksRemove
Section titled “Remove”just cluster-delete- Test environment: a real Gardener in a local VM, for e2e scenarios and real clusters
- Plugins: write a plugin, run it locally
- Block devices for k3d: storage plugin work