- Shell 88.1%
- Makefile 11.9%
mailbox-app-push-gateway 0.3.0 serves its counts on a management listener, and mailbox-app-push-gateway-management-ui shows them under /push-management/ (ADR 0010 in getting-started). Not deployed yet. |
||
|---|---|---|
| bin | ||
| fundament | ||
| test | ||
| .gitignore | ||
| LICENSE | ||
| Makefile | ||
| README.md | ||
environments
Where the components of Notificatie voor Burgers run, and at which version. Each environment is a
folder. Fundament has no GitOps for applications, so a release is a helm upgrade --install from
the machine of someone with access to the cluster.
| Environment | Cluster | Namespace | URL |
|---|---|---|---|
fundament |
Fundament, cluster-a |
tnt-mbo-voorbeeld--mijnbo |
https://mijnbo.cluster-a.fieldlab2026.nl |
At that URL, / is the source organisation's screen, and /dispatch-management/, /delivery-management/ and /mailbox-host-management/ the operator screens of the three parties in between. The citizen's app is no longer served here: it opens sealed enveloppen over FFI, which a browser cannot do, so it ships through mailbox-app-installer. The screens are public for now because there is no authorisation yet; each shows only what its party may know.
Layout
<environment>/target the API server, namespace, gateway release and public URL
<environment>/gateway/ the HTTPS entrance: Gateway, Let's Encrypt Issuer, redirect, DNS record
<environment>/versions the release (X.Y.Z) of each component, in deploy order
<environment>/values/<component>.yaml Helm values on top of the chart's own defaults
bin/deploy.sh deploys every listed component from the Helm registry
test/deploy_test.sh checks bin/deploy.sh without a cluster (make test)
Every component is pinned at a release, component=1.2.3: the deploy installs that chart version
from the Helm registry of the organisation, and the chart's appVersion is the image of the same
release (see the charts repository). A pin that is no release is refused. A component gets a
release with make release VERSION=X.Y.Z in its own repository.
HTTPS
The cluster's shared gateway only accepts tenant hostnames on plain HTTP, so fundament/gateway
gives this namespace its own Istio Gateway with a public address, the way other tenants on
cluster-a do it. cert-manager gets the certificate from Let's Encrypt through a namespaced Issuer
(HTTP-01 on the Gateway's own HTTP listener, which otherwise only redirects to HTTPS). A
DNSEndpoint points the hostname at the Gateway's address; an exact name wins over the cluster's
wildcard record. make deploy installs the gateway first, waits for its address and the
certificate, then deploys the components, whose routes attach to its HTTPS listener.
Access
You need functl, kubectl, helm and git, and to be a project admin of the Fundament
project. Write your own kubeconfig for cluster-a:
functl auth login
functl cluster kubeconfig <cluster-id> > ~/.kube/fundament.yaml
The kubeconfig holds no credential: kubectl asks functl for a short-lived token each time.
Deploy
- Put the release of each component in
fundament/versions. Its tag pipeline must have finished, so the chart is in the registry and the image exists (helm search repo mijnbo --versions). - Validate, then deploy:
Usemake dry-run # the API server validates every release, nothing changes make deploy # install or upgrade, roll back a failing release, then the smoke test make status # releases, pods and routesmake deploy KUBECONFIG=<path>when your kubeconfig lives elsewhere. - Commit and push
fundament/versions, so the repository says what runs.
bin/deploy.sh refuses to run unless KUBECONFIG is set and points at the API server in
fundament/target, so another context in your kubeconfig never receives a release.
Switching to the renamed repositories
The components were renamed to the blauwe-knop names (dispatch-service became dispatch-process, and so on), and the image, chart, release and Service names follow. The first deploy after the rename installs releases with the new names, so the old ones must go once:
make remove-old-releases # uninstalls source-organization-outbox, mailbox-host, dispatch-service-ui,
# delivery-service-ui, mailbox-host-ui and push-gateway
make deploy
dispatch-service and delivery-service are not in that list any more: those names now belong to
the data layers of the verzenddienst and the bezorgdienst. push-gateway became
mailbox-app-push-gateway; its VAPID Secret keeps the name push-gateway-vapid.
Secrets
Secrets go in as SealedSecrets: encrypted with the public key of the cluster's Sealed Secrets
controller, so only that cluster can open them and no decryption key ever lives in CI or in this
repository. make deploy applies everything in <environment>/secrets/ before the components.
The first one is fundament/secrets/push-gateway-vapid.sealed.yaml, the VAPID key pair with which
the push gateway signs Web Push messages. Re-seal it, for example to rotate the keys, without the
private key ever touching a file:
(cd ../mailbox-app-push-gateway && go run ./cmd/mailbox-app-push-gateway generate-vapid-keys) \
| kubectl create secret generic push-gateway-vapid --namespace tnt-mbo-voorbeeld--mijnbo \
--from-env-file=/dev/stdin --dry-run=client -o yaml \
| kubeseal --cert https://sealed-secrets.cluster-a.fieldlab2026.nl/v1/cert.pem \
--namespace tnt-mbo-voorbeeld--mijnbo --name push-gateway-vapid --format yaml \
> fundament/secrets/push-gateway-vapid.sealed.yaml
New keys invalidate every existing browser subscription; the app then subscribes again.
fundament/secrets/mailbox-host-api-keys.sealed.yaml holds the service keys with which
mailbox-host-process and mailbox-host-management-process authenticate at mailbox-host-service.
Re-seal it the same way, without the keys touching a file:
kubectl create secret generic mailbox-host-api-keys --namespace tnt-mbo-voorbeeld--mijnbo --dry-run=client -o yaml \
--from-literal=MAILBOX_HOST_PROCESS_API_KEY=$(openssl rand -hex 32) \
--from-literal=MAILBOX_HOST_MANAGEMENT_PROCESS_API_KEY=$(openssl rand -hex 32) \
| kubeseal --cert https://sealed-secrets.cluster-a.fieldlab2026.nl/v1/cert.pem \
--namespace tnt-mbo-voorbeeld--mijnbo --name mailbox-host-api-keys --format yaml \
> fundament/secrets/mailbox-host-api-keys.sealed.yaml
fundament/secrets/delivery-api-keys.sealed.yaml does the same for the bezorgdienst: the keys of
delivery-process and delivery-management-process at delivery-service (DELIVERY_PROCESS_API_KEY,
DELIVERY_MANAGEMENT_PROCESS_API_KEY). Re-seal it with the command above and those names.
fundament/secrets/mailbox-app-push-gateway-fcm.sealed.yaml holds FCM_SERVICE_ACCOUNT: the JSON of the
app publisher's Firebase service account, with which the push gateway wakes the app on a phone
through FCM. It is optional; without it the gateway serves no fcm and the app on a phone only gets
seintjes over its WebSocket while it is open. Seal it from the downloaded key file, and delete that
file afterwards:
kubectl create secret generic mailbox-app-push-gateway-fcm --namespace tnt-mbo-voorbeeld--mijnbo \
--from-file=FCM_SERVICE_ACCOUNT=<service-account.json> --dry-run=client -o yaml \
| kubeseal --cert https://sealed-secrets.cluster-a.fieldlab2026.nl/v1/cert.pem \
--namespace tnt-mbo-voorbeeld--mijnbo --name mailbox-app-push-gateway-fcm --format yaml \
> fundament/secrets/mailbox-app-push-gateway-fcm.sealed.yaml
fundament/secrets/dispatch-api-keys.sealed.yaml holds the verzenddienst's keys
(DISPATCH_PROCESS_API_KEY, DISPATCH_MANAGEMENT_PROCESS_API_KEY) and
fundament/secrets/source-organization-api-keys.sealed.yaml the bronorganisatie's
(SOURCE_ORGANIZATION_PROCESS_API_KEY); re-seal them the same way.
The database credentials are not in this repository: CloudNativePG creates the Secrets
<party>-db-app (for mailbox-host-db, delivery-db, dispatch-db and source-organization-db)
itself when it bootstraps each cluster.
Every party in layers
Each party runs in blauwe-knop layers, released in the order fundament/versions keeps:
the database (<party>-db: a CloudNativePG cluster and a migration Job) before the data layer
(<party>-service) before its processes (<party>-process, <party>-management-process).
- Bezorgdienst:
delivery-db,delivery-service,delivery-process,delivery-management-process - Verzenddienst:
dispatch-db,dispatch-service,dispatch-process,dispatch-management-process(after the bezorgdienst, to which it sends zendingen) mailbox-app-push-gateway- Hoster:
mailbox-host-db,mailbox-host-service,mailbox-host-process,mailbox-host-management-process - Bronorganisatie:
source-organization-db,source-organization-service,source-organization-process - The screens:
source-organization-ui,mailbox-appand the three management UIs
On the first deploy of a database it needs a minute or two to bootstrap; the migration Job retries until it can connect. A component's line stays commented until CI has built its first image.
Each public API has its own prefix on the shared hostname, routed by its chart: /bronorganisatie
(source-organization-process), /hoster (mailbox-host-process) and /push (mailbox-app-push-gateway), each with
its OpenAPI document at <prefix>/v1/openapi.json and .yaml.
make deploy and make smoke pass this environment's kubeconfig, namespace and context to the
end-to-end test, so its persistence checks restart our own deployments here too.
The smoke test builds the test burger from getting-started at a fixed path,
.build/test-burger in this repository (or $TEST_BURGER_BIN). A firewall that asks per
program, such as Little Snitch, therefore needs to allow it once; when its requests time out while
curl reaches the same URL, the firewall is holding it back.
License
EUPL-1.2, see LICENSE.