使用国内镜像 在线安装 k3s 无法指定 1.28 版本

环境信息:
K3s 版本:

1.28
节点 CPU 架构、操作系统和版本::

111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
集群配置:

问题描述:

https://rancher-mirror.rancher.cn/k3s/k3s-install.sh 无法指定1.28版本
(为什么要装1.28 k3s, 因为当前 rancher 只支持到1.28)

复现步骤:

预期结果:
安装 1.28 k3s 成功

实际结果:
[INFO] Finding release for channel v1.28
[INFO] Using <?xml version="1.0" encoding="UTF-8"?>

NoSuchKey
The specified key does not exist.
66978C055B40CC33381E45CF
rancher-mirror.oss-cn-beijing.aliyuncs.com
k3s/channels/v1.28
0026-00000001
OpenAPI自助诊断-阿里云OpenAPI开发者门户
as release
[INFO] Downloading hash rancher-mirror.rancher.cn/k3s/<?xml version="1.0" encoding="UTF-8"?> NoSuchKey The specified key does not exist. 66978C055B40CC33381E45CF rancher-mirror.oss-cn-beijing.aliyuncs.com k3s/channels/v1.28 0026-00000001 OpenAPI自助诊断-阿里云OpenAPI开发者门户 /sha256sum-amd64.txt
[ERROR] download needs exactly 2 arguments

附加上下文/日志:

日志
[INFO]  Finding release for channel v1.28
[INFO]  Using <?xml version="1.0" encoding="UTF-8"?>
<Error>
  <Code>NoSuchKey</Code>
  <Message>The specified key does not exist.</Message>
  <RequestId>66978C055B40CC33381E45CF</RequestId>
  <HostId>rancher-mirror.oss-cn-beijing.aliyuncs.com</HostId>
  <Key>k3s/channels/v1.28</Key>
  <EC>0026-00000001</EC>
  <RecommendDoc>https://api.aliyun.com/troubleshoot?q=0026-00000001</RecommendDoc>
</Error> as release
[INFO]  Downloading hash rancher-mirror.rancher.cn/k3s/<?xml version="1.0" encoding="UTF-8"?> <Error> <Code>NoSuchKey</Code> <Message>The specified key does not exist.</Message> <RequestId>66978C055B40CC33381E45CF</RequestId> <HostId>rancher-mirror.oss-cn-beijing.aliyuncs.com</HostId> <Key>k3s/channels/v1.28</Key> <EC>0026-00000001</EC> <RecommendDoc>https://api.aliyun.com/troubleshoot?q=0026-00000001</RecommendDoc> </Error>/sha256sum-amd64.txt
[ERROR]  download needs exactly 2 arguments

国内的安装脚本确实存在这个问题,国内安装脚本没加 INSTALL_K3S_CHANNEL ,如果要指定版本,可使用:INSTALL_K3S_VERSION

@mingyard 现在,国内安装脚本也增加了 INSTALL_K3S_CHANNEL 指定 k3s 版本 的参数,示例如下:

root@ksd:~# curl -sfL https://rancher-mirror.rancher.cn/k3s/k3s-install.sh | INSTALL_K3S_MIRROR=cn INSTALL_K3S_CHANNEL=v1.28 sh -s - --system-default-registry "registry.cn-hangzhou.aliyuncs.com"
[INFO]  Finding release for channel v1.28
[INFO]  Using v1.28.11+k3s2 as release
[INFO]  Downloading hash rancher-mirror.rancher.cn/k3s/v1.28.11-k3s2/sha256sum-amd64.txt
[INFO]  Downloading binary rancher-mirror.rancher.cn/k3s/v1.28.11-k3s2/k3s
[INFO]  Verifying binary download
[INFO]  Installing k3s to /usr/local/bin/k3s
[INFO]  Skipping installation of SELinux RPM
[INFO]  Creating /usr/local/bin/kubectl symlink to k3s
[INFO]  Creating /usr/local/bin/crictl symlink to k3s
[INFO]  Skipping /usr/local/bin/ctr symlink to k3s, command exists in PATH at /usr/bin/ctr
[INFO]  Creating killall script /usr/local/bin/k3s-killall.sh
[INFO]  Creating uninstall script /usr/local/bin/k3s-uninstall.sh
[INFO]  env: Creating environment file /etc/systemd/system/k3s.service.env
[INFO]  systemd: Creating service file /etc/systemd/system/k3s.service
[INFO]  systemd: Enabling k3s unit
Created symlink /etc/systemd/system/multi-user.target.wants/k3s.service → /etc/systemd/system/k3s.service.
[INFO]  systemd: Starting k3s
1 个赞