@@ -99,6 +99,7 @@ type initOptions struct {
99
99
externalClusterCfg * kubeadmapiv1beta2.ClusterConfiguration
100
100
uploadCerts bool
101
101
skipCertificateKeyPrint bool
102
+ kustomizeDir string
102
103
}
103
104
104
105
// compile-time assert that the local data object satisfies the phases data interface.
@@ -120,6 +121,7 @@ type initData struct {
120
121
outputWriter io.Writer
121
122
uploadCerts bool
122
123
skipCertificateKeyPrint bool
124
+ kustomizeDir string
123
125
}
124
126
125
127
// NewCmdInit returns "kubeadm init" command.
@@ -272,6 +274,7 @@ func AddInitOtherFlags(flagSet *flag.FlagSet, initOptions *initOptions) {
272
274
& initOptions .skipCertificateKeyPrint , options .SkipCertificateKeyPrint , initOptions .skipCertificateKeyPrint ,
273
275
"Don't print the key used to encrypt the control-plane certificates." ,
274
276
)
277
+ options .AddKustomizePodsFlag (flagSet , & initOptions .kustomizeDir )
275
278
}
276
279
277
280
// newInitOptions returns a struct ready for being used for creating cmd init flags.
@@ -404,6 +407,7 @@ func newInitData(cmd *cobra.Command, args []string, options *initOptions, out io
404
407
outputWriter : out ,
405
408
uploadCerts : options .uploadCerts ,
406
409
skipCertificateKeyPrint : options .skipCertificateKeyPrint ,
410
+ kustomizeDir : options .kustomizeDir ,
407
411
}, nil
408
412
}
409
413
@@ -532,6 +536,11 @@ func (d *initData) Tokens() []string {
532
536
return tokens
533
537
}
534
538
539
+ // KustomizeDir returns the folder where kustomize patches for static pod manifest are stored
540
+ func (d * initData ) KustomizeDir () string {
541
+ return d .kustomizeDir
542
+ }
543
+
535
544
func printJoinCommand (out io.Writer , adminKubeConfigPath , token string , i * initData ) error {
536
545
joinControlPlaneCommand , err := cmdutil .GetJoinControlPlaneCommand (adminKubeConfigPath , token , i .CertificateKey (), i .skipTokenPrint , i .skipCertificateKeyPrint )
537
546
if err != nil {
0 commit comments