mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-10-21 22:49:31 +00:00
Set external hostname in local-up-cluster
If we set --external-hostname, then the api server does not look in the CloudProviderOptions.DefaultExternalHost method. While we are at it, let's log an info message, so if there is a failure the operator gets a hint that they can use --external-hostname to bypass the lookup in the cloud provider. This will enable us to set the CLOUD_PROVIDER to openstack for example and not have to really run api server inside a openstack vm.
This commit is contained in:
@@ -20,6 +20,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/golang/glog"
|
||||
"github.com/spf13/pflag"
|
||||
|
||||
"k8s.io/api/core/v1"
|
||||
@@ -55,6 +56,8 @@ func (s *CloudProviderOptions) DefaultExternalHost(genericoptions *genericoption
|
||||
}
|
||||
|
||||
if cloudprovider.IsCloudProvider(s.CloudProvider) {
|
||||
glog.Info("--external-hostname was not specified. Trying to get it from the cloud provider.")
|
||||
|
||||
cloud, err := cloudprovider.InitCloudProvider(s.CloudProvider, s.CloudConfigFile)
|
||||
if err != nil {
|
||||
return fmt.Errorf("%q cloud provider could not be initialized: %v", s.CloudProvider, err)
|
||||
|
Reference in New Issue
Block a user