fix: Switched to multi-node builds to support Kaniko multi-platform builds
Fixes: #9861
Description Kaniko cannot generate multi-platform images from a single node.
- amd64 builds must run on amd64 nodes.
- arm64 builds must run on arm64 nodes.
Although the skaffold.yaml config schema suggests multi-platform support, the resulting images actually only contained a single platform. If the first build was amd64, subsequent images (even marked as arm64) were still amd64. This behavior is essentially a bug. The fix allows building images separately on the correct architecture nodes and then combining them into a genuine multi-platform image. Verified by testing.
User facing changes (remove if N/A)
- Modified the loop in pkg/skaffold/build/platform.go#L59 to reflect each architecture as a node selector, since the architectures are already being passed individually.
- Fixed an issue where the IMAGE_TAG environment variable was always suffixed with the first build architecture.
When building an arm64 image with Kaniko, if the base image is a multi-platform image (e.g., FROM baseimage), Kaniko would pull the amd64 image instead of the arm64 one. Although the build completed successfully, the resulting image failed to run properly. To resolve this, I added Kaniko’s --custom-platform flag, which ensured that the correct architecture’s image was pulled during the build. After this change, the image built and ran successfully on the intended architecture.