Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Kubernetes 1.11 builds #2943

Merged
merged 4 commits into from
Jul 4, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ KERNEL_VERSION ?= 4.16.14

GOOS ?= $(shell go env GOOS)
GOARCH ?= $(shell go env GOARCH)
GOPATH ?= $(shell go env GOPATH)
BUILD_DIR ?= ./out
$(shell mkdir -p $(BUILD_DIR))

Expand Down Expand Up @@ -208,7 +209,7 @@ out/test.d: pkg/minikube/assets/assets.go

-include out/test.d
test:
./test.sh
GOPATH=$(GOPATH) ./test.sh

pkg/minikube/assets/assets.go: $(shell find deploy/addons -type f)
which go-bindata || GOBIN=$(GOPATH)/bin go get github.com/jteeuwen/go-bindata/...
Expand Down
5 changes: 5 additions & 0 deletions pkg/minikube/bootstrapper/kubeadm/kubeadm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ kind: MasterConfiguration
api:
advertiseAddress: 192.168.1.100
bindPort: 8443
controlPlaneEndpoint: localhost
kubernetesVersion: v1.10.0
certificatesDir: /var/lib/localkube/certs/
networking:
Expand Down Expand Up @@ -82,6 +83,7 @@ kind: MasterConfiguration
api:
advertiseAddress: 192.168.1.101
bindPort: 8443
controlPlaneEndpoint: localhost
kubernetesVersion: v1.10.0-alpha.0
certificatesDir: /var/lib/localkube/certs/
networking:
Expand Down Expand Up @@ -122,6 +124,7 @@ kind: MasterConfiguration
api:
advertiseAddress: 192.168.1.101
bindPort: 8443
controlPlaneEndpoint: localhost
kubernetesVersion: v1.10.0-alpha.0
certificatesDir: /var/lib/localkube/certs/
networking:
Expand All @@ -148,6 +151,7 @@ kind: MasterConfiguration
api:
advertiseAddress: 192.168.1.101
bindPort: 8443
controlPlaneEndpoint: localhost
kubernetesVersion: v1.10.0-alpha.0
certificatesDir: /var/lib/localkube/certs/
networking:
Expand Down Expand Up @@ -184,6 +188,7 @@ kind: MasterConfiguration
api:
advertiseAddress: 192.168.1.101
bindPort: 8443
controlPlaneEndpoint: localhost
kubernetesVersion: v1.10.0-alpha.0
certificatesDir: /var/lib/localkube/certs/
networking:
Expand Down
7 changes: 5 additions & 2 deletions pkg/minikube/bootstrapper/kubeadm/templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ kind: MasterConfiguration
api:
advertiseAddress: {{.AdvertiseAddress}}
bindPort: {{.APIServerPort}}
controlPlaneEndpoint: localhost
kubernetesVersion: {{.KubernetesVersion}}
certificatesDir: {{.CertDir}}
networking:
Expand Down Expand Up @@ -73,8 +74,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 kube-dns
`))

// 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.1000"), // Semver doesn't support wildcards.
GreaterThanOrEqual: semver.MustParse("1.9.0-alpha.0"),
},
{
Option: util.ExtraOption{
Component: Apiserver,
Key: "enable-admission-plugins",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this necessary? I got a working cluster with just removing the admission-control line from /var/lib/kubeadm.yaml, so the rest of the default manifest was fine without needing any more overrides.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not necessary, but we pass some different defaults than kubeadm.

Value: strings.Join(util.DefaultAdmissionControllers, ","),
},
GreaterThanOrEqual: semver.MustParse("1.11.0-alpha.0"),
},
}

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