-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Adding dynamic channel labels #18640
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
1b1e61e
d1bd839
f24f248
64dcbbd
8852de9
2b515b4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -67,10 +67,8 @@ const ( | |
| InstanceGroupRoleEtcd InstanceGroupRole = "Etcd" | ||
| // InstanceGroupRoleScheduler is a Scheduler role. | ||
| InstanceGroupRoleScheduler InstanceGroupRole = "Scheduler" | ||
| // InstanceGroupRoleCloudControllerManager is a CloudControllerManager role. | ||
| InstanceGroupRoleCloudControllerManager InstanceGroupRole = "CloudControllerManager" | ||
| // InstanceGroupRoleKubControllerManager is a KubControllerManager role. | ||
| InstanceGroupRoleKubControllerManager InstanceGroupRole = "KubControllerManager" | ||
| // InstanceGroupRoleKubeControllerManager is a KubeControllerManager role. | ||
| InstanceGroupRoleKubeControllerManager InstanceGroupRole = "KubeControllerManager" | ||
| ) | ||
|
|
||
| // AllInstanceGroupRoles is a slice of all valid InstanceGroupRole values | ||
|
|
@@ -79,6 +77,9 @@ var AllInstanceGroupRoles = []InstanceGroupRole{ | |
| InstanceGroupRoleAPIServer, | ||
| InstanceGroupRoleNode, | ||
| InstanceGroupRoleBastion, | ||
| InstanceGroupRoleEtcd, | ||
| InstanceGroupRoleScheduler, | ||
| InstanceGroupRoleKubeControllerManager, | ||
| } | ||
|
|
||
| func (r InstanceGroupRole) HasControlPlane() bool { | ||
|
|
@@ -105,16 +106,12 @@ func (r InstanceGroupRole) HasScheduler() bool { | |
| return r == InstanceGroupRoleScheduler | ||
| } | ||
|
|
||
| func (r InstanceGroupRole) HasCloudControllerManager() bool { | ||
| return r == InstanceGroupRoleCloudControllerManager | ||
| } | ||
|
|
||
| func (r InstanceGroupRole) HasKubControllerManager() bool { | ||
| return r == InstanceGroupRoleKubControllerManager | ||
| func (r InstanceGroupRole) HasKubeControllerManager() bool { | ||
| return r == InstanceGroupRoleKubeControllerManager | ||
| } | ||
|
|
||
| func (r InstanceGroupRole) IsControlPlaneType() bool { | ||
| return r.HasControlPlane() || r.HasAPIServer() | ||
| return r.HasControlPlane() || r.HasAPIServer() || r.HasEtcd() || r.HasScheduler() || r.HasKubeControllerManager() | ||
| } | ||
|
|
||
| const ( | ||
|
|
@@ -408,10 +405,40 @@ func (g *InstanceGroup) IsAPIServerOnly() bool { | |
| } | ||
|
|
||
| // hasAPIServer checks if instanceGroup runs an API Server | ||
| func (g *InstanceGroup) HasAPIServer() bool { | ||
| func (g *InstanceGroup) RunsAPIServer() bool { | ||
| return g.IsControlPlane() || g.IsAPIServerOnly() | ||
| } | ||
|
|
||
| // IsEtcdOnly checks if instanceGroup runs only Etcd | ||
| func (g *InstanceGroup) IsEtcdOnly() bool { | ||
| return g.Spec.Role.HasEtcd() | ||
| } | ||
|
|
||
| // HasEtcd checks if instanceGroup runs Etcd | ||
| func (g *InstanceGroup) RunsEtcd() bool { | ||
| return g.IsControlPlane() || g.IsEtcdOnly() | ||
| } | ||
|
|
||
| // IsSchedulerOnly checks if instanceGroup runs only Scheduler | ||
| func (g *InstanceGroup) IsSchedulerOnly() bool { | ||
| return g.Spec.Role.HasScheduler() | ||
| } | ||
|
|
||
| // HasScheduler checks if instanceGroup runs Scheduler | ||
| func (g *InstanceGroup) RunsScheduler() bool { | ||
| return g.IsControlPlane() || g.IsSchedulerOnly() | ||
| } | ||
|
|
||
| // IsKubeControllerManagerOnly checks if instanceGroup runs only KubeControllerManager | ||
| func (g *InstanceGroup) IsKubeControllerManagerOnly() bool { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
| return g.Spec.Role.HasKubeControllerManager() | ||
| } | ||
|
|
||
| // RunsKubeControllerManager checks if instanceGroup runs KubeControllerManager | ||
| func (g *InstanceGroup) RunsKubeControllerManager() bool { | ||
| return g.IsControlPlane() || g.IsKubeControllerManagerOnly() | ||
| } | ||
|
|
||
| // HasGVisor checks if instanceGroup is a worker that has the gVisor (runsc) runtime enabled. | ||
| // gVisor is only valid on workers; ValidateInstanceGroup rejects it on other roles. | ||
| func (g *InstanceGroup) HasGVisor() bool { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.