fix(templates): runtime Kubernetes arch detection for arm64#668
fix(templates): runtime Kubernetes arch detection for arm64#668ArangoGutierrez wants to merge 1 commit intoNVIDIA:mainfrom
Conversation
…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>
There was a problem hiding this comment.
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
amd64default with runtime detection in three Kubernetes templates (kubeadm, git source, latest source) - Removed the hardcoded assignment in
NewKubernetesfunction - 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 |
Pull Request Test Coverage Report for Build 22021792600Details
💛 - Coveralls |
|
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 |
Summary
amd64default for Kubernetes arch with runtime detectiondpkg --print-architecture(falls back touname -mmapping)Archstill takes precedenceTest plan
go test ./pkg/provisioner/templates/... -vpasses