Adding dynamic channel labels - #18640
Conversation
| } | ||
|
|
||
| // IsKubeControllerManagerOnly checks if instanceGroup runs only KubeControllerManager | ||
| func (g *InstanceGroup) IsKubeControllerManagerOnly() bool { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
| return g.Spec.Role.HasKubeControllerManager() | ||
| } | ||
|
|
||
| // HasKubeControllerManager checks if instanceGroup runs KubeControllerManager |
There was a problem hiding this comment.
A maybe-better name might be RunsKubeControllerManager. Not a blocker though, easy to tweak when we're done.
| // 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() { |
There was a problem hiding this comment.
Should this be IsEtcdOnly ? (This one looks like a blocker, depending on how HasEtcdOnlyInstanceGroups is used)
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
IsEtcdOnly on the IG is a wrapper around HasEtcd on the Role. Probably is safer to use that.
| // 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" |
There was a problem hiding this comment.
Is there any way to avoiding putting these into node-role.kubernetes.io? That feels like a broader conversation than kops.k8s.io ...
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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>
There was a problem hiding this comment.
The reason was that these give a nice presentation in kubectl get nodes, and this is what they are for.
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
|
/test pull-kops-verify-terraform |
|
/test pull-kops-scenario-splitkcp-gcp |
|
@cheftako: The following test failed, say
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. DetailsInstructions 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 |
There was a problem hiding this comment.
It does look like this label was not set previously (by kops-channels)...
There was a problem hiding this comment.
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.
|
Thanks @cheftako - and thanks for putting up with my node-role flip/flop /approve |
|
[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 DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Prepare for split control plane IGs. #18597 18597
make gen-cli-docs
Fixed direct role equality check.
Fixed APIServer label test.