rancher / rke2

https://docs.rke2.io/
Apache License 2.0
1.53k stars 266 forks source link

Can't Install RKE2 on ARM64 Architecture #6926

Open ccravens opened 2 hours ago

ccravens commented 2 hours ago

Environmental Info: RKE2 Version: v1.28.3~rke2r1

Node(s) CPU architecture, OS, and Version: Rocky 8.10 aarch64

Cluster Configuration: 3 masters 6 workers

Describe the bug: I'm running the following command as root:

curl -sfL https://get.rke2.io/ | INSTALL_RKE2_TYPE="server" INSTALL_RKE2_VERSION="v1.28.3+rke2r1" sh -

However I get the following error:

[INFO]  using 1.28 series from channel stable
Rancher RKE2 Common (stable)                     21 kB/s | 2.9 kB     00:00    
Rancher RKE2 1.28 (stable)                       23 kB/s | 2.9 kB     00:00    
Error: 
 Problem: conflicting requests
  - package rke2-server-1.28.3~rke2r1-0.el8.x86_64 from rancher-rke2-1.28-stable does not have a compatible architecture
  - nothing provides rke2-common = 1.28.3~rke2r1-0.el8 needed by rke2-server-1.28.3~rke2r1-0.el8.x86_64 from rancher-rke2-1.28-stable
(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)

Even though in the https://get.rke2.io/ script, I see this:

# setup_arch set arch and suffix,
# fatal if architecture not supported.
setup_arch() {
    case ${ARCH:=$(uname -m)} in
    x86_64|amd64)
        ARCH=amd64
        SUFFIX=$(uname -s | tr '[:upper:]' '[:lower:]')-${ARCH}
        ;;
    aarch64|arm64)
        ARCH=arm64
        SUFFIX=$(uname -s | tr '[:upper:]' '[:lower:]')-${ARCH}
        ;;
    s390x)
        ARCH=s390x
        SUFFIX=$(uname -s | tr '[:upper:]' '[:lower:]')-${ARCH}
        ;;
    *)
        fatal "unsupported architecture ${ARCH}"
        ;;
    esac
}

Which returns the correct value of aarch64:

[root@localhost ~]# uname -m
aarch64

Why is it pulling x86_64 packages when installing on an aarch64 architecture?

Steps To Reproduce: Run the following on an ARM64 build of Rocky 8.10:

curl -sfL https://get.rke2.io/ | INSTALL_RKE2_TYPE="server" INSTALL_RKE2_VERSION="v1.28.3+rke2r1" sh -

Expected behavior: RKE2 installer uses the correct repo for aarch64

Actual behavior: RKE2 installer uses the incorrect repo x86_64

Additional context / logs: None

ccravens commented 1 hour ago

ok I think I found the issue, in the install script at https://get.rke2.io/, x86_64 is hardcoded when creating the repo entry:

    cat <<-EOF >"${repodir}/rancher-rke2.repo"
[rancher-rke2-common-${rke2_rpm_channel}]
name=Rancher RKE2 Common (${1})
baseurl=https://${rpm_site}/rke2/${rke2_rpm_channel}/common/${rpm_site_infix}/noarch
enabled=1
gpgcheck=1
repo_gpgcheck=0
gpgkey=https://${rpm_site}/public.key
EOF

    if [ -z "${INSTALL_RKE2_COMMIT}" ]; then
    cat <<-EOF >>"${repodir}/rancher-rke2.repo"
[rancher-rke2-${rke2_majmin}-${rke2_rpm_channel}]
name=Rancher RKE2 ${rke2_majmin} (${1})
baseurl=https://${rpm_site}/rke2/${rke2_rpm_channel}/${rke2_majmin}/${rpm_site_infix}/x86_64 ### Hardcoded
enabled=1
gpgcheck=1
repo_gpgcheck=0
gpgkey=https://${rpm_site}/public.key
EOF

And I confirmed this when cat'ing out the repo entry:

[root@localhost ~]# uname -m
aarch64
[root@localhost ~]# cat /etc/yum.repos.d/rancher-rke2.repo 
[rancher-rke2-common-stable]
name=Rancher RKE2 Common (stable)
baseurl=https://rpm.rancher.io/rke2/stable/common/centos/8/noarch
enabled=1
gpgcheck=1
repo_gpgcheck=0
gpgkey=https://rpm.rancher.io/public.key
[rancher-rke2-1.28-stable]
name=Rancher RKE2 1.28 (stable)
baseurl=https://rpm.rancher.io/rke2/stable/1.28/centos/8/x86_64. ## x86_84
enabled=1
gpgcheck=1
repo_gpgcheck=0
gpgkey=https://rpm.rancher.io/public.key
[root@localhost ~]#
cwayne18 commented 15 minutes ago

Also I'm not sure we had RPMs built for 1.28.3, why are you specifically using such an old version?

brandond commented 7 minutes ago

We just started providing RPMs for arm64 with last month's releases, but this was already pointed out on Slack.