- Go 67.8%
- JavaScript 21.3%
- Shell 3.5%
- CSS 3.1%
- HTML 2.1%
- Other 2.2%
|
|
||
|---|---|---|
| api/v1alpha1 | ||
| config/samples | ||
| demo | ||
| operator | ||
| plugin | ||
| .dockerignore | ||
| .gitignore | ||
| go.mod | ||
| go.sum | ||
| Justfile | ||
| LICENCE | ||
| LICENCE-NL | ||
| mise.toml | ||
| README.md | ||
| release-fundament.sh | ||
mijnbo-so-plugin
The Mijn Betaaloverzicht operator and its Fundament plugin (proof of concept). One plugin installation is one source organization (bronorganisatie): you fill it in on the plugin's install form, and the operator runs that organization's Mijn Betaaloverzicht components.
Mijn Betaaloverzicht plugin (Fundament) install form = the organization; installs the operator
└─ SourceOrganization "default" one per cluster, written by the plugin
├─ Component one per Mijn Betaaloverzicht part, derived by the operator
│ └─ Helm release of a chart from the Mijn Betaaloverzicht chart repository
└─ Component …
The source organization runs everything the development environment runs
for one (development-environment/skaffold.source-organization.yaml):
The components are grouped in functional domains. Every domain starts off;
each has its own menu item in the console with a switch (top right), and its
own cluster-scoped kind with one resource named default:
| Domain (menu item) | Kind | Components |
|---|---|---|
| Verbinden | ConnectDomain |
session-process, session-service, hsm-process, vhsm-service, vhsm-db |
| Diensten ontdekken | ServiceDiscoveryDomain |
service-discovery-process |
| Financiële gegevens ophalen | FinancialClaimsDomain |
citizen-financial-claim-process, financial-claim-request-service, financial-claim-request-db |
| Aansluiten | OnboardingDomain |
bk-management-ui, bk-management-process, bk-config-service, bk-config-db, source-organization-keys |
| Testen | TestingDomain |
fcid-view-validator, demo-simulation-process, demo-source-system, mock-source-system (each with its own switch; the mock starts off) |
| (Organisatie, always on) | public-endpoints (shared gateway) or local-gateway |
Domains depend on each other (Financiële gegevens needs Verbinden and
Aansluiten, for example); a domain page warns when one it needs is off.
citizen-financial-claim-process uses Testen's demo-source-system, else its
mock-source-system, else the source system URL under Organisatie. The
databases are kept when their domain is switched off. Overzicht shows which
domains are on and every running component.
Paths under the hostname: /service-discovery, /session-api,
/financial-claim-request-api, /bk-management-process, /hsm-process,
/demo-simulation (prefix stripped), and the UIs at /bk-management/ and
/fcid-view-validator/. App manager and scheme manager follow as their own
role resources on the same Component layer.
How it works
SourceOrganization(mijnbo.vorijk.nl/v1alpha1) is a cluster-scoped singleton: the API server only accepts the namedefault. It holds only what differs per organization: name, OIN, public hostname, the namespace the components run in, and an optional Gateway. Every hostname, internal address and the organization's/.well-known/bk-configuration.jsonfollow from it.Componentis the internal layer. TheSourceOrganizationcontroller writes one per part, owned by theSourceOrganization, named after its type and carrying the chart values. TheComponentcontroller installs each as a Helm release of the same name, waits for itsdependsOn, and reports readiness from the release's Deployments. Hand edits are overwritten.- Deleting a
SourceOrganizationdeletes its Components (owner references); each Component's finalizer then uninstalls its release, unless itsdeletionPolicyisRetain(meant for databases). - Charts come from the Mijn Betaaloverzicht chart repository at run time
(
CHART_REPOSITORY, defaulthttps://blauwe-knop.gitlab.io/vorderingenoverzicht/charts), checked against its index digest and cached. Each component has a default version (operator/internal/components/sourceorganization.go); a Component'sspec.chartVersionoverrides it with a version or a constraint such as~0.26or*. Only our own charts (operator/charts) are embedded. - Secrets: the operator generates an API key per service
(
mijnbo-api-keys) and the organization's ES256 key pair (mijnbo-organization-key) once; services and their callers read them from there, so no key is in a Component or the console. - Readiness: a Component is Ready when its Deployments are rolled out
and its Jobs (database migrations, key registration) succeeded; dependents
wait for it (
dependsOn). Changed values restart its pods. - The operator runs anywhere (
operator/chart). The plugin is a thin installer around it: on every start ithelm upgrade --installs the vendored operator chart, creates the components' namespace and writes theSourceOrganizationfrom its configuration (FUNP_*); its status follows the organization's. A value the CRD rejects (an OIN that is not 20 digits, a changed namespace) shows asFailedin the plugin status. Uninstalling deletes theSourceOrganization, waits for its components to go, and removes the operator; the namespace stays. - Publishing: everything shares one public hostname (
spec.hostname), each service under its own path prefix (stripped by the gateway), like the other Fundament deployments: the clusters' wildcard DNS and certificates cover one label, so use e.g.mijnbo-bron.cluster-a.fieldlab2026.nl. Service discovery answers onhttps://<hostname>/service-discovery/.well-known/bk-configuration.json. Withspec.sharedGateway(the default from the plugin) the operator adds apublic-endpointscomponent: aListenerSetonistio-gateway/public-gatewaywith an HTTPS listener for the hostname and a certificate from theletsencrypt-productionClusterIssuer. A hostname can be claimed once per cluster.spec.gatewayRefattaches to a Gateway of your own instead. - CRDs are chart templates marked
helm.sh/resource-policy: keep: Helm upgrades them, and uninstalling never deletes them (deleting a CRD deletes the organization's resources with it).
apiVersion: mijnbo.vorijk.nl/v1alpha1
kind: SourceOrganization
metadata:
name: default # the only name allowed
spec:
organization:
name: Demo organisatie
oin: "00000001234567890000" # 20 digits; immutable
namespace: mijnbo # must exist; immutable
hostname: mijnbo-bron.cluster-a.fieldlab2026.nl # every service on a path under it
gatewayRef: # optional; without it nothing is published
name: public
namespace: gateway-system
sectionName: https
status:
phase: Ready
discoveryUrl: https://mijnbo-bron.cluster-a.fieldlab2026.nl/service-discovery/.well-known/bk-configuration.json
components:
- name: service-discovery-process
type: service-discovery-process
phase: Ready
Layout
| Path | What |
|---|---|
api/v1alpha1 |
API types; just generate writes deepcopy code and the CRDs |
operator/cmd |
operator entry point |
operator/internal/components |
the component registry: chart and values per component |
operator/internal/controller |
SourceOrganization and Component reconcilers |
operator/internal/helm |
Helm v4 SDK wrapper |
operator/internal/chartrepo |
fetches component charts from the chart repository |
operator/charts |
our own charts: public-endpoints, source-organization-keys |
operator/chart |
the operator's own chart; files/crds is generated |
plugin |
Fundament plugin: lifecycle, definition.yaml, console pages |
Development
mise install
just test
just generate # after changing api/
just run-operator # operator against $KUBECONFIG (apply `just crds` first)
Adding a component
- Add a
Definitionand its default chart version inoperator/internal/components/sourceorganization.go(values,dependsOn,deletionPolicy). - Add the type to the
ComponentTypeenum inapi/v1alpha1and runjust generate. - Add the kinds its chart renders to
operator/chart/templates/rbac.yaml.
Fundament sandbox
From the Fundament repository, follow "Testing plugins locally" steps 1–3
(sandbox cluster, functl auth login). Then here:
just operator-push # prints OPERATOR_IMAGE
just publish --submit # publishes plugin/definition.yaml; approve it in the marketplace admin
Install it from the console and fill in the organization; under advanced
options, set the operator image to the printed OPERATOR_IMAGE.
Without Fundament
just install-operator code.digitaledienst.overheid.nl/mijn-betaaloverzicht/mijnbo-so-plugin/mijnbo-operator:0.2.0
kubectl create namespace mijnbo
kubectl apply -f config/samples/sourceorganization.yaml
Known limits
- One source organization per cluster (by design), and the charts render fixed object names.
- A release left
pending-*by an interrupted Helm operation needs a manualhelm rollback; the Component staysDegradedwith Helm's message. - No Gateway API on the cluster plus a
gatewayRefleaves the ComponentDegraded("no matches for kind HTTPRoute") until the Gateway API exists.