diff --git a/tests/integration/create_cluster/ha_openstack/expected-v1alpha2.yaml b/tests/integration/create_cluster/ha_openstack/expected-v1alpha2.yaml index e3540b18ba..fdef2d2274 100644 --- a/tests/integration/create_cluster/ha_openstack/expected-v1alpha2.yaml +++ b/tests/integration/create_cluster/ha_openstack/expected-v1alpha2.yaml @@ -4,6 +4,9 @@ metadata: creationTimestamp: "2017-01-01T00:00:00Z" name: minimal.k8s.local spec: + api: + loadBalancer: + type: Public authorization: rbac: {} channel: stable diff --git a/upup/pkg/fi/cloudup/new_cluster.go b/upup/pkg/fi/cloudup/new_cluster.go index 12b7259c2a..78227a3f52 100644 --- a/upup/pkg/fi/cloudup/new_cluster.go +++ b/upup/pkg/fi/cloudup/new_cluster.go @@ -333,6 +333,7 @@ func NewCluster(opt *NewClusterOptions, clientset simple.Clientset) (*NewCluster MaxRetries: fi.PtrTo(3), }, } + initializeOpenstackAPI(opt, cluster) osCloud, err := openstack.NewOpenstackCloud(cluster, "openstackmodel") if err != nil { return nil, err @@ -1324,9 +1325,7 @@ func setupTopology(opt *NewClusterOptions, cluster *api.Cluster, allZones sets.S func setupAPI(opt *NewClusterOptions, cluster *api.Cluster) error { // Populate the API access, so that it can be discoverable klog.Infof("Cloud Provider ID: %q", cluster.Spec.GetCloudProvider()) - if cluster.Spec.GetCloudProvider() == api.CloudProviderOpenstack { - initializeOpenstackAPI(opt, cluster) - } else if cluster.Spec.GetCloudProvider() == api.CloudProviderAzure { + if cluster.Spec.GetCloudProvider() == api.CloudProviderAzure { // Do nothing to disable the use of loadbalancer for the k8s API server. // TODO(kenji): Remove this condition once we support the loadbalancer // in pkg/model/azuremodel/api_loadbalancer.go.