set loadbalancer configs before initializing the OS clients

This commit is contained in:
Jesse Haka 2022-12-27 15:10:09 +02:00
parent 7f57a9f169
commit 4eee65958e
2 changed files with 5 additions and 3 deletions

View File

@ -4,6 +4,9 @@ metadata:
creationTimestamp: "2017-01-01T00:00:00Z"
name: minimal.k8s.local
spec:
api:
loadBalancer:
type: Public
authorization:
rbac: {}
channel: stable

View File

@ -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.