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

Kubernetes Multi-arch support #2573

Closed
everflux opened this Issue Jan 12, 2019 · 2 comments

Comments

Projects
None yet
2 participants
@everflux
Copy link

everflux commented Jan 12, 2019

I am running image: drone/drone:1.0.0-rc.4-linux-arm64 and created a simple build job.
Drone creates a new kubernetes job that fails to execute because it uses amd64 docker image:

....
"annotations": {
      "io.drone.build.id": "2",
      "io.drone.repo.id": "1",
      "io.drone.stage.arch": "arm64",
      "io.drone.stage.created": "2019-01-12 16:46:49 +0000 UTC",
      "io.drone.stage.id": "2",
      "io.drone.stage.number": "1",
      "io.drone.stage.os": "linux",
....
"spec": {
        "containers": [
          {
            "name": "drone-controller",
            "image": "drone/controller:linux-amd64",

Setting DRONE_RUNNER_PLATFORM=linux/arm64 did not have any effect.

I think it would be best, if the arch would be extracted from the pipeline definition or uses a simple image name to use docker resolution of the right image through multi-arch manifest file.

@bradrydzewski

This comment has been minimized.

Copy link
Member

bradrydzewski commented Jan 12, 2019

The kubernetes runtime does not (yet) support arm or arm64. This is planned.

@bradrydzewski bradrydzewski changed the title Kubernetes job executor uses hardcoded amd64 image Kubernetes Multi-arch support Jan 12, 2019

@bradrydzewski

This comment has been minimized.

Copy link
Member

bradrydzewski commented Jan 17, 2019

this was fixed with two separate patches. First we updated the default image to drone/controller:1.0.0-rc.4 which is a manifest that points to arm, arm64 and amd64 images.

second we updated the code to pass the architecture to the node selector. This means you cluster needs to support the beta beta.kubernetes.io/arch value. You can see this logic below:

	if arch := stage.Arch; arch != "amd64" {
		if job.Spec.Template.Spec.NodeSelector == nil {
			job.Spec.Template.Spec.NodeSelector = map[string]string{}
		}
		job.Spec.Template.Spec.NodeSelector["beta.kubernetes.io/arch"] = arch
	}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment