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

add multi-arch (arm64) support for docker/podman drivers #9969

Merged
merged 25 commits into from
Jan 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
0c68a59
kic-base-image-multiarch target
ilya-zuyev Dec 14, 2020
1860291
kic-base-image-multiarch target
ilya-zuyev Dec 14, 2020
d116030
allow to override the list of ma-kicbase registries
ilya-zuyev Dec 14, 2020
405ccc5
skip docker login if AUTOPUSH is not defined
ilya-zuyev Dec 14, 2020
6044006
add multi-arch images to kic driver list
ilya-zuyev Dec 14, 2020
342b34c
fix unit tests
ilya-zuyev Dec 15, 2020
6335658
Revert single-arch kicbase fallback support
ilya-zuyev Jan 6, 2021
65cf998
Merge branch 'master' into ilyaz/multiarch_kicbase
ilya-zuyev Jan 6, 2021
df47190
fix docker builder creation args
ilya-zuyev Jan 6, 2021
3aaf9c0
Add buildx debug flags
ilya-zuyev Jan 8, 2021
1993e2e
fix kicbase image name
ilya-zuyev Jan 8, 2021
9184efe
fix Makefile rules
ilya-zuyev Jan 8, 2021
da87abd
enable docker driver for arm64
ilya-zuyev Jan 8, 2021
f24a3e0
fix Makefile
ilya-zuyev Jan 8, 2021
6c860a4
confirm kicbase push
ilya-zuyev Jan 8, 2021
9c4a765
Merge branch 'master' into ilyaz/multiarch_kicbase
ilya-zuyev Jan 8, 2021
921306d
fix fallback kicbaseimages list
ilya-zuyev Jan 8, 2021
2622e95
bump kicbase version to v0.0.16-snapshot1
ilya-zuyev Jan 8, 2021
7ca1503
fix kicbase sha1
ilya-zuyev Jan 12, 2021
813094b
Merge branch 'master' into ilyaz/multiarch_kicbase
ilya-zuyev Jan 12, 2021
d886639
fix unit tests
ilya-zuyev Jan 12, 2021
480c36d
trigger build
ilya-zuyev Jan 12, 2021
a13d15f
remove old make target for pushing kicbase
ilya-zuyev Jan 12, 2021
837cfb7
Revert "remove old make target for pushing kicbase"
ilya-zuyev Jan 12, 2021
2ca3cd2
Fix Makefile
ilya-zuyev Jan 13, 2021
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
32 changes: 30 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -600,6 +600,33 @@ kic-base-image: ## builds the kic base image and tags local/kicbase:latest and l
docker tag local/kicbase:$(KIC_VERSION) local/kicbase:latest
docker tag local/kicbase:$(KIC_VERSION) local/kicbase:$(KIC_VERSION)-$(COMMIT_SHORT)

# multi-arch docker images
X_DOCKER_BUILDER ?= minikube-builder
X_BUILD_ENV ?= DOCKER_CLI_EXPERIMENTAL=enabled

.PHONY: docker-multi-arch-builder
docker-multi-arch-builder:
medyagh marked this conversation as resolved.
Show resolved Hide resolved
env $(X_BUILD_ENV) docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
env $(X_BUILD_ENV) docker buildx rm --builder $(X_DOCKER_BUILDER) || true
env $(X_BUILD_ENV) docker buildx create --name kicbase-builder --buildkitd-flags '--debug' --use || true

KICBASE_ARCH = linux/arm64,linux/amd64
KICBASE_IMAGE_REGISTRIES ?= $(REGISTRY)/kicbase:$(KIC_VERSION) $(REGISTRY_GH)/kicbase:$(KIC_VERSION) kicbase/stable:$(KIC_VERSION)

.PHONY: push-kic-base-image
push-kic-base-image: docker-multi-arch-builder ## Push multi-arch local/kicbase:latest to all remote registries
ifdef AUTOPUSH
docker login gcr.io/k8s-minikube
docker login docker.pkg.github.com
docker login
endif
$(foreach REG,$(KICBASE_IMAGE_REGISTRIES), \
@docker pull $(REG) && echo "Image already exist in registry" && exit 1 || echo "Image doesn't exist in registry";)
ifndef AUTOPUSH
$(call user_confirm, 'Are you sure you want to push $(KICBASE_IMAGE_REGISTRIES) ?')
endif
env $(X_BUILD_ENV) docker buildx build --platform $(KICBASE_ARCH) $(addprefix -t ,$(KICBASE_IMAGE_REGISTRIES)) --push --build-arg COMMIT_SHA=${VERSION}-$(COMMIT) ./deploy/kicbase

