Sitelet https://github.com/kubernetes/kops/pull/18640
Skip to content

Adding dynamic channel labels - #18640

Merged
kubernetes-prow[bot] merged 6 commits into
kubernetes:masterfrom
cheftako:channelLabels
Aug 1, 2026
Merged

kubernetes-prow[bot] merged 6 commits into
kubernetes:masterfrom
cheftako:channelLabels

Conversation

@cheftako

Copy link
Copy Markdown
Member

Prepare for split control plane IGs. #18597 18597

Removed concept of CCM node as it is dynamic.
Fixed KubController -> KubeController.
Added setting kops role labels on nodes via kops-channel.

make gen-cli-docs
Fixed direct role equality check.
Fixed APIServer label test.

@kubernetes-prow kubernetes-prow Bot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jul 30, 2026
@kubernetes-prow
kubernetes-prow Bot requested a review from hakman July 30, 2026 00:45
@kubernetes-prow
kubernetes-prow Bot requested a review from olemarkus July 30, 2026 00:45
@kubernetes-prow kubernetes-prow Bot added area/channels area/documentation area/provider/gcp Issues or PRs related to gcp provider labels Jul 30, 2026
Comment thread cmd/kops/create_cluster.go
}

// IsKubeControllerManagerOnly checks if instanceGroup runs only KubeControllerManager
func (g *InstanceGroup) IsKubeControllerManagerOnly() bool {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think I commented on the other PR (or it might be pending). It feels like calling IsKubeControllerManagerOnly would be an antipattern, we should be calling HasKubeControllerManager

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Not sure I entirely agree. Maybe it should be private, assuming the packaging works. However I suspect we internally want to run checks on exactly which components are local. For instance we need to know IsKubeControllerManagerOnly && !IsAPIServerOnly to configure load balancing.

Comment thread pkg/apis/kops/instancegroup.go Outdated
return g.Spec.Role.HasKubeControllerManager()
}

// HasKubeControllerManager checks if instanceGroup runs KubeControllerManager

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

A maybe-better name might be RunsKubeControllerManager. Not a blocker though, easy to tweak when we're done.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I like it.

Comment thread pkg/model/gcemodel/context.go Outdated
// HasEtcdOnlyInstanceGroups returns true if the cluster has any Etcd-only instance groups.
func (c *GCEModelContext) HasEtcdOnlyInstanceGroups() bool {
for _, ig := range c.InstanceGroups {
if ig.Spec.Role.HasEtcd() {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should this be IsEtcdOnly ? (This one looks like a blocker, depending on how HasEtcdOnlyInstanceGroups is used)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

https://github.com/kubernetes/kops/pull/18597/changes#diff-18feeb66368bce3894a4538f9cda34a931f0fb76e6e5833f56e8cb71e753cf0dR207 it is used to determine if Etcd is running on a separate IG from the APIServer and there for needs a LB in between. HasEtcd is determining an exact match on the role. So as long as a IG has only 1 role this is correct. When we go to supporting multiple roles for an IG this will need to be fixed.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

IsEtcdOnly on the IG is a wrapper around HasEtcd on the Role. Probably is safer to use that.

Comment thread pkg/nodelabels/builder.go
Comment on lines +31 to +34
// New Experimental control plane roles associated with static manifests
RoleLabelEtcd = "node-role.kubernetes.io/etcd"
RoleLabelScheduler = "node-role.kubernetes.io/scheduler"
RoleLabelKubeControllerManager = "node-role.kubernetes.io/kube-controller-manager"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is there any way to avoiding putting these into node-role.kubernetes.io? That feels like a broader conversation than kops.k8s.io ...

@cheftako cheftako Jul 30, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Point. I was starting to think we should have IG/role labels. Would you be ok with a kops based IG label? I think thats basically what these really are. Tempted to suggest that we use a well know label name and maybe the IG name as the value?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think something like kops.k8s.io/instance-group: foo sounds good to me - is that what you were thinking. @hakman @rifelpet any objections?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

none from me 👍

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I had been thinking more ig-role.kops.k8s.io/api-server: external where external might be the name of that particular IG. kops.k8s.io/instance-group: external allows the role to be looked up by the IG name but I thought having it in the label might be convenient.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Not sure we have use cases for multiple IGs for the same role beyond api-server and node. However we do have those two. Also need to think about what happens if 1 IG satisfies multiple roles. Your suggestion doesn't care. Mine would leave you having multiple labels for that case. Eg ig-role.kops.k8s.io/api-server: internal and ig-role.kops.k8s.io/etcd: internal.

@cheftako cheftako Jul 31, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Chatted with @justinsb, I believe we agreed to the following.
For statically deployed control-plane elements we would use: node-role.kubernetes.io/<type>
For dynamically deployed control-plane elements we would use: node-role.kops.k8s.io/<type>

Justin also pointed out that we already have a flag indicating the instance-group.
kops.k8s.io/instancegroup=<IG name>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The reason was that these give a nice presentation in kubectl get nodes, and this is what they are for.

@kubernetes-prow kubernetes-prow Bot added area/provider/aws Issues or PRs related to aws provider needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Jul 30, 2026
cheftako added 4 commits July 30, 2026 21:33
Removed concept of CCM node as it is dynamic.
Fixed KubController -> KubeController.
Added setting kops role labels on nodes via kops-channel.
Fixed APIServer label test.
Fix IG HasAPIServer to RunsAPIServer
@kubernetes-prow kubernetes-prow Bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 30, 2026
@kubernetes-prow kubernetes-prow Bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jul 30, 2026
@cheftako

Copy link
Copy Markdown
Member Author

/test pull-kops-verify-terraform

@cheftako

Copy link
Copy Markdown
Member Author

/test pull-kops-scenario-splitkcp-gcp

@kubernetes-prow

Copy link
Copy Markdown
Contributor

@cheftako: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-kops-scenario-splitkcp-gcp 8852de9 link false /test pull-kops-scenario-splitkcp-gcp

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

- --v=4
- --yes
- --interval=1m0s
- --node-labels=node-role.kubernetes.io/control-plane

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It does look like this label was not set previously (by kops-channels)...

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

OK, I think I understand. We used to add this in BuildMandatoryControlPlaneLabels, unconditionally. We still do, so technically this flag is not needed, but we're working towards making it a little less magical and a little more explicit, which I think is a good thing.

@justinsb

justinsb commented Aug 1, 2026

Copy link
Copy Markdown
Member

Thanks @cheftako - and thanks for putting up with my node-role flip/flop

/approve
/lgtm

@kubernetes-prow kubernetes-prow Bot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 1, 2026
@kubernetes-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: justinsb

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubernetes-prow kubernetes-prow Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 1, 2026
@kubernetes-prow
kubernetes-prow Bot merged commit a3da178 into kubernetes:master Aug 1, 2026
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. area/api area/channels area/documentation area/provider/aws Issues or PRs related to aws provider area/provider/gcp Issues or PRs related to gcp provider cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants