Developer Guide¶
Quick Start¶
1. Install Dependencies¶
make install
2. Build and Test¶
make lint
make test
make synth
make validate
3. Consume the Platform¶
cd examples/team-api
npm install
npm run synth
kubectl apply -f dist/obs.k8s.yaml
Documentation¶
- Usage Guide — detailed guide for consumers and platform engineers
- Architecture
Adding a New Primitive Product¶
For a step-by-step walkthrough, see the Usage Guide. In short:
- Use
npx create-platform-productor create a new package underpackages/<product>/. - Add
cdk8s.yamlwith required CRD imports. - Run
npx cdk8s importto generate typed constructs. - Define the XRD in
src/xrd.ts. - Define the Composition in
src/composition.ts. - Add unit tests in
test/unit/. - Add packaging metadata in
package/crossplane.yaml.
Profile Defaults¶
| Profile | Grafana Replicas | Storage | Loki Storage | Loki Replication |
|---|---|---|---|---|
| development | 1 | 10Gi | local | 1 |
| staging | 1 | 20Gi | s3 | 2 |
| production | 2 | 50Gi | s3 | 3 |
Feature Toggles¶
| Feature | GrafanaInstance | LokiInstance | PrometheusInstance | ObservabilityStack |
|---|---|---|---|---|
| SSO | yes | no | no | global |
| Alerting | yes | no | yes | global |
| Ingress | yes | no | no | no |
| Federation | no | no | yes | no |
Troubleshooting¶
make synth fails with "cannot find a parent chart"¶
Ensure XRD and Composition classes extend Chart from cdk8s.
make validate fails with string transform error¶
Crossplane v2 requires string.type: Format. Use the transformString helper from @7k-hiroba/shared.