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.
pull/2961/head
dlorenc 2018-06-27 20:30:21 -07:00
parent 9c1edabbeb
commit 81440feabb
2 changed files with 13 additions and 2 deletions

View File

@ -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

View File

@ -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 {