medyagh marked this conversation as resolved.
Show resolved Hide resolved
.PHONY: upload-preloaded-images-tar
upload-preloaded-images-tar: out/minikube # Upload the preloaded images for oldest supported, newest supported, and default kubernetes versions to GCS.
go build -ldflags="$(MINIKUBE_LDFLAGS)" -o out/upload-preload ./hack/preload-images/*.go
Expand Down Expand Up @@ -648,8 +675,8 @@ push-kic-base-image-hub: kic-base-image ## Push kic-base to docker hub
docker tag local/kicbase:latest $(KIC_BASE_IMAGE_HUB)
$(MAKE) push-docker IMAGE=$(KIC_BASE_IMAGE_HUB)

.PHONY: push-kic-base-image
push-kic-base-image: ## Push local/kicbase:latest to all remote registries
.PHONY: push-kic-base-image-x86-deprecated
push-kic-base-image-x86-deprecated: ## Push legacy, non-multiarch local/kicbase:latest to all remote registries
ifndef AUTOPUSH
$(call user_confirm, 'Are you sure you want to push: $(KIC_BASE_IMAGE_GH) & $(KIC_BASE_IMAGE_GCR) & $(KIC_BASE_IMAGE_HUB) ?')
$(MAKE) push-kic-base-image AUTOPUSH=true
Expand Down Expand Up @@ -818,3 +845,4 @@ else
export UPDATE_TARGET="all" && \
go run update_kubernetes_version.go)
endif

4 changes: 2 additions & 2 deletions pkg/drivers/kic/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ import (

const (
// Version is the current version of kic
Version = "v0.0.15-snapshot4"
Version = "v0.0.16-snapshot1"
medyagh marked this conversation as resolved.
Show resolved Hide resolved
// SHA of the kic base image
baseImageSHA = "ef1f485b5a1cfa4c989bc05e153f0a8525968ec999e242efff871cbb31649c16"
baseImageSHA = "dff16232547bb3ac3f2a9e09a42246a96ecf8f40d9a1c5bcf5a37953690954b6"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion pkg/minikube/registry/drvs/docker/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func configure(cc config.ClusterConfig, n config.Node) (interface{}, error) {
}

func status() registry.State {
if runtime.GOARCH != "amd64" {
if runtime.GOARCH != "amd64" && runtime.GOARCH != "arm64" {
return registry.State{Error: fmt.Errorf("docker driver is not supported on %q systems yet", runtime.GOARCH), Installed: false, Healthy: false, Fix: "Try other drivers", Doc: docURL}
}

Expand Down
2 changes: 1 addition & 1 deletion site/content/en/docs/commands/start.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ minikube start [flags]
--apiserver-names strings A set of apiserver names which are used in the generated certificate for kubernetes. This can be used if you want to make the apiserver available from outside the machine
--apiserver-port int The apiserver listening port (default 8443)
--auto-update-drivers If set, automatically updates drivers to the latest version. Defaults to true. (default true)
--base-image string The base image to use for docker/podman drivers. Intended for local development. (default "gcr.io/k8s-minikube/kicbase:v0.0.15-snapshot4@sha256:ef1f485b5a1cfa4c989bc05e153f0a8525968ec999e242efff871cbb31649c16")
--base-image string The base image to use for docker/podman drivers. Intended for local development. (default "gcr.io/k8s-minikube/kicbase:v0.0.16-snapshot1@sha256:dff16232547bb3ac3f2a9e09a42246a96ecf8f40d9a1c5bcf5a37953690954b6")
--cache-images If true, cache docker images for the current bootstrapper and load them into the machine. Always false with --driver=none. (default true)
--cni string CNI plug-in to use. Valid options: auto, bridge, calico, cilium, flannel, kindnet, or path to a CNI manifest (default: auto)
--container-runtime string The container runtime to be used (docker, cri-o, containerd). (default "docker")
Expand Down