随着信创产业的推进,鲲鹏arm64架构得以快速发展。而由于信创领域的主要客户通常部署在内网环境中,这使得离线部署成为该架构方案实施过程中不可或缺的关键环节。
本文将演示基于arm64
版麒麟V10离线部署的完整过程。
环境涉及软件版本信息
服务器基本信息
[root@node1 ~]# uname -a
Linux node1 4.19.90-17.5.ky10.aarch64 #1 SMP Fri Aug 7 13:35:33 CST 2020 aarch64 aarch64 aarch64 GNU/Linux
[root@node1 ~]#
[root@node1 ~]# cat /etc/os-release
NAME="Kylin Linux Advanced Server"
VERSION="V10 (Tercel)"
ID="kylin"
VERSION_ID="V10"
PRETTY_NAME="Kylin Linux Advanced Server V10 (Tercel)"
ANSI_COLOR="0;31"
[root@node1 ~]#
作者使用k8s
和kubesphere
过程中已适配芯片和操作系统如下:
本文由 [编码如写诗-天行1st] 原创编写,有任何问题可添加作者微信 [sd_zdhr] 获取帮助。
关于我:
Golang
、Docker
、kubernetes
、KubeSphere
。k8s
&KubeSphere
布道者、KubeSphere
离线部署布道者编码如写诗
,作者:天行1st
,微信:sd_zdhr
kt
是基于kk
二次开发产物,主要为适配信创国产化环境和简化arm
部署过程。
支持arm64
和amd64
架构国产操作系统,已适配芯片+操作系统如上。
参考如下示例准备至少三台主机,其中node1可省略,让master节点即是主节点也是工作节点
主机名 | IP | 架构 | OS | 用途 |
---|---|---|---|---|
node | 192.168.3.249 | X86_64 | Ubuntu24.04 | 联网主机,用于制作离线包 |
node1 | 192.168.0.80 | arm64 | 麒麟V10 | 离线环境主节点,镜像仓库节点 |
在node可联网节点上操作
将kt_x86.tar.gz[1]上传至可联网节点解压后操作,即日起至2025-07-09
免费使用。
export KKZONE=cn
./kt create manifest --with-kubernetes v1.30.12 --with-registry
vi manifest-sample.yaml
apiVersion: kubekey.kubesphere.io/v1alpha2
kind:Manifest
metadata:
name:sample
spec:
arches:
-arm64
operatingSystems:[]
kubernetesDistributions:
-type:kubernetes
version:v1.30.12
components:
helm:
version:v3.14.3
cni:
version:v1.2.0
etcd:
version:v3.5.13
containerRuntimes:
-type:docker
version:24.0.9
-type:containerd
version:1.7.13
calicoctl:
version:v3.27.4
crictl:
version:v1.29.0
docker-registry:
version:"2"
harbor:
version:v2.7.1
docker-compose:
version:v2.26.1
images:
-registry.cn-beijing.aliyuncs.com/kubesphereio/pause:3.9
-registry.cn-beijing.aliyuncs.com/kubesphereio/kube-apiserver:v1.30.12
-registry.cn-beijing.aliyuncs.com/kubesphereio/kube-controller-manager:v1.30.12
-registry.cn-beijing.aliyuncs.com/kubesphereio/kube-scheduler:v1.30.12
-registry.cn-beijing.aliyuncs.com/kubesphereio/kube-proxy:v1.30.12
-registry.cn-beijing.aliyuncs.com/kubesphereio/coredns:1.9.3
-registry.cn-beijing.aliyuncs.com/kubesphereio/k8s-dns-node-cache:1.22.20
-registry.cn-beijing.aliyuncs.com/kubesphereio/kube-controllers:v3.27.4
-registry.cn-beijing.aliyuncs.com/kubesphereio/cni:v3.27.4
-registry.cn-beijing.aliyuncs.com/kubesphereio/node:v3.27.4
-registry.cn-beijing.aliyuncs.com/kubesphereio/pod2daemon-flexvol:v3.27.4
# ks
-dockerhub.kubekey.local/gjing1st/kubesphere/ks-extensions-museum:v1.1.6
-dockerhub.kubekey.local/gjing1st/kubesphere/ks-controller-manager:v4.1.3
-dockerhub.kubekey.local/gjing1st/kubesphere/ks-apiserver:v4.1.3
-dockerhub.kubekey.local/gjing1st/kubesphere/ks-console:v4.1.3
-dockerhub.kubekey.local/gjing1st/kubesphere/kubectl:v1.27.16
registry:
auths:{}
export KKZONE=cn
./kt artifact export -m manifest-sample.yaml -o artifact-arm-k8s13012-ks413.tar.gz
可以看到下载了arm64
版本的harbor
,由于harbor
官方不支持arm版本,因此kk
也不支持arm
版本harbor
。此版本harbor
和kk
为自己制作,由于harbor:v2.8.0
版本之后不支持扩展helm
功能,我司需要用其helm
管理应用,所以这里使用v2.7.1
版本。
安装helm
curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
下载 KubeSphere Core Helm Chart
VERSION=1.1.3 # Chart 版本
helm fetch https://charts.kubesphere.io/main/ks-core-${VERSION}.tgz
将 kt、制品 artifact 、Helm文件等通过介质拷贝至node1节点。
所有节点,上传kt_arm.tar.gz[2]解压后执行./kt init-os
。已适配操作系统和架构见1.说明
主要修改相关节点和harbor信息
vi config-sample.yaml
kind: Cluster
metadata:
name:sample
spec:
hosts:
- {name:node1,address:192.168.0.80,internalAddress:192.168.0.80,user:root,password:"123456"}
roleGroups:
etcd:
-node1
control-plane:
-node1
worker:
-node1
registry:
- node1
controlPlaneEndpoint:
## Internal loadbalancer for apiservers
# internalLoadbalancer: haproxy
domain:lb.kubesphere.local
address:""
port:
kubernetes:
version:v1.30.12
clusterName:cluster.local
autoRenewCerts:true
containerManager:docker
etcd:
type:kubekey
network:
plugin:calico
kubePodsCIDR:10.233.64.0/18
kubeServiceCIDR:10.233.0.0/18
## multus support. https://github.com/k8snetworkplumbingwg/multus-cni
multusCNI:
enabled:false
registry:
type:harbor
registryMirrors:[]
insecureRegistries:[]
privateRegistry:"dockerhub.kubekey.local"
namespaceOverride:"kubesphereio"
auths:# if docker add by `docker login`, if containerd append to `/etc/containerd/config.toml`
"dockerhub.kubekey.local":
username:"admin"
password:Harbor@123# 此处可自定义,kk3.1.8新特性
skipTLSVerify:true# Allow contacting registries over HTTPS with failed TLS verification.
plainHTTP:false# Allow contacting registries over HTTP.
certsPath:"/etc/docker/certs.d/dockerhub.kubekey.local"
addons:[]
./kt init registry -f config-sample.yaml -a artifact-arm-k8s13012-ks413.tar.gz
可以看到使用了arm64
版本的harbor
说明:
Harbor 管理员账号:admin,密码:Harbor@123。密码同步使用配置文件中的对应password
harbor 安装文件在 /opt/harbor
目录下,可在该目录下对 harbor 进行运维。
vi create_project_harbor.sh
#!/usr/bin/env bash
url="https://dockerhub.kubekey.local"# 或修改为实际镜像仓库地址
user="admin"
passwd="Harbor@123"
harbor_projects=(
gjing1st
kubesphere
kubesphereio
)
for project in"${harbor_projects[@]}"; do
echo"creating $project"
curl -u "${user}:${passwd}" -X POST -H "Content-Type: application/json""${url}/api/v2.0/projects" -d "{ \"project_name\": \"${project}\", \"public\": true}" -k # 注意在 curl 命令末尾加上 -k
done
chmod +x create_project_harbor.sh
./create_project_harbor.sh
执行以下命令创建 Kubernetes 集群:
./kt create cluster -f config-sample.yaml -a artifact-arm-k8s13012-ks413.tar.gz --with-local-storage
等待大概两分钟左右看到成功消息
helm upgrade --install -n kubesphere-system --create-namespace ks-core ks-core-1.1.5.tgz \
--set global.imageRegistry=dockerhub.kubekey.local/ks \
--set extension.imageRegistry=dockerhub.kubekey.local/ks \
--set ksExtensionRepository.image.tag=v1.1.5 \
--debug \
--wait
等待大概30秒左右看到成功消息
登录页面
初次登录需要换密码,如果不想换也可以继续填写P@88w0rd
,不过建议更换
首页
集群节点版本信息
概览
引用链接
[1]
kt_x86版本: https://pan.quark.cn/s/43079afd65de。
[2]
kt_arm版本: https://pan.quark.cn/s/d622235b7b12。
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有