Skip to content

feat(k8s): data-declared generic Platform components (K4a)#148

Merged
astrojerms merged 1 commit into
mainfrom
feat/k4a-generic-platform
Jul 20, 2026
Merged

feat(k8s): data-declared generic Platform components (K4a)#148
astrojerms merged 1 commit into
mainfrom
feat/k4a-generic-platform

Conversation

@astrojerms

Copy link
Copy Markdown
Owner

K4(a) — Data-declared generic Platform components

Delivers the roadmap's intent that Platform is generic support (Terraform-provider style), not a curated grab-bag of preferred charts. Platform can now install any Helm chart with no code change.

Generic components map

kind: Platform
spec:
  kubeconfigPath: { $ref: {...} }
  # presets — default chart coords, enable with a flag:
  traefik: { enabled: true }
  longhorn: { enabled: true }
  # generic — install ANY chart, no code change:
  components:
    prometheus:
      chart: { repo: https://prometheus-community.github.io/helm-charts, name: kube-prometheus-stack, version: 65.0.0 }
      values: { grafana: { enabled: false } }
  • The named fields (traefik/cloudflared/argocd/nvidiaDevicePlugin/nfsProvisioner/longhorn) are now explicitly presets — they only fill default chart coordinates on top of the generic path, not baked-in opinion.
  • Generic component: enabled defaults true (listing it opts in; set false to disable without removing); namespace defaults to the release name; a generic entry sharing a preset's name overrides it.
  • enabledComponents merges presets (declaration order) then generic (sorted by name) deterministically, via a shared buildComponentRelease helper. Get/Delete/prune/plan key on release name and work unchanged.
  • #Platform.components? schema entry (chart.repo + chart.name required).

Fully back-compat: existing preset-only specs behave identically (all prior tests pass unchanged).

Remaining

K4(b) — deployment methods as providers (Kustomize/Flux as new kinds) — stays open; tracked in ROADMAP.

Tests

Generic install (chart/ns default-to-name/values thread-through), enabled:false + missing-chart-coords skip (defensive), generic-overrides-preset dedup, preset-then-generic ordering.

Local CI (k8s plugin module): build, go test ./..., gofmt, vet, staticcheck, golangci-lint (0 issues), modernize — all green.

Make Platform install ANY Helm chart with no code change via a generic
`components` map — the Terraform-provider-style path the roadmap calls for.
The named fields (traefik/cloudflared/argocd/nvidia/nfs/longhorn) are now
explicitly PRESETS: default chart coordinates layered on the generic path,
not baked-in opinion.

`components: {<name>: {chart: {repo, name, version?}, namespace?, values?,
wait?, enabled?}}` — enabled defaults true for a listed component (set
false to disable without removing); namespace defaults to the release name;
a generic component sharing a preset's name overrides that preset.
enabledComponents merges presets (declaration order) + generic (sorted by
name) deterministically via a shared buildComponentRelease helper.
#Platform.components? schema entry.

K4(b) — deployment methods as providers (Kustomize/Flux as kinds) — remains.

Tests: generic install (chart/ns/values), enabled:false + missing-chart
skip (defensive), generic-overrides-preset dedup, preset-then-generic order.
@astrojerms
astrojerms merged commit e0e15e1 into main Jul 20, 2026
6 checks passed
@astrojerms
astrojerms deleted the feat/k4a-generic-platform branch July 20, 2026 00:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant