Skip to content

chore(controllers): Do not run controlplane specific controllers on workers#1738

Merged
HomayoonAlimohammadi merged 2 commits into
mainfrom
KU-3933/separate-controllers
Jan 18, 2026
Merged

chore(controllers): Do not run controlplane specific controllers on workers#1738
HomayoonAlimohammadi merged 2 commits into
mainfrom
KU-3933/separate-controllers

Conversation

@HomayoonAlimohammadi

@HomayoonAlimohammadi HomayoonAlimohammadi commented Aug 11, 2025

Copy link
Copy Markdown
Contributor

Overview

This PR prevents control plane specific controllers from running on workers. The coordinator is refactored a bit to better separate controller options as well.

@HomayoonAlimohammadi HomayoonAlimohammadi requested a review from a team as a code owner August 11, 2025 09:03
@HomayoonAlimohammadi HomayoonAlimohammadi marked this pull request as draft August 11, 2025 09:27
@HomayoonAlimohammadi HomayoonAlimohammadi force-pushed the KU-3933/separate-controllers branch from fd02061 to 705a40d Compare August 11, 2025 10:08
@HomayoonAlimohammadi HomayoonAlimohammadi changed the title refactor: Separate controlplane specific controllers chore(controllers): Do not run controlplane specific controllers on workers Aug 11, 2025
@HomayoonAlimohammadi HomayoonAlimohammadi marked this pull request as ready for review August 11, 2025 10:10

@bschimke95 bschimke95 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bschimke95

Copy link
Copy Markdown
Contributor

@HomayoonAlimohammadi should we really backport this? I understand that this is not really a bugfix but just a cleanup.

@bschimke95

Copy link
Copy Markdown
Contributor

@HomayoonAlimohammadi let's bring this PR over the finish line, rebase and merge it.

@HomayoonAlimohammadi HomayoonAlimohammadi force-pushed the KU-3933/separate-controllers branch from 531079c to 1a19f8e Compare January 15, 2026 14:04
Copilot AI review requested due to automatic review settings January 15, 2026 14:04
@HomayoonAlimohammadi

Copy link
Copy Markdown
Contributor Author

@bschimke95 I've rebased on top of main (had to account for the new DNSRebalancer controller).

…stinct structs for clarity

Signed-off-by: Homayoon (Hue) Alimohammadi <homayoon.alimohammadi@canonical.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR prevents control plane specific controllers (upgrade, CSR signing, DNS rebalancer) from running on worker nodes by adding an early return in the coordinator's Run method when the node is a worker. The coordinator is refactored to use structured option types for better organization of controller configuration.

Changes:

  • Added worker node detection in the coordinator to skip controller setup on workers
  • Refactored controller options into dedicated structs (UpgradeControllerOptions, CSRSigningControllerOptions, DNSRebalancerControllerOptions)
  • Moved log statement for node failure domain reconciliation inside the control plane check in node_label controller

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
src/k8s/pkg/k8sd/controllers/coordinator.go Adds worker detection and structured controller option types; skips controller setup on workers
src/k8s/pkg/k8sd/app/app.go Updates coordinator initialization to use new structured option types
src/k8s/pkg/k8sd/app/hooks_start.go Adds nil check for controllerCoordinator before starting
src/k8s/pkg/k8sd/controllers/node_label.go Moves log message inside control plane check to avoid logging on workers

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/k8s/pkg/k8sd/app/app.go
Comment thread src/k8s/pkg/k8sd/app/app.go
Comment thread src/k8s/pkg/k8sd/app/app.go

@bschimke95 bschimke95 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, if CI is happy.

Signed-off-by: Homayoon (Hue) Alimohammadi <homayoon.alimohammadi@canonical.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/k8s/pkg/k8sd/app/app.go
@HomayoonAlimohammadi HomayoonAlimohammadi merged commit de6ae80 into main Jan 18, 2026
107 of 108 checks passed
@HomayoonAlimohammadi HomayoonAlimohammadi deleted the KU-3933/separate-controllers branch January 18, 2026 14:43
@cdkbot

cdkbot commented Jan 18, 2026

Copy link
Copy Markdown
Collaborator

Backport failed for release-1.32, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin release-1.32
git worktree add -d .worktree/backport-1738-to-release-1.32 origin/release-1.32
cd .worktree/backport-1738-to-release-1.32
git switch --create backport-1738-to-release-1.32
git cherry-pick -x 5491a5e28b96eca96bb319f8721cba443a24d06b 863546278795e17a279c81e7f1479d68ee752dd1

@cdkbot

cdkbot commented Jan 18, 2026

Copy link
Copy Markdown
Collaborator

Backport failed for release-1.33, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin release-1.33
git worktree add -d .worktree/backport-1738-to-release-1.33 origin/release-1.33
cd .worktree/backport-1738-to-release-1.33
git switch --create backport-1738-to-release-1.33
git cherry-pick -x 5491a5e28b96eca96bb319f8721cba443a24d06b 863546278795e17a279c81e7f1479d68ee752dd1

@HomayoonAlimohammadi

Copy link
Copy Markdown
Contributor Author

Doesn't need backporting. The labels were added by mistake a long time ago. Luckily the backport PRs failed to get created.

nhennigan pushed a commit to nhennigan/k8s-snap that referenced this pull request Jan 20, 2026
…orkers (canonical#1738)

Signed-off-by: Homayoon (Hue) Alimohammadi <homayoon.alimohammadi@canonical.com>
bschimke95 added a commit to canonical/k8sd that referenced this pull request Jan 28, 2026
…stinct structs for clarity

Copied over from canonical/k8s-snap#1738 since
it got merged after k8sd was moved out of the k8s-snap.
bschimke95 added a commit to canonical/k8sd that referenced this pull request Jan 28, 2026
…stinct structs for clarity (#8)

Copied over from canonical/k8s-snap#1738 since
it got merged after k8sd was moved out of the k8s-snap.
ktsakalozos-canonical pushed a commit to canonical/k8sd that referenced this pull request May 28, 2026
…stinct structs for clarity (#8)

Copied over from canonical/k8s-snap#1738 since
it got merged after k8sd was moved out of the k8s-snap.
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.

4 participants