Append first address from --api-advertise-addresses to kube-apiserver flags

This commit is contained in:
Ilya Dmitrichenko 2016-10-12 12:59:24 +01:00
parent 4747e1cc1d
commit 0cb54e7eb2
No known key found for this signature in database
GPG Key ID: E7889175A6C0CEB9

View File

@ -266,6 +266,10 @@ func getComponentCommand(component string, s *kubeadmapi.MasterConfiguration) (c
command = append(command, baseFlags[component]...)
if component == apiServer {
// Use first address we are given
if len(s.API.AdvertiseAddresses) > 0 {
command = append(command, fmt.Sprintf("--advertise-address=%s", s.API.AdvertiseAddresses[0]))
}
// Check if the user decided to use an external etcd cluster
if len(s.Etcd.Endpoints) > 0 {
command = append(command, fmt.Sprintf("--etcd-servers=%s", strings.Join(s.Etcd.Endpoints, ",")))