Activate cloud managed resources on demand from InferenceCluster - #429
Draft
negz wants to merge 2 commits into
Draft
Activate cloud managed resources on demand from InferenceCluster#429negz wants to merge 2 commits into
negz wants to merge 2 commits into
Conversation
The Configuration ships one ManagedResourceActivationPolicy that activates every cloud's managed resource kinds. Crossplane v2.4 scales a safe-start provider's runtime to zero until one of its managed resource definitions is active, but activating every kind up front keeps all cloud providers running on every control plane, even one that only ever provisions a single cloud. compose-inference-cluster now composes a policy activating just the kinds the cloud it provisions needs, so a control plane runs a cloud's providers only once it has an InferenceCluster on that cloud. The policy is cluster scoped, so it has to be composed here: a namespaced XR can't compose a cluster-scoped resource, and the cloud cluster XRs (EKSCluster and the rest) are all namespaced. A managed resource composed before its definition's CRD exists fails the whole reconcile, because the API server rejects a custom resource whose CRD doesn't exist. So the function holds off composing the cloud cluster XR until the policy it composed reports Healthy, read back from the observed policy so no definition (each of which carries a full CRD schema) has to be pulled into the request. Healthy means the policy set its definitions Active rather than that their CRDs exist, so a managed resource composed in the brief window before a CRD is served fails its apply and succeeds on the next reconcile; a TODO tracks tightening this to an Established condition once the policy reports one. Once the cluster is observed the function keeps composing it regardless, so a later activation blip never drops a provisioned cluster from desired state and deletes it. Activation is one-way, so dropping the cloud kinds from the shipped policy doesn't deactivate them on a running control plane; existing control planes keep their providers running after an upgrade. The shipped policy is now down to provider-helm and provider-kubernetes, which serve every control plane. Fixes modelplaneai#427. Signed-off-by: Nic Cope <nicc@rk0n.org>
negz
force-pushed
the
activation-energy
branch
from
September 4, 2026 01:07
c010fc5 to
f24843c
Compare
Collaborator
|
an other option is an |
Collaborator
|
can we update e2e test setup too ? remove this workaround: https://github.com/modelplaneai/modelplane/blob/main/e2e/lean-control-plane.yaml#L21-L52 and bump to v2.4.0 crossplane release for project local setup: https://github.com/search?q=repo%3Amodelplaneai%2Fmodelplane+%3D2.3.4&type=code |
The project pinned Crossplane 2.3.4, which activates every managed resource kind and runs every provider. Safe-start providers only scale their runtime to zero once their definitions are inactive from v2.4.0, so the e2e faked that behaviour: a scale-to-zero DeploymentRuntimeConfig and an ImageConfig that forced every cloud provider Deployment to zero replicas, since otherwise the BYO scenario would run a dozen idle cloud controllers in kind. Pinning both the local dev control plane and the e2e to v2.4.0 makes that native. The lean control plane's narrowed MRAP already activates only the provider-helm and provider-kubernetes kinds the BYO compositions use, so the cloud providers' definitions stay inactive and Crossplane scales their controllers to zero on its own. The DeploymentRuntimeConfig and ImageConfig go. Towards modelplaneai#427. Signed-off-by: Nic Cope <nicc@rk0n.org>
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.
Description of your changes
Fixes #427
The Configuration installs one ManagedResourceActivationPolicy that activates every cloud's managed resource kinds. Crossplane v2.4 scales a safe-start provider's runtime to zero until one of its managed resource definitions is active, but activating every kind up front keeps all cloud providers running on every control plane, even one that only ever provisions one cloud.
compose-inference-clusternow composes a policy activating just the kinds the cloud it provisions needs, so a control plane runs a cloud's providers only once it has an InferenceCluster on that cloud. The policy is cluster scoped. A namespaced XR can't compose a cluster-scoped resource, and the cloud cluster XRs (EKSCluster and the rest) are all namespaced, so this cluster-scoped function composes it instead. The base policy drops to provider-helm and provider-kubernetes, which serve every control plane.A managed resource composed before its definition's CRD exists fails the whole reconcile, because the API server rejects a custom resource whose CRD doesn't exist. So the function holds off composing the cloud cluster XR until the policy it composed reports
Healthy, which it reads back from the observed policy rather than pulling in the definitions themselves. Each definition embeds a full CRD schema, so requiring all of them risks a large request.Healthymeans the policy set its definitions Active, not that their CRDs exist yet, so a managed resource composed just before the API server serves its CRD fails its apply and retries. ATODOtracks tightening this to anEstablishedcondition once the policy reports one. Once it has observed the cluster the function keeps composing it regardless, so a later activation blip never drops a provisioned cluster from desired state and deletes it.Activation is one-way, so dropping the cloud kinds from the base policy doesn't deactivate them on a running control plane. Existing control planes keep their providers running after an upgrade. Only new ones get the lazy start.
I have:
nix flake check(or./nix.sh flake check) and made sure it passes.git commit -s.