@@ -63,26 +63,26 @@ func NewCmdJoin(out io.Writer) *cobra.Command {
63
63
Use : "join <flags> [DiscoveryTokenAPIServers]" ,
64
64
Short : "Run this on any machine you wish to join an existing cluster" ,
65
65
Long : dedent .Dedent (`
66
- When joining a kubeadm initialized cluster, we need to establish
67
- bidirectional trust. This is split into discovery (having the Node
68
- trust the Kubernetes Master) and TLS bootstrap (having the Kubernetes
66
+ When joining a kubeadm initialized cluster, we need to establish
67
+ bidirectional trust. This is split into discovery (having the Node
68
+ trust the Kubernetes Master) and TLS bootstrap (having the Kubernetes
69
69
Master trust the Node).
70
70
71
- There are 2 main schemes for discovery. The first is to use a shared
72
- token along with the IP address of the API server. The second is to
73
- provide a file (a subset of the standard kubeconfig file). This file
74
- can be a local file or downloaded via an HTTPS URL. The forms are
75
- kubeadm join --discovery-token abcdef.1234567890abcdef 1.2.3.4:6443,
71
+ There are 2 main schemes for discovery. The first is to use a shared
72
+ token along with the IP address of the API server. The second is to
73
+ provide a file (a subset of the standard kubeconfig file). This file
74
+ can be a local file or downloaded via an HTTPS URL. The forms are
75
+ kubeadm join --discovery-token abcdef.1234567890abcdef 1.2.3.4:6443,
76
76
kubeadm join --discovery-file path/to/file.conf, or kubeadm join
77
- --discovery-file https://url/file.conf. Only one form can be used. If
78
- the discovery information is loaded from a URL, HTTPS must be used and
77
+ --discovery-file https://url/file.conf. Only one form can be used. If
78
+ the discovery information is loaded from a URL, HTTPS must be used and
79
79
the host installed CA bundle is used to verify the connection.
80
80
81
- The TLS bootstrap mechanism is also driven via a shared token. This is
81
+ The TLS bootstrap mechanism is also driven via a shared token. This is
82
82
used to temporarily authenticate with the Kubernetes Master to submit a
83
- certificate signing request (CSR) for a locally created key pair. By
84
- default kubeadm will set up the Kubernetes Master to automatically
85
- approve these signing requests. This token is passed in with the
83
+ certificate signing request (CSR) for a locally created key pair. By
84
+ default kubeadm will set up the Kubernetes Master to automatically
85
+ approve these signing requests. This token is passed in with the
86
86
--tls-bootstrap-token abcdef.1234567890abcdef flag.
87
87
88
88
Often times the same token is used for both parts. In this case, the
@@ -97,7 +97,7 @@ func NewCmdJoin(out io.Writer) *cobra.Command {
97
97
98
98
j , err := NewJoin (cfgPath , args , internalcfg , skipPreFlight )
99
99
kubeadmutil .CheckErr (err )
100
- kubeadmutil .CheckErr (j .Validate ())
100
+ kubeadmutil .CheckErr (j .Validate (cmd ))
101
101
kubeadmutil .CheckErr (j .Run (out ))
102
102
},
103
103
}
@@ -166,7 +166,10 @@ func NewJoin(cfgPath string, args []string, cfg *kubeadmapi.NodeConfiguration, s
166
166
return & Join {cfg : cfg }, nil
167
167
}
168
168
169
- func (j * Join ) Validate () error {
169
+ func (j * Join ) Validate (cmd * cobra.Command ) error {
170
+ if err := validation .ValidateMixedArguments (cmd .PersistentFlags ()); err != nil {
171
+ return err
172
+ }
170
173
return validation .ValidateNodeConfiguration (j .cfg ).ToAggregate ()
171
174
}
172
175
0 commit comments