mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 03:11:40 +00:00
Merge pull request #79270 from SataQiu/fix-kubeadm-2019062102
kubeadm: add --control-plane-endpoint flag
This commit is contained in:
commit
4c9fab5c40
@ -99,7 +99,7 @@ func newCmdUserKubeConfig(out io.Writer) *cobra.Command {
|
||||
// Add ClusterConfiguration backed flags to the command
|
||||
cmd.Flags().StringVar(&clusterCfg.CertificatesDir, options.CertificatesDir, clusterCfg.CertificatesDir, "The path where certificates are stored")
|
||||
|
||||
// Add ClusterConfiguration backed flags to the command
|
||||
// Add InitConfiguration backed flags to the command
|
||||
cmd.Flags().StringVar(&initCfg.LocalAPIEndpoint.AdvertiseAddress, options.APIServerAdvertiseAddress, initCfg.LocalAPIEndpoint.AdvertiseAddress, "The IP address the API server is accessible on")
|
||||
cmd.Flags().Int32Var(&initCfg.LocalAPIEndpoint.BindPort, options.APIServerBindPort, initCfg.LocalAPIEndpoint.BindPort, "The port the API server is accessible on")
|
||||
|
||||
|
@ -230,6 +230,11 @@ func AddClusterConfigFlags(flagSet *flag.FlagSet, cfg *kubeadmapiv1beta2.Cluster
|
||||
`Use alternative domain for services, e.g. "myorg.internal".`,
|
||||
)
|
||||
|
||||
flagSet.StringVar(
|
||||
&cfg.ControlPlaneEndpoint, options.ControlPlaneEndpoint, cfg.ControlPlaneEndpoint,
|
||||
`Specify a stable IP address or DNS name for the control plane.`,
|
||||
)
|
||||
|
||||
options.AddKubernetesVersionFlag(flagSet, &cfg.KubernetesVersion)
|
||||
|
||||
flagSet.StringVar(
|
||||
|
@ -38,6 +38,9 @@ const (
|
||||
// ControllerManagerExtraArgs flag sets extra flags to pass to the Controller Manager or override default ones in form of <flagname>=<value>.
|
||||
ControllerManagerExtraArgs = "controller-manager-extra-args"
|
||||
|
||||
// ControlPlaneEndpoint flag sets a stable IP address or DNS name for the control plane.
|
||||
ControlPlaneEndpoint = "control-plane-endpoint"
|
||||
|
||||
// DryRun flag instruct kubeadm to don't apply any changes; just output what would be done.
|
||||
DryRun = "dry-run"
|
||||
|
||||
|
@ -111,6 +111,7 @@ func getAddonPhaseFlags(name string) []string {
|
||||
if name == "all" || name == "kube-proxy" {
|
||||
flags = append(flags,
|
||||
options.APIServerAdvertiseAddress,
|
||||
options.ControlPlaneEndpoint,
|
||||
options.APIServerBindPort,
|
||||
options.NetworkingPodSubnet,
|
||||
)
|
||||
|
@ -140,6 +140,7 @@ func getCertPhaseFlags(name string) []string {
|
||||
if name == "all" || name == "apiserver" {
|
||||
flags = append(flags,
|
||||
options.APIServerAdvertiseAddress,
|
||||
options.ControlPlaneEndpoint,
|
||||
options.APIServerCertSANs,
|
||||
options.NetworkingDNSDomain,
|
||||
options.NetworkingServiceSubnet,
|
||||
|
@ -104,6 +104,7 @@ func getControlPlanePhaseFlags(name string) []string {
|
||||
if name == "all" || name == kubeadmconstants.KubeAPIServer {
|
||||
flags = append(flags,
|
||||
options.APIServerAdvertiseAddress,
|
||||
options.ControlPlaneEndpoint,
|
||||
options.APIServerBindPort,
|
||||
options.APIServerExtraArgs,
|
||||
options.FeatureGatesString,
|
||||
|
@ -96,6 +96,7 @@ func NewKubeConfigFilePhase(kubeConfigFileName string) workflow.Phase {
|
||||
func getKubeConfigPhaseFlags(name string) []string {
|
||||
flags := []string{
|
||||
options.APIServerAdvertiseAddress,
|
||||
options.ControlPlaneEndpoint,
|
||||
options.APIServerBindPort,
|
||||
options.CertificatesDir,
|
||||
options.CfgPath,
|
||||
|
Loading…
Reference in New Issue
Block a user