Skip to content

Commit bfacb51

Browse files
committed
Fix Kubernetes 1.11 builds
Add a versioned flag for the enable-admission-control flags Add a second step to call "kubeadm alpha phase addon all" which seems to be required now to get coredns running. I tested this all the way back to 1.9.0.
1 parent 3e267fd commit bfacb51

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

pkg/minikube/bootstrapper/kubeadm/templates.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,10 @@ sudo /usr/bin/kubeadm alpha phase controlplane all --config {{.KubeadmConfigFile
7373
sudo /usr/bin/kubeadm alpha phase etcd local --config {{.KubeadmConfigFile}}
7474
`))
7575

76-
var kubeadmInitTemplate = template.Must(template.New("kubeadmInitTemplate").Parse(
77-
"sudo /usr/bin/kubeadm init --config {{.KubeadmConfigFile}} {{if .SkipPreflightChecks}}--skip-preflight-checks{{else}}{{range .Preflights}}--ignore-preflight-errors={{.}} {{end}}{{end}}"))
76+
var kubeadmInitTemplate = template.Must(template.New("kubeadmInitTemplate").Parse(`
77+
sudo /usr/bin/kubeadm init --config {{.KubeadmConfigFile}} {{if .SkipPreflightChecks}}--skip-preflight-checks{{else}}{{range .Preflights}}--ignore-preflight-errors={{.}} {{end}}{{end}} &&
78+
sudo /usr/bin/kubeadm alpha phase addon all
79+
`))
7880

7981
// printMapInOrder sorts the keys and prints the map in order, combining key
8082
// value pairs with the separator character

pkg/minikube/bootstrapper/kubeadm/versions.go

+9
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,17 @@ var versionSpecificOpts = []VersionedExtraOption{
205205
Key: "admission-control",
206206
Value: strings.Join(util.DefaultAdmissionControllers, ","),
207207
},
208+
LessThanOrEqual: semver.MustParse("1.10.10"),
208209
GreaterThanOrEqual: semver.MustParse("1.9.0-alpha.0"),
209210
},
211+
{
212+
Option: util.ExtraOption{
213+
Component: Apiserver,
214+
Key: "enable-admission-plugins",
215+
Value: strings.Join(util.DefaultAdmissionControllers, ","),
216+
},
217+
GreaterThanOrEqual: semver.MustParse("1.11.0-alpha.0"),
218+
},
210219
}
211220

212221
func VersionIsBetween(version, gte, lte semver.Version) bool {

0 commit comments

Comments
 (0)