Skip to content

fix(templates): runtime Kubernetes arch detection for arm64#668

Closed
ArangoGutierrez wants to merge 1 commit intoNVIDIA:mainfrom
ArangoGutierrez:fix/arm64-kubernetes-arch-default
Closed

fix(templates): runtime Kubernetes arch detection for arm64#668
ArangoGutierrez wants to merge 1 commit intoNVIDIA:mainfrom
ArangoGutierrez:fix/arm64-kubernetes-arch-default

Conversation

@ArangoGutierrez
Copy link
Collaborator

Summary

  • Replace hardcoded amd64 default for Kubernetes arch with runtime detection
  • Use dpkg --print-architecture (falls back to uname -m mapping)
  • Affects kubeadm, kubelet, kubectl, CNI plugins, and crictl binary downloads
  • User-specified Arch still takes precedence

Test plan

  • Unit test verifies template output uses runtime detection when Arch is empty
  • Unit test verifies template output uses user value when Arch is explicitly set
  • go test ./pkg/provisioner/templates/... -v passes
  • CI validation pending

…ng to amd64

When the user doesn't explicitly set Kubernetes.Arch, use runtime
detection (dpkg --print-architecture) instead of hardcoding "amd64".
This ensures arm64 nodes download the correct architecture binaries
for kubeadm, kubelet, kubectl, CNI plugins, and crictl.

The user can still explicitly set Arch to override runtime detection.

Signed-off-by: Carlos Eduardo Arango Gutierrez <eduardoa@nvidia.com>
Copilot AI review requested due to automatic review settings February 14, 2026 17:57
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a bug where the Kubernetes provisioner templates were hardcoded to use amd64 architecture by default, preventing proper installation on ARM64 systems. The fix introduces runtime architecture detection using dpkg --print-architecture with a fallback to uname -m, while still allowing users to explicitly specify the architecture.

Changes:

  • Replaced hardcoded amd64 default with runtime detection in three Kubernetes templates (kubeadm, git source, latest source)
  • Removed the hardcoded assignment in NewKubernetes function
  • Added comprehensive test coverage for architecture detection behavior

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
pkg/provisioner/templates/kubernetes.go Updated three template definitions to use conditional architecture detection and removed hardcoded default from NewKubernetes function
pkg/provisioner/templates/kubernetes_test.go Updated existing tests to expect empty Arch (runtime detection) and added new tests validating runtime detection vs explicit arch for all three source types

@coveralls
Copy link

Pull Request Test Coverage Report for Build 22021792600

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 9 unchanged lines in 1 file lost coverage.
  • Overall coverage remained the same at 47.856%

Files with Coverage Reduction New Missed Lines %
pkg/provisioner/templates/kubernetes.go 9 85.12%
Totals Coverage Status
Change from base Build 21999063489: 0.0%
Covered Lines: 2567
Relevant Lines: 5364

💛 - Coveralls

@ArangoGutierrez
Copy link
Collaborator Author

Closing as superseded. The equivalent fixes were already merged into main via PRs #661-664:

Additionally, these fixes address downstream provisioning issues but do not resolve the actual EC2 RunInstances failure (Unsupported: The requested configuration is currently not supported) reported in https://github.com/NVIDIA/gpu-driver-container/actions/runs/22012665274/job/63611032634. The root cause is missing architecture inference from instance type — when image.architecture is unset, holodeck defaults to x86_64 regardless of the instance type. A new PR will address this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants