feat(k8s): Kustomize deployment kind — methods as providers (K4b)#156
Merged
Conversation
Add a Kustomize kind to plugins/k8s, proving the K4(b) intent that deployment *methods* are just providers/kinds (alongside HelmRelease, Manifest, Argo) rather than bespoke platform code. - spec.files is an in-memory kustomization tree (path -> content); renderKustomization builds it with sigs.k8s.io/kustomize/api (krusty over an in-memory filesystem — no temp dirs, no network) into object YAML. spec.path picks the build dir (default "."). - The rendered objects flow through the SHARED Manifest object-apply core: factored applyObjectSet / getObjectSet from applyManifest / getManifest (both are "a set of applied cluster objects"), so a Kustomize is a Manifest whose content is computed. Delete/state are identical. manifestObserved gains a kind param. - #Kustomize CUE schema; registered in Handshake + Apply/Get/Delete dispatch. examples/kustomize-app.yaml demonstrates it. kustomize/api was already an indirect dep (v0.18 -> v0.21.1 upgrade), so the footprint change is modest. Flux and other methods follow the same pattern as future kinds — no framework change. Bounded per K5 (homelab PaaS via methods-as-providers). Tests: renderKustomization (transforms applied, overlay build-dir, invalid-kustomization errors), spec.files parsing; existing Manifest tests unchanged (shared core intact).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
K4(b) — deployment methods as providers
Adds a Kustomize kind to
plugins/k8s, proving the K4(b) intent (and the K5 homelab-PaaS direction): a deployment method is just a provider/kind, alongside HelmRelease / Manifest / Argo — not bespoke platform code.How
spec.files(path → content) is an in-memory kustomization tree;renderKustomizationbuilds it withsigs.k8s.io/kustomize/api(krusty over an in-memory filesystem — no temp dirs, no network) into object YAML.spec.pathselects the build dir (default., supports overlays).applyObjectSet/getObjectSetout ofapplyManifest/getManifest(both kinds are "a set of applied cluster objects"), so a Kustomize is literally a Manifest whose content is computed. Delete/state are identical;manifestObservedgained akindparam.#KustomizeCUE schema; registered inHandshake+Apply/Get/Delete.examples/kustomize-app.yamldemonstrates it.Dependency
kustomize/apiwas already an indirect dep (v0.18 → v0.21.1 upgrade), so the footprint change is modest — consistent with the plugin's existing helm/cli-runtime deps.Scope
Flux and other methods follow the same pattern as future kinds — no framework change. This completes K4 (a + b).
Tests
renderKustomization(transforms applied, overlay build-dir, invalid-kustomization errors),spec.filesparsing; the existing Manifest tests are unchanged (the shared core is intact).Local CI (k8s plugin module): build,
go test ./..., gofmt, vet, staticcheck, golangci-lint (0 issues), modernize — all green.