Skip to content

feat: Horizontal scaling - #285

Draft
saini-prakhyat wants to merge 8 commits into
crossplane-contrib:mainfrom
guidewire-oss:feat/pt-horizontal-scaling
Draft

feat: Horizontal scaling#285
saini-prakhyat wants to merge 8 commits into
crossplane-contrib:mainfrom
guidewire-oss:feat/pt-horizontal-scaling

Conversation

@saini-prakhyat

Copy link
Copy Markdown

Description of your changes

Fixes #

I have:

  • Read and followed Crossplane's contribution process.
  • Run make reviewable to ensure this PR is ready for review.

How has this code been tested

A single provider pod's terraform throughput is the scaling ceiling;
running N instances requires each to watch a disjoint set of Workspaces
and elect its own leader independently.

--watch-label-selector scopes the manager cache to matching Workspaces,
via cache.Options.ByObject rather than DefaultLabelSelector -- the latter
would filter every cached type (ProviderConfigs, Secrets, the leader
election Lease itself), not just Workspaces.

--leader-election-id replaces the previously hardcoded lease name.
Without a distinct value per instance, all instances' pods would race
for one lease cluster-wide, leaving every instance but one with zero
active reconcilers -- not degraded HA, a silent total outage for those
shards.

Both flags default to today's exact values, so an unmodified
single-instance deployment is unaffected.

Signed-off-by: Prakhyat Saini <sainiprakhyat045@gmail.com>
Relabeling a Workspace to a new shard mid-apply is already safe today
(no destroy is triggered, and the Terraform state lock serializes any
overlap), but it's noisy -- the new owner fails against the held lock --
and a crash leaves a stale lock needing a manual force-unlock.

Adds a per-Workspace ownership claim, stored in a dedicated
coordination.k8s.io/v1 Lease (internal/claims), guarding every Apply and
Destroy. A fresh foreign claim defers the run; a stale one is stolen,
with ForceUnlock (internal/terraform) automatically clearing the dead
owner's state lock first. Off by default (--enable-ownership-claims);
when off, this is a pure pass-through with no behavioral change.

Signed-off-by: Prakhyat Saini <sainiprakhyat045@gmail.com>
Signed-off-by: Prakhyat Saini <sainiprakhyat045@gmail.com>
@saini-prakhyat saini-prakhyat changed the title Feat/pt horizontal scaling feat: Horizontal scaling Jul 6, 2026
saini-prakhyat and others added 5 commits July 6, 2026 16:18
Signed-off-by: Pavithra CP <cppavithra05@gmail.com>
Co-authored-by: Paul Joseph <k.paul.joseph@gmail.com>
…lector crash

Signed-off-by: Tejas M D <tejasmd22@gmail.com>
…belled mid-apply

Signed-off-by: Sumanth Bhat <sumanth1198@gmail.com>
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.

3 participants