环境涉及软件版本信息
服务器芯片: 鲲鹏920/飞腾2000(arm64)
操作系统:银河麒麟V10
Containerd: 1.7.13
Kubernetes:v1.30.12
KubeSphere:v4.1.3
KubeKey: v3.1.9(二开版)
Docker: 24.0.9
DockerCompose: v2.26.1
Harbor: v2.7.1
Prometheus: v2.51.2
服务器基本信息
暂时无法在飞书文档外展示此内容
[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 ~]#
4 离线部署准备
4.1 将安装包拷贝至离线环境
将下载的 kt、制品 artifact 、Helm文件等介质拷贝至master主节点。
4.2 初始化操作系统
所有节点,上传[kt_arm.tar.gz](https://pan.quark.cn/s/d622235b7b12。 "kt_arm版本")
解压后执行./kt init-os
。已适配操作系统和架构见1.说明
4.3 修改配置文件
主要修改相关节点和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",arch: "arm64"}
roleGroups:
etcd:
- node1
control-plane:
- node1
worker:
- node1
# 如需使用 kk 自动部署镜像仓库,请设置该主机组 (建议仓库与集群分离部署,减少相互影响)
# 如果需要部署 harbor 并且 containerManager 为 containerd 时,由于部署 harbor 依赖 docker,建议单独节点部署 harbor
registry:
- node1
controlPlaneEndpoint:
## Internal loadbalancer for apiservers
# internalLoadbalancer: haproxy
domain: lb.kubesphere.local
address: ""
port: 6443
kubernetes:
version: v1.30.12
clusterName: cluster.local
autoRenewCerts: true
containerManager: docker
etcd:
type: kubekey
network:
plugin: flannel
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: []
4.4 创建镜像仓库
./kt init registry -f config-sample.yaml -a artifact-arm-k8s13012-ks413.tar.gz
可以看到使用了arm64
版本的harbor
4.5 创建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=(
ks
kubesphere
kubesphereio
gjing1st
)
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
创建 Harbor 项目
chmod +x create_project_harbor.sh
./create_project_harbor.sh
验证
5 安装Kubernetes
执行以下命令创建 Kubernetes 集群:
./kt create cluster -f config-sample.yaml -a artifact-arm-k8s13012-ks413.tar.gz --with-local-storage
等待大概两分钟左右看到成功消息
6 安装 KubeSphere
helm upgrade --install -n kubesphere-system --create-namespace ks-core ks-core-1.1.5.tgz \
--set global.imageRegistry=dockerhub.kubekey.local/gjing1st \
--set extension.imageRegistry=dockerhub.kubekey.local/gjing1st \
--set ksExtensionRepository.image.tag=v1.1.6 \
--debug \
--wait
等待大概30秒左右看到成功消息
7 验证
登录页面
初次登录需要换密码,如果不想换也可以继续填写P@88w0rd
,不过建议更换
首页
集群节点版本信息
概览
评论区