确保机器已经安装所需依赖软件(sudo curl openssl ebtables socat ipset conntrack docker)
具体环境要求参见:https://github.com/kubesphere/kubekey/tree/release-1.0#requirements-and-recommendations
提示:如使用 centos7.x、ubuntu18.04,则可以选择使用 kk 命令对机器进行初始化。 解压安装包,并创建好配置文件之后(创建方法请看下文),可执行如下命令对节点进行初始化:
./kk init os -s ./dependencies -f config-sample.yaml 如使用该命令遇到依赖问题,可自行安装相关依赖软件。
镜像仓库
可使用 harbor 或其他第三方镜像仓库。
提示:可使用 kk 命令自动创建测试用自签名镜像仓库。注意,请确保当前机器存在registry:2,如没有,可从解压包 kubesphere-images-v3.0.0/registry.tar 中导入,导入命令:
docker load < registry.tar。
创建测试用自签名镜像仓库:
./kk init os -f config-sample.yaml --add-images-repo
注意:由 kk 启动的镜像仓库端口为443,请确保所有机器均可访问当前机器443端口。镜像数据存储到本地/mnt/registry (建议单独挂盘)。
安装包下载:
提示:该安装包仅包含 Kubernetes + KubeSphere-core 镜像,如需更多组件 arm64 镜像,可自行编译构建。
curl -Ok https://kubesphere-installer.pek3b.qingstor.com/offline/v3.0.0/kubesphere-core-v3.0.0-offline-linux-arm64.tar.gz
/data/site/h.htmltoo.com/soft/k8s/kubesphere-core-v3.0.0-offline-linux-arm64.tar.gz
# 安装步骤
1. 创建集群配置文件
/data/site/h.htmltoo.com/soft/k8s/kubesphere-core-v3.0.0-offline-linux-arm64
./kk create config
-根据实际环境信息修改生成的配置文件config-sample.yaml,
也可使用-f参数自定义配置文件路径。
kk 详细用法可参考:https://github.com/kubesphere/kubekey
注意填写正确的私有仓库地址privateRegistry
(如已准备好私有仓库可设置为已有仓库地址,若使用 kk 创建私有仓库,则该参数设置为:dockerhub.kubekey.local)
config-sample.yaml
apiVersion: kubekey.kubesphere.io/v1alpha1
kind: Cluster
metadata:
name: sample
spec:
hosts:
# 注意指定节点 arch 为 arm64
- {name: node1, address: 172.169.102.249, internalAddress: 172.169.102.249, password: Qcloud@123, 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: []
2. 导入镜像
进入kubesphere-all-v3.0.0-offline-linux-arm64/kubesphere-images-v3.0.0
使用 offline-installation-tool.sh 将镜像导入之前准备的仓库中:
cd kubesphere-images-v3.0.0
# 脚本后镜像仓库地址请填写真实仓库地址
./offline-installation-tool.sh -l images-list-v3.0.0.txt -d kubesphere-images -r dockerhub.kubekey.local
3. 执行安装
# 以上准备工作完成且再次检查配置文件无误后,执行安装。
./kk create cluster -f config-sample.yaml --with-kubesphere
https://blog.csdn.net/smart9527_zc/article/details/82493375