Thanks, Brad.
I checked one of the pods that the Kubernetes runner created for a build, these were the labels listed:
$ kubectl -n drone describe pods/drone-vf8pl5qwtqw4ct6ds7kc
Name: drone-vf8pl5qwtqw4ct6ds7kc
Namespace: drone
Priority: 0
Node: arm64-node-name/1.2.3.4
Start Time: Fri, 28 Jan 2022 23:52:35 +0000
Labels: io.drone=true
io.drone.build.event=push
io.drone.build.number=13
io.drone.name=drone-vf8pl5qwtqw4ct6ds7kc
io.drone.repo.name=myreponame
io.drone.repo.namespace=mynamespace
(Edit 3: After reading the post I found and mentioned in edit 2, the kubernetes.io/arch label must not have been applied because it was a pod for the amd64 pipeline)
I added this section to my pipelines which applied the label to pods that the Kubernetes runner created, but the pods were not being assigned to the correct node based on this (maybe there is some Kubernetes feature that does this that I’m not aware of):
metadata:
labels:
kubernetes.io/arch: <amd64/arm64>
Removing this section and defining a node_selector section did the trick, since Kubernetes nodes in the more recent Kubernetes versions have the kubernetes.io/arch label applied to them automatically:
node_selector:
kubernetes.io/arch: <amd64/arm64>
This isn’t really something I wanted to have to add to all of my pipelines, though, so I looked into Kubernetes runner policies to see if I could have the node_selector section with the arch label applied by default. node_selector can be set in the policy, but it seems the only match option is to match by repo, which wouldn’t work for this.
I feel there should be a better solution for this but I can’t think of anything.
Edit: I slept on it, maybe setting a node_selector section like the one above as the default for a Kubernetes pipeline, with the arch taken from the pipeline’s platform section might work.
Edit 2: I started thinking that the platform section for Kubernetes runners did not actually do anything… I then found this post where this was mentioned. So, should setting the platform section in a Kubernetes pipeline actually be implicitly setting nodeSelector for kubernetes.io/arch?