@@ -26,16 +26,19 @@ import (
26
26
"sigs.k8s.io/kind/pkg/cluster/nodeutils"
27
27
28
28
"sigs.k8s.io/kind/pkg/cluster/internal/create/actions"
29
+ "sigs.k8s.io/kind/pkg/internal/apis/config"
29
30
)
30
31
31
32
// kubeadmInitAction implements action for executing the kubeadm init
32
33
// and a set of default post init operations like e.g. install the
33
34
// CNI network plugin.
34
- type action struct {}
35
+ type action struct {
36
+ skipKubeProxy bool
37
+ }
35
38
36
39
// NewAction returns a new action for kubeadm init
37
- func NewAction () actions.Action {
38
- return & action {}
40
+ func NewAction (cfg * config. Cluster ) actions.Action {
41
+ return & action {skipKubeProxy : cfg . Networking . KubeProxyMode == config . NoneProxyMode }
39
42
}
40
43
41
44
// Execute runs the action
@@ -56,13 +59,18 @@ func (a *action) Execute(ctx *actions.ActionContext) error {
56
59
return err
57
60
}
58
61
62
+ // skip preflight checks, as these have undesirable side effects
63
+ // and don't tell us much. requires kubeadm 1.13+
64
+ skipPhases := "preflight"
65
+ if a .skipKubeProxy {
66
+ skipPhases += ",addon/kube-proxy"
67
+ }
68
+
59
69
// run kubeadm
60
70
cmd := node .Command (
61
71
// init because this is the control plane node
62
72
"kubeadm" , "init" ,
63
- // skip preflight checks, as these have undesirable side effects
64
- // and don't tell us much. requires kubeadm 1.13+
65
- "--skip-phases=preflight" ,
73
+ "--skip-phases=" + skipPhases ,
66
74
// specify our generated config file
67
75
"--config=/kind/kubeadm.conf" ,
68
76
"--skip-token-print" ,
0 commit comments