Skip to content

Add scaling support#28

Merged
galt-tr merged 1 commit into
bsv-blockchain:masterfrom
galt-tr:scale
Dec 2, 2025
Merged

Add scaling support#28
galt-tr merged 1 commit into
bsv-blockchain:masterfrom
galt-tr:scale

Conversation

@galt-tr
Copy link
Copy Markdown
Contributor

@galt-tr galt-tr commented Dec 2, 2025

This pull request introduces Kubernetes Horizontal Pod Autoscaler (HPA) and scaling support for the custom resources Asset, Propagation, and SubtreeValidator. It enhances their CRDs and controllers to support the /scale subresource, exposes replica and selector status fields, and improves usability with extra status columns and better error handling. Additionally, it standardizes default replica counts across various deployment specs and improves sample manifests.

Kubernetes scaling and CRD enhancements:

  • Added replicas and selector status fields to the AssetStatus, PropagationStatus, and SubtreeValidatorStatus structs, and enabled the /scale subresource in their CRDs, allowing native Kubernetes scaling and HPA support. [1] [2] [3] [4] [5] [6]
  • Enhanced the Propagation CRD with additional printer columns for desired/current replicas, ready status, and age to improve kubectl get usability.

Controller and operator improvements:

  • Updated the AssetReconciler to synchronize replica and selector status from the underlying deployment, and to requeue reconciliation if the desired and actual replica counts differ, ensuring accurate scaling status reporting. [1] [2]
  • Added event filtering to the AssetReconciler to only trigger reconciliations on generation changes, reducing unnecessary reconciles.
  • Improved error handling in the BlockchainReconciler to detect and gracefully handle connection errors when running out-of-cluster, avoiding aggressive requeues. [1] [2]

Deployment spec standardization:

  • Standardized the default number of replicas for Asset, BlockAssembly, Blockchain, BlockPersister, and BlockValidator deployments by referencing new constants, improving consistency and configurability. [1] [2] [3] [4] [5] [6] [7]

Sample and configuration updates:

  • Updated the sample Propagation manifest to include resource requests/limits and replica fields, aligning it with the new scaling capabilities.

Operator initialization and scheme registration:

  • Refactored scheme registration in main.go to explicitly add necessary API schemes and changed the default health probe port. [1] [2] [3] [4] [5]

@galt-tr galt-tr requested a review from mrz1836 as a code owner December 2, 2025 14:12
@github-actions github-actions Bot added fork-pr PR originated from a forked repository requires-manual-review PR or issue requires manual review by a maintainer or security team labels Dec 2, 2025
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Dec 2, 2025

👋 Thanks, @galt-tr!

This pull request comes from a fork. For security, our CI runs in a restricted mode.
A maintainer will triage this shortly and run any additional checks as needed.

  • 🏷️ Labeled: fork-pr, requires-manual-review
  • 👀 We'll review and follow up here if anything else is needed.

Thanks for contributing to bsv-blockchain/teranode-operator! 🚀

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Dec 2, 2025

@galt-tr galt-tr merged commit 2bf28de into bsv-blockchain:master Dec 2, 2025
34 of 37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fork-pr PR originated from a forked repository requires-manual-review PR or issue requires manual review by a maintainer or security team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants