CentOS安裝 All-in-One 模式安裝 KubeSphere
作者:七星院長
對(duì)于剛接觸 KubeSphere 并想快速上手該容器平臺(tái)的用戶,All-in-One 安裝模式是最佳的選擇,它能夠幫助您零配置快速部署 KubeSphere 和 Kubernetes。
Kubesphere官方文檔:
https://kubesphere.com.cn/docs/quick-start/all-in-one-on-linux/
1. 安裝CentOS
要把處理器核心數(shù)設(shè)置在 2以上,這是k8s安裝配置要求的
2. 配置 ip
- vi /etc/sysconfig/network-scripts/ifcfg-ens33
- ## 簡(jiǎn)單的就是設(shè)置為靜態(tài)ip
- ONBOOT=yes
3. 禁用selinux(坑 一)
- vi /etc/sysconfig/selinux
- ## 這是設(shè)置一個(gè)屬性為disabled
- SELINUX=disabled
配置完之后需要重啟 reboot
4. 官網(wǎng)要求
(1)節(jié)點(diǎn)必須能夠通過 SSH 連接。
(2)節(jié)點(diǎn)上可以使用 sudo/curl/openssl 命令。
(3)docker 可以由您自己安裝或由 KubeKey 安裝。
注意:如果你想離線安裝 KubeSphere,請(qǐng)務(wù)必提前安裝好 docker。
安裝要求的依賴
- yum install socat conntrack ebtables ipset
5. 關(guān)閉防火墻(坑二)
- systemctl stop firewalld.service # 停止
- systemctl disable firewalld.service # 禁用防火墻,下次啟動(dòng)也不會(huì)開啟
6. 安裝docker(坑三)
- # 1. 安裝docker
- yum install docker docker.io
- # 2. 配置docker 源
- vim /etc/docker/daemon.json
- {
- "registry-mirrors": [
- "https://registry.docker-cn.com"
- ]
- }
- # 3. 重載docker
- sudo systemctl daemon-reload
- sudo systemctl restart docker
7. 安裝KubeKey
- # 先執(zhí)行以下命令以確保從正確的區(qū)域下載 KubeKey
- export KKZONE=cn
- # 執(zhí)行以下命令下載 KubeKey
- curl -sfL https://get-kk.kubesphere.io | VERSION=v1.0.1 sh -
- # 為kk添加可執(zhí)行權(quán)限
- chmod +x kk
8. 安裝Kubernetes和kubesphere
- # 安裝
- ./kk create cluster --with-kubernetes v1.17.9 --with-kubesphere v3.0.0
驗(yàn)證結(jié)果
- kubectl logs -n kubesphere-system $(kubectl get pod -n kubesphere-system -l app=ks-install -o jsonpath='{.items[0].metadata.name}') -f
- **************************************************
- #####################################################
- ### Welcome to KubeSphere! ###
- #####################################################
- Console: http://192.168.106.135:30880
- Account: admin
- Password: P@88w0rd
- NOTES:
- 1. After logging into the console, please check the
- monitoring status of service components in
- the "Cluster Management". If any service is not
- ready, please wait patiently until all components
- are ready.
- 2. Please modify the default password after login.
- #####################################################
- https://kubesphere.io 2021-08-28 12:20:55
- #####################################################
9.登錄

責(zé)任編輯:姜華
來源:
今日頭條