-
v0.1.0 Stable
released this
2026-11-28 20:32:40 +00:00 | 44 commits to main since this releaseAdded
- Package
apiswith the bootstrap, user data, secret reference and kubelet reservation types shared by the node class CRDs, and helpers that read resolved entries against a condition's observed generation. A secret reference'snamespace,nameandkeymust each be non-empty. - The
bootstrap/tokenpackage mints k0s worker join tokens from a bootstrap token Secret or a k0smotron JoinTokenRequest. Releasing a NodeClaim's bootstrap token deletes its Secrets inkube-systemthrough an uncached reader given withWithSecretReader, so a provider needs list and delete on Secrets there. - The
bootstrappackage renders the cloud-init multipart user data of a k0s worker join: a boothook that writes the join token, node name and register taints tojoin.envonce, the node class'sbeforeJoin,joinandafterJoinparts, a generated join fork0sVersionunlessjoinreplaces it, and the provider's own parts. The provider sets thejoin.envpath, the metadata URLs of the instance ID and, optionally, the zone (IPv6 hosts included), the provider ID scheme and the most bytes the cloud stores. - The generated join retries the metadata service, fails before installing k0s when it returns an empty or blank instance ID or zone or the k0s install script cannot be fetched, and registers the node as
<scheme>://<instance ID>, or<scheme>://<zone>/<instance ID>when a zone URL is set. Renderer.UserDatarefuses ajoin.envvalue holding a line break, a node name that is not a DNS-1123 subdomain, and a document above the size limit;NewRendererrefuses a provider part whose filename or content type is malformed.bootstrap.ResolvePartsreads a node class's Secret parts live through the reader it is given, andbootstrap.Referencingfinds the node classes whose parts read a given Secret, for a metadata-only Secret watch.bootstrap.Joinerresolves the parts, mints a join token and renders the user data, releasing the token when the document is refused.- Package
catalogue: an instance type cache over a provider'sSource, read whole or zone by zone, refreshed after a TTL by one fetch at a time, serving the last good result of a failing fetch or zone until a retry interval passes, and listing per node class with its zones, capacity, overhead and the offerings marked unavailable; each listed type's zone and capacity type requirements hold the values of its listed offerings only. - The
cloudproviderpackage gives a provider's CloudProvider the shared repair policies, a node class lookup that reports a missing node class asNodeClassNotReady,CreateErrormapping a failed create onto Karpenter's error types and a Launched reason (nodenameerrors included),Launch, configured by aLauncher, that tries ranked offerings in order, marks refused ones unavailable, runs the cleanup of each attempt that created no instance, and turns a panic in an attempt into its error,ErrNoInstanceon every error that says no instance was created,Hydratefor the labels and capacity of a launched NodeClaim,HydrateAtfor those of an instance found running at aPlacement, its type in the catalogue or not,FirstDriftfor an ordered drift table, andCleanupContextfor undoing a failed create. - The
apppackage runs a provider's controller:Runbuilds Karpenter's operator, wires the provider's CloudProvider into the core controllers, adds the provider's own controllers, stops on SIGTERM or SIGINT, and returns every failure as an error. - The
controllers/nodeclaimhashpackage stamps NodeClaims with their node class hash and hash version, and itsHashSpechashes a node class spec. - The
controllers/orphanpackage deletes the cluster's instances whose NodeClaim is gone or holds another instance. It refuses a sweep when no instance belongs to an existing NodeClaim, and per sweep deletes at most half of the cluster's instances old enough to judge, rounded down but at least one, oldest first. - The
controllers/jointokenpackage releases a NodeClaim's join token once it registers or is deleted. internal/exampleis a worked example of a provider built on kit, against an in-memory cloud.cloudprovider.NodeClassrefuses a reference to another group or kind withErrForeignNodeClass, so a provider'sGetInstanceTypescan answer another provider's node pool with no instance types and no error.cloudprovider.Launcherrecords each launch try as a create in itsMetrics: result, duration and, for a failure, the coderefused,no_instanceorother.metrics.WithHelpsets the HELP text of one series, keyed by ametrics.Seriesconstant, so a provider keeps its existing help texts.- Package
metricsregisters and records the series every provider emits (create, delete, drift, instance type cache and price, image resolution errors, orphan deletions and refused sweeps) underkarpenter_<provider>_, with the created resource's noun configurable. - The
nodenamepackage renders node name templates against a node class, a NodeClaim and the provider's own fields, where a label a template reads and the object lacks is an error. It picks a random rendered name that no Node, no provider instance and no launch in flight holds, and refuses a name released since the launch began listing.nodename.Validatefails what fails every launch, and checks the DNS label shape only of a template that cannot vary per launch, so a pass says nothing about the names real launches get. - The
apis.NodeNamestype carries thenodeNameTemplatesfield for a provider to embed inline in its node class spec. - The
offeringpackage: a TTL cache of offerings a cloud refused, keyed by instance type, zone and capacity type, and a deterministic cheapest-first ranking of launchable offerings. - Package
operatorloads the environment settings every provider shares, withCLUSTER_NAMErequired to be a valid Kubernetes label value, builds the API HTTP client with fixed transport limits, redacts secrets, and refuses to start against the wrong cluster. - Package
overhead: the kube-reserved, system-reserved and eviction overhead of an instance type from a node class'sKubeletConfiguration, with the kubelet's defaults and percentage arithmetic, and the allocatable that leaves, never below zero.Forcaps the overhead per resource at the capacity, filling kube-reserved, then system-reserved, then the eviction threshold, so Karpenter's own allocatable matchesAllocatable; a resource absent from the capacity has no overhead entry. - The
ownershippackage marks and recognises a cluster's instances by thekarpenter.sh/*keys, as labels or askey=valuetags. - The
provideridpackage formats and parses<scheme>://<id>provider IDs. - Package
typename: instance type names as<provider>-<native name>(vultr-voc-c-4c-8gb-75s-amd), so a NodeClaim's type shows which cloud it comes from, and the reverse for API calls. - Reusable Forgejo workflows for the providers:
go-ci.yaml(flake checks, builds, stale-generation checks, changelog validation),go-security.yaml(govulncheck) andgo-release.yaml(changelog-driven release commit, per-arch image and index, chart, then release and tag), each configured by its inputs.go-release.yamlis called by itshttps://URL from a job withruns-onandenable-openid-connect, which is the form that gives its jobs an OIDC token for the registry.
Downloads
-
Source code (ZIP)
0 downloads
-
Source code (TAR.GZ)
0 downloads
- Package