概述

因项目需要,老大要在ARM服务器上的银河麒麟系统安装KubeSpere 3.3,然鹅KubeSpere 3.3需要Docker版本>= 19.3.8,银河麒麟V10 SP1和SP2官方源的Docker版本都是18.09.0,故而只有两个解决方案:

  1. KubeSpere降级
  2. 升级Docker

解决方案1- KubeSpere降级

将KubeSpere降级到3.0版本即可适用18.09.0。另外KubeSpere和Docker版本不适用主要原因来源于Kubernetes(K8S)和Docker版本的兼容问题。具体对应关系可查看下面链接 不完全的版本对应关系

最终,胳膊拧不过大腿,该方案被老大按下了

解决方案2- 升级Docker

  1. 添加CentOS-7仓库的变量
echo 7 > /etc/yum/vars/releasever 

为啥是7,我用到的是CentOS-7的软件源,你们用来其他版本的自由设置。不设置该变量,会导致Docker源失效。至于为啥失效,看下Docker源的文件就知道了。

  1. 参照Docker官方链接,添加Docker最新源
 #移除旧版本 sudo yum remove docker \                  docker-client \                  docker-client-latest \                  docker-common \                  docker-latest \                  docker-latest-logrotate \                  docker-logrotate \                  docker-engine sudo yum install -y yum-utils #添加安装源 sudo yum-config-manager \    --add-repo \    https://download.docker.com/linux/centos/docker-ce.repo

3.参照Docker官方链接,

#安装最新版的Dockersudo yum install docker-ce docker-ce-cli containerd.io docker-compose-plugin

遇到的问题

1. 安装失败,提示 “需要:container-selinux >= 2:2.74”

X86架构下的解决方案

请参考链接

ARM架构下的解决方案

第一步:编辑repo源
vi /etc/yum.repo.d/CentOS-Base.repo, 写入以下内容

# CentOS-Base.repo## The mirror system uses the connecting IP address of the client and the# update status of each mirror to pick mirrors that are updated to and# geographically close to the client.  You should use this for CentOS updates# unless you are manually picking other mirrors.## If the mirrorlist= does not work for you, as a fall back you can try the# remarked out baseurl= line instead.## [base]name=CentOS-$releasever - Base#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=osbaseurl=http://mirrors.ustc.edu.cn/centos-altarch/$releasever/os/$basearch/gpgcheck=1enabled=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7       file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-AltArch-Arm32 #released updates[updates]name=CentOS-$releasever - Updates# mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updatesbaseurl=http://mirrors.ustc.edu.cn/centos-altarch/$releasever/updates/$basearch/gpgcheck=1enabled=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7       file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-AltArch-Arm32 #additional packages that may be useful[extras]name=CentOS-$releasever - Extras# mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extrasbaseurl=http://mirrors.ustc.edu.cn/centos-altarch/$releasever/extras/$basearch/gpgcheck=0 #跳过检测,不然会报错:fuse-overlayfs-0.7.2-6.el7_8.aarch64.rpm is not installed gpg keyenabled=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7       file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-AltArch-Arm32 #additional packages that extend functionality of existing packages[centosplus]name=CentOS-$releasever - Plus# mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplusbaseurl=http://mirrors.ustc.edu.cn/centos-altarch/$releasever/centosplus/$basearch/gpgcheck=1enabled=0gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7       file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-AltArch-Arm32

第二步:获取GPG Key
不获取GPG KEY,安装部分软件会报“Error:GPG check FAILED”,当然也可以将gpgcheck=1改为gpgcheck=0去跳过校验,但是不建议。
获取GPG KEY有导入和下载两种方式,二选一即可。

1.导入

rpm --import https://www.centos.org/keys/RPM-GPG-KEY-CentOS-7rpm --import https://www.centos.org/keys/RPM-GPG-KEY-CentOS-7-aarch64rpm --import https://www.centos.org/keys/RPM-GPG-KEY-CentOS-SIG-AltArch-Arm32

2.下载

cd /etc/pki/rpm-gpgwget https://www.centos.org/keys/RPM-GPG-KEY-CentOS-7wget https://www.centos.org/keys/RPM-GPG-KEY-CentOS-7-aarch64wget https://www.centos.org/keys/RPM-GPG-KEY-CentOS-SIG-AltArch-Arm32

第三步:参照解决方案2的步骤3,安装最新的Docker即可

2. fuse-overlayfs-0.7.2-6.el7_8.aarch64.rpm is not installed gpg key

该问题应该是GPG Key没有安装完全导致的。我采用了比较粗暴的解决方案,将CentOS-Base.repo [extras]源的gpgcheck=1改为gpgcheck=0,跳过GPG检测。

参考链接

CentOS GPG Key
CentOS ARM源参考
不完全的K8S和Docker版本对应
解决报错container-selinux >= 2:2.74 [x86_64]