Skip to content

Comments

Feature: Add label-driven YurtHub installation controller#2506

Open
SamyakBorkar wants to merge 2 commits intoopenyurtio:masterfrom
SamyakBorkar:feature/label-driven-yurthub-installation
Open

Feature: Add label-driven YurtHub installation controller#2506
SamyakBorkar wants to merge 2 commits intoopenyurtio:masterfrom
SamyakBorkar:feature/label-driven-yurthub-installation

Conversation

@SamyakBorkar
Copy link

What type of PR is this?

/kind feature

What this PR does / why we need it:

This PR implements automatic YurtHub installation/uninstallation based on node labels.

Problem: Currently, YurtHub requires yurtadm join, which:

  • Doesn't work on existing Kubernetes nodes
  • Is incompatible with third-party cluster management tools
  • Requires manual intervention per node

Solution: New controller that watches for openyurt.io/is-edge-worker=true label and automatically:

  • Creates Kubernetes Job to install YurtHub via node-servant
  • Tracks installation status with node annotations
  • Uninstalls when label is removed

Usage:

# Convert any node to edge node
kubectl label node <name> openyurt.io/is-edge-worker=true

# Revert back
kubectl label node <name> openyurt.io/is-edge-worker-

Why this matters:

✅ Works with ANY Kubernetes cluster/management tool
✅ No downtime or cluster rejoining needed
✅ Declarative and Kubernetes-native
✅ Scales to hundreds of nodes easily

Which issue(s) this PR fixes:
Fixes #2494

Special notes for your reviewer:
Implementation highlights:

  • Reuses existing node-servant infrastructure (convert/revert commands)
  • Disabled by default (opt-in via --enable-yurthub-installer=true)
  • Comprehensive error handling and event emission
  • Unit tests for controller logic included
  • Full RBAC permissions defined

Documentation:

  • Detailed proposal document: docs/proposals/20260122-label-driven-yurthub-installation.md
  • Controller README: pkg/yurtmanager/controller/yurthubinstaller/README.md
  • Usage examples: docs/examples/yurthub-auto-install-example.yaml

Testing:

File summary:

  • 13 files changed, 1490 insertions
  • Controller implementation: ~440 lines
  • Unit tests: ~270 lines
  • Documentation: ~500 lines
  • Configuration integration: ~80 lines

Does this PR introduce a user-facing change?
Yes.

This PR introduces a label-driven mechanism that allows users to
automatically install or uninstall YurtHub on edge nodes by applying
or removing a Kubernetes node label.

This commit implements a Kubernetes-native mechanism for automatically
installing and uninstalling YurtHub on edge nodes based on node labels.

Key features:
- Automatic YurtHub installation when openyurt.io/is-edge-worker=true
- Automatic uninstallation when label is removed
- Uses Kubernetes Jobs with node-servant for remote installation
- Status tracking via node annotations
- Configurable via yurt-manager flags
- Comprehensive tests and documentation

Benefits:
- Works on existing K8s nodes without rejoining cluster
- Compatible with any K8s management tool
- Declarative, label-based management
- Supports bulk operations

Fixes openyurtio#2494

Signed-off-by: SamyakBorkar <2022bit037@sggs.ac.in>
@SamyakBorkar SamyakBorkar requested a review from a team as a code owner January 22, 2026 19:00
@sonarqubecloud
Copy link

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.

[feature request] Implement Label-Driven Automated Installation and Uninstallation of YurtHub on Edge Nodes

1 participant