Skip to content

Commit

Permalink
Fix Kubernetes 1.11 builds
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dlorenc committed Jun 28, 2018
1 parent 3e267fd commit bfacb51
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/minikube/bootstrapper/kubeadm/templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,10 @@ sudo /usr/bin/kubeadm alpha phase controlplane all --config {{.KubeadmConfigFile
sudo /usr/bin/kubeadm alpha phase etcd local --config {{.KubeadmConfigFile}}
`))

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

// printMapInOrder sorts the keys and prints the map in order, combining key
// value pairs with the separator character
Expand Down
9 changes: 9 additions & 0 deletions pkg/minikube/bootstrapper/kubeadm/versions.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,17 @@ var versionSpecificOpts = []VersionedExtraOption{
Key: "admission-control",
Value: strings.Join(util.DefaultAdmissionControllers, ","),
},
LessThanOrEqual: semver.MustParse("1.10.10"),
GreaterThanOrEqual: semver.MustParse("1.9.0-alpha.0"),
},
{
Option: util.ExtraOption{
Component: Apiserver,
Key: "enable-admission-plugins",
Value: strings.Join(util.DefaultAdmissionControllers, ","),
},
GreaterThanOrEqual: semver.MustParse("1.11.0-alpha.0"),
},
}

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

0 comments on commit bfacb51

Please sign in to comment.