Skip to content

Commit 75f5922

Browse files
committed
Add apiserver role support for GCE
1 parent 3f293c5 commit 75f5922

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

pkg/model/gcemodel/api_loadbalancer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ func (b *APILoadBalancerBuilder) createInternalLB(c *fi.CloudupModelBuilderConte
146146
c.AddTask(hc)
147147
var igms []*gcetasks.InstanceGroupManager
148148
for _, ig := range b.InstanceGroups {
149-
if ig.Spec.Role != kops.InstanceGroupRoleControlPlane {
149+
if !ig.HasAPIServer() {
150150
continue
151151
}
152152
if len(ig.Spec.Zones) > 1 {

pkg/model/gcemodel/autoscalinggroup.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,10 @@ func (b *AutoscalingGroupModelBuilder) buildInstanceTemplate(c *fi.CloudupModelB
214214
t.Tags = append(t.Tags, b.GCETagForRole(kops.InstanceGroupRoleControlPlane))
215215
t.Tags = append(t.Tags, b.GCETagForRole("master"))
216216

217+
case kops.InstanceGroupRoleAPIServer:
218+
t.Scopes = append(t.Scopes, "https://www.googleapis.com/auth/ndev.clouddns.readwrite")
219+
t.Tags = append(t.Tags, b.GCETagForRole(kops.InstanceGroupRoleControlPlane))
220+
217221
case kops.InstanceGroupRoleNode:
218222
t.Tags = append(t.Tags, b.GCETagForRole(kops.InstanceGroupRoleNode))
219223

@@ -349,8 +353,8 @@ func (b *AutoscalingGroupModelBuilder) Build(c *fi.CloudupModelBuilderContext) e
349353
ListManagedInstancesResults: "PAGINATED",
350354
}
351355

352-
// Attach masters to load balancer if we're using one
353-
if ig.Spec.Role == kops.InstanceGroupRoleControlPlane {
356+
// Attach API server instances to load balancer if we're using one
357+
if ig.HasAPIServer() {
354358
if b.UseLoadBalancerForAPI() {
355359
lbSpec := b.Cluster.Spec.API.LoadBalancer
356360
if lbSpec != nil {

0 commit comments

Comments
 (0)