Skip to content

karpenter: add the plugin module and its view of the capacity API - #1117

Open
Israel Miller (imiller31) wants to merge 1 commit into
mainfrom
ismille/karpenter-plugin-module
Open

Israel Miller (imiller31) wants to merge 1 commit into
mainfrom
ismille/karpenter-plugin-module

Conversation

@imiller31

Copy link
Copy Markdown
Contributor

First of four stacked PRs that add the Unbounded Karpenter plugin: upstream Karpenter compiled with one cloud provider that uses only MachineClass and MachineAllocation. It has no cloud SDK and no per-provider code, so one plugin works with every provider that serves those two resources.

This PR adds the module and the types it reads. Nothing runs yet.

What changed

  • Nested module (plugins/karpenter). Upstream Karpenter pins older Kubernetes libraries than the root module, so the plugin is its own Go module and does not import the root module.
  • Capacity projection (internal/capacity). The MachineClass offering and MachineAllocation fields the plugin reads and writes. contract_test.go checks them against the generated CRDs in deploy/machina/crd, so a schema change that the projection misses fails the test.
  • NodeClass (internal/nodeclass). MachineClass is used directly as the Karpenter NodeClass, with no wrapper CRD. It reports Ready only when its Ready condition was observed for the current generation.
  • Build and CI. make karpenter, karpenter-fmt, karpenter-lint and karpenter-test delegate to the module's Makefile. The CI lint and test jobs run the lint and test targets, because the root targets do not cover a nested module.

Testing

make karpenter (lint and unit tests).

Start the Unbounded Karpenter plugin as a nested Go module, because
upstream Karpenter pins older Kubernetes libraries than the root module.
The module does not import the root module. It projects the MachineClass
and MachineAllocation fields it uses, and a contract test checks those
projections against the generated CRDs.

MachineClass is the Karpenter NodeClass: it is ready only when its Ready
condition was observed for the current generation.

CI lints and tests the module through make karpenter-lint and
make karpenter-test.

This branch has not been deployed

No deployments
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