cmd.Flags().StringVar(&cfg.API.AdvertiseAddress,"apiserver-advertise-address",cfg.API.AdvertiseAddress,`The IP address the API server is accessible on`)
cmd.Flags().Int32Var(&cfg.API.BindPort,"apiserver-bind-port",cfg.API.BindPort,`The port the API server is accessible on`)
cmd.Flags().StringVar(&cfg.APIEndpoint.AdvertiseAddress,"apiserver-advertise-address",cfg.APIEndpoint.AdvertiseAddress,`The IP address the API server is accessible on`)
cmd.Flags().Int32Var(&cfg.APIEndpoint.BindPort,"apiserver-bind-port",cfg.APIEndpoint.BindPort,`The port the API server is accessible on`)
cmd.Flags().StringVar(&cfg.Networking.PodSubnet,"pod-network-cidr",cfg.Networking.PodSubnet,`The range of IP addresses used for the Pod network`)
cmd.Flags().StringVar(&cfg.Networking.DNSDomain,"service-dns-domain",cfg.Networking.DNSDomain,"Alternative domain for services, to use for the API server serving cert")
cmd.Flags().StringVar(&cfg.Networking.ServiceSubnet,"service-cidr",cfg.Networking.ServiceSubnet,"Alternative range of IP address for service VIPs, from which derives the internal API server VIP that will be added to the API Server serving cert")
cmd.Flags().StringSliceVar(&cfg.APIServerCertSANs,"apiserver-cert-extra-sans",[]string{},"Optional extra altnames to use for the API server serving cert. Can be both IP addresses and DNS names")
cmd.Flags().StringVar(&cfg.API.AdvertiseAddress,"apiserver-advertise-address",cfg.API.AdvertiseAddress,"The IP address the API server is accessible on, to use for the API server serving cert")
cmd.Flags().StringVar(&cfg.APIEndpoint.AdvertiseAddress,"apiserver-advertise-address",cfg.APIEndpoint.AdvertiseAddress,"The IP address the API server is accessible on, to use for the API server serving cert")
cmd.Flags().StringVar(&cfg.API.AdvertiseAddress,"apiserver-advertise-address",cfg.API.AdvertiseAddress,"The IP address of the API server is accessible on")
cmd.Flags().Int32Var(&cfg.API.BindPort,"apiserver-bind-port",cfg.API.BindPort,"The port the API server is accessible on")
cmd.Flags().StringVar(&cfg.APIEndpoint.AdvertiseAddress,"apiserver-advertise-address",cfg.APIEndpoint.AdvertiseAddress,"The IP address of the API server is accessible on")
cmd.Flags().Int32Var(&cfg.APIEndpoint.BindPort,"apiserver-bind-port",cfg.APIEndpoint.BindPort,"The port the API server is accessible on")
cmd.Flags().StringVar(&cfg.Networking.ServiceSubnet,"service-cidr",cfg.Networking.ServiceSubnet,"The range of IP address used for service VIPs")
cmd.Flags().StringVar(&featureGatesString,"feature-gates",featureGatesString,"A set of key=value pairs that describe feature gates for various features. "+
@@ -173,8 +173,8 @@ func getKubeConfigSubCommands(out io.Writer, outDir, defaultKubernetesVersion st
cmd.Flags().StringVar(&cfgPath,"config",cfgPath,"Path to kubeadm config file. WARNING: Usage of a configuration file is experimental")
}
cmd.Flags().StringVar(&cfg.CertificatesDir,"cert-dir",cfg.CertificatesDir,"The path where certificates are stored")
cmd.Flags().StringVar(&cfg.API.AdvertiseAddress,"apiserver-advertise-address",cfg.API.AdvertiseAddress,"The IP address the API server is accessible on")
cmd.Flags().Int32Var(&cfg.API.BindPort,"apiserver-bind-port",cfg.API.BindPort,"The port the API server is accessible on")
cmd.Flags().StringVar(&cfg.APIEndpoint.AdvertiseAddress,"apiserver-advertise-address",cfg.APIEndpoint.AdvertiseAddress,"The IP address the API server is accessible on")
cmd.Flags().Int32Var(&cfg.APIEndpoint.BindPort,"apiserver-bind-port",cfg.APIEndpoint.BindPort,"The port the API server is accessible on")
cmd.Flags().StringVar(&outDir,"kubeconfig-dir",outDir,"The path where to save the kubeconfig file")
cmd.Flags().StringVar(&cfg.NodeRegistration.Name,"node-name",cfg.NodeRegistration.Name,`The node name that should be used for the kubelet client certificate`)
returnnil,fmt.Errorf("error parsing API AdvertiseAddress %v: is not a valid textual representation of an IP address",cfg.API.AdvertiseAddress)
returnnil,fmt.Errorf("error parsing APIEndpoint AdvertiseAddress %v: is not a valid textual representation of an IP address",cfg.APIEndpoint.AdvertiseAddress)
returnnil,fmt.Errorf("error parsing API AdvertiseAddress %v: is not a valid textual representation of an IP address",cfg.API.AdvertiseAddress)
returnnil,fmt.Errorf("error parsing APIEndpoint AdvertiseAddress %v: is not a valid textual representation of an IP address",cfg.APIEndpoint.AdvertiseAddress)
returnfmt.Errorf("couldn't use \"%s\" as \"apiserver-advertise-address\", must be ipv4 or ipv6 address",cfg.API.AdvertiseAddress)
addressIP:=net.ParseIP(cfg.AdvertiseAddress)
ifaddressIP==nil&&cfg.AdvertiseAddress!=""{
returnfmt.Errorf("couldn't use \"%s\" as \"apiserver-advertise-address\", must be ipv4 or ipv6 address",cfg.AdvertiseAddress)
}
// Choose the right address for the API Server to advertise. If the advertise address is localhost or 0.0.0.0, the default interface's IP address is used