赞
踩
地址: https://download.docker.com/linux/static/stable/
进入aarch64目录,下载需要的docker版本
下载后上传至服务器解压
- tar -xvf docker-20.10.7.tgz
- # 将 docker 文件移动到 /usr/bin 目录下
- cp -p docker/* /usr/bin
vim docker.service
内容如下:
-
- [Unit]
- Description=Docker Application Container Engine
- Documentation=https://docs.docker.com
- After=network-online.target firewalld.service
- Wants=network-online.target
-
- [Service]
- Type=notify
- # the default is not to use systemd for cgroups because the delegate issues still
- # exists and systemd currently does not support the cgroup feature set required
- # for containers run by docker
- ExecStart=/usr/bin/dockerd
- ExecReload=/bin/kill -s HUP $MAINPID
- # Having non-zero Limit*s causes performance problems due to accounting overhead
- # in the kernel. We recommend using cgroups to do container-local accounting.
- LimitNOFILE=infinity
- LimitNPROC=infinity
- LimitCORE=infinity
- # Uncomment TasksMax if your systemd version supports it.
- # Only systemd 226 and above support this version.
- #TasksMax=infinity
- TimeoutStartSec=0
- # set delegate yes so that systemd does not reset the cgroups of docker containers
- Delegate=yes
- # kill only the docker process, not all processes in the cgroup
- KillMode=process
- # restart the docker process if it exits prematurely
- Restart=on-failure
- StartLimitBurst=3
- StartLimitInterval=60s
-
- [Install]
- WantedBy=multi-user.target

添加到系统服务
- # 将 docker.service 移到 /etc/systemd/system/ 目录
- cp docker.service /etc/systemd/system/
- # 设置 docker.service 文件权限
- chmod +x /etc/systemd/system/docker.service
-
- # 重新加载配置文件
- systemctl daemon-reload
-
- # 启动docker
- systemctl start docker
-
- # 设置 docker 开机自启
- systemctl enable docker.service
参考:三步搞定 ARM64 离线部署 Kubernetes + KubeSphere
curl -Ok https://kubesphere-installer.pek3b.qingstor.com/offline/v3.0.0/kubesphere-core-v3.0.0-offline-linux-arm64.tar.gz
./kk create config
生产后修改配置文件内容
- apiVersion: kubekey.kubesphere.io/v1alpha1
- kind: Cluster
- metadata:
- name: sample
- spec:
- hosts:
- # 注意指定节点 arch 为 arm64
- - {name: node1, address: 192.168.0.163, internalAddress: 192.168.0.163, password: 123456, arch: arm64}
- roleGroups:
- etcd:
- - node1
- master:
- - node1
- worker:
- - node1
- controlPlaneEndpoint:
- domain: lb.kubesphere.local
- address: ""
- port: 6443
- kubernetes:
- version: v1.17.9
- imageRepo: kubesphere
- clusterName: cluster.local
- network:
- plugin: calico
- kubePodsCIDR: 10.233.64.0/18
- kubeServiceCIDR: 10.233.0.0/18
- registry:
- registryMirrors: []
- insecureRegistries: []
- privateRegistry: dockerhub.kubekey.local #添加此行
- addons: []

解压后进入kubesphere-core-v3.0.0-offline-linux-arm64/kubesphere-images-v3.0.0目录
执行导入
docker load < registry.tar
创建测试用自签名镜像仓库:
./kk init os -f config-example.yaml --add-images-repo
注意:由 kk 启动的镜像仓库端口为443,请确保所有机器均可访问当前机器443端口
进入kubesphere-all-v3.0.0-offline-linux-arm64/kubesphere-images-v3.0.0 使用 offline-installation-tool.sh 将镜像导入之前准备的仓库中:
- # 脚本后镜像仓库地址请填写真实仓库地址
- ./offline-installation-tool.sh -l images-list-v3.0.0.txt -d kubesphere-images -r dockerhub.kubekey.local
- # 以上准备工作完成且再次检查配置文件无误后,执行安装。
- ./kk create cluster -f config-sample.yaml --with-kubesphere
kubectl logs -n kubesphere-system $(kubectl get pod -n kubesphere-system -l app=ks-install -o jsonpath='{.items[0].metadata.name}') -f
如果使用的云服务器,记得开放安全组30880端口
原因:config-sample.yaml中未添加 registry. dockerhub.kubekey.local 导致k8s安装过程中使用了x86架构的ks-install镜像。修改配置文件后,重新执行安装即可。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。