mirror of https://github.com/kubernetes/kops.git
include kube-apiserver controlplane ports in dns=none
This commit is contained in:
parent
99d2bfd4e3
commit
75659b6280
|
|
@ -201,7 +201,7 @@ func (b *ServerGroupModelBuilder) buildInstances(c *fi.CloudupModelBuilderContex
|
||||||
c.AddTask(portTask)
|
c.AddTask(portTask)
|
||||||
|
|
||||||
if b.Cluster.UsesNoneDNS() && ig.Spec.Role == kops.InstanceGroupRoleControlPlane {
|
if b.Cluster.UsesNoneDNS() && ig.Spec.Role == kops.InstanceGroupRoleControlPlane {
|
||||||
portTask.ForAPIServer = true
|
portTask.WellKnownServices = append(portTask.WellKnownServices, wellknownservices.KubeAPIServer)
|
||||||
}
|
}
|
||||||
|
|
||||||
metaWithName := make(map[string]string)
|
metaWithName := make(map[string]string)
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,7 @@ import (
|
||||||
secgroup "github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/security/groups"
|
secgroup "github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/security/groups"
|
||||||
"github.com/gophercloud/gophercloud/openstack/networking/v2/ports"
|
"github.com/gophercloud/gophercloud/openstack/networking/v2/ports"
|
||||||
"k8s.io/klog/v2"
|
"k8s.io/klog/v2"
|
||||||
|
"k8s.io/kops/pkg/wellknownservices"
|
||||||
"k8s.io/kops/upup/pkg/fi"
|
"k8s.io/kops/upup/pkg/fi"
|
||||||
"k8s.io/kops/upup/pkg/fi/cloudup/openstack"
|
"k8s.io/kops/upup/pkg/fi/cloudup/openstack"
|
||||||
)
|
)
|
||||||
|
|
@ -39,8 +40,11 @@ type Port struct {
|
||||||
AdditionalSecurityGroups []string
|
AdditionalSecurityGroups []string
|
||||||
Lifecycle fi.Lifecycle
|
Lifecycle fi.Lifecycle
|
||||||
Tags []string
|
Tags []string
|
||||||
ForAPIServer bool
|
|
||||||
AllowedAddressPairs []ports.AddressPair
|
AllowedAddressPairs []ports.AddressPair
|
||||||
|
|
||||||
|
// WellKnownServices indicates which services are supported by this resource.
|
||||||
|
// This field is internal and is not rendered to the cloud.
|
||||||
|
WellKnownServices []wellknownservices.WellKnownService
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetDependencies returns the dependencies of the Port task
|
// GetDependencies returns the dependencies of the Port task
|
||||||
|
|
@ -84,8 +88,8 @@ func (s *Port) FindAddresses(context *fi.CloudupContext) ([]string, error) {
|
||||||
|
|
||||||
// GetWellKnownServices implements fi.HasAddress::GetWellKnownServices.
|
// GetWellKnownServices implements fi.HasAddress::GetWellKnownServices.
|
||||||
// It indicates which services we support with this load balancer.
|
// It indicates which services we support with this load balancer.
|
||||||
func (s *Port) GetWellKnownServices() bool {
|
func (s *Port) GetWellKnownServices() []wellknownservices.WellKnownService {
|
||||||
return s.ForAPIServer
|
return s.WellKnownServices
|
||||||
}
|
}
|
||||||
|
|
||||||
// getActualAllowedAddressPairs returns the actual allowed address pairs which kOps currently manages.
|
// getActualAllowedAddressPairs returns the actual allowed address pairs which kOps currently manages.
|
||||||
|
|
@ -190,7 +194,7 @@ func newPortTaskFromCloud(cloud openstack.OpenstackCloud, lifecycle fi.Lifecycle
|
||||||
find.ID = actual.ID
|
find.ID = actual.ID
|
||||||
actual.InstanceGroupName = find.InstanceGroupName
|
actual.InstanceGroupName = find.InstanceGroupName
|
||||||
actual.AdditionalSecurityGroups = find.AdditionalSecurityGroups
|
actual.AdditionalSecurityGroups = find.AdditionalSecurityGroups
|
||||||
actual.ForAPIServer = find.ForAPIServer
|
actual.WellKnownServices = find.WellKnownServices
|
||||||
}
|
}
|
||||||
return actual, nil
|
return actual, nil
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue