Repository navigation
fix(k8s): don't copy autoscalers or disruption budgets into bridges - #16
Merged
Merged
Conversation
Bridging from source manifests copied every resource in them, including the service's HorizontalPodAutoscaler and PodDisruptionBudget. Those still act on the source workload after the bridge transforms (an HPA's scaleTargetRef and a PDB's selector name the real Deployment and pods), so each bridge broke the real service while it existed: its HPA reported AmbiguousSelector and stopped scaling, and its pods, covered by more than one PDB, couldn't be evicted. CreateBridge now strips HPAs, PDBs and KEDA ScaledObjects before anything else. A bridge is a single pod with nothing to scale. #12 already removes any that existing bridges created, on bridge remove. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.
Bridging from source manifests (
bridge create --source) copied every resource in them, including the service's HorizontalPodAutoscaler and PodDisruptionBudget. The transforms rename those copies, but they still act on the source workload: an HPA'sscaleTargetRefand a PDB's selector name the real Deployment and its pods. So every bridge broke the real service while it existed:AmbiguousSelectorand stopped scaling (venus'sapi-managed-drivesis in this state now)MultiplePodDisruptionBudgetsevents on venus'sapi-sandboxespods)Change
CreateBridgeruns a newStripScalingResourcestransform first, which drops HPAs, PDBs and KEDA ScaledObjects from the bundle. A bridge is a single pod with nothing to scale.SourceFromNamespaceonly ever copies the Deployment, so only--sourcebridges were affected.#12 already deletes any that existing bridges created, on
bridge remove.Rollout
Venus's administrator has been running since 2026-07-02, before #12, so
bridge removethere still leaves these behind. There are 1,041 HPAs and 1,635 PDBs from bridges that no longer exist. It runsbridge-cli:latestwithimagePullPolicy: Always, so restarting it picks up #12, #15 and this. The existing orphans need a one-time cleanup, since their bridges are gone and nothing will call remove for them.Testing
TestStripScalingResources: a packed source with a Deployment, Service, HPA, PDB and ScaledObject parses to five resources, and only the Deployment and Service survive the transform.go vet, andgo test ./pkg/k8s/resources/ ./pkg/commands/pass.🤖 Generated with Claude Code