Centos7安裝 All-in-One 模式安裝 KubeSphere


公司用KubeSphere有一段時間了,之前我只是在大佬的搭建好的平台上使用,現在准備自己搭建自己的環境

其中踩了不少的坑,之前是centos8安裝,但是失敗了。后來看網上是centos7的文檔比較多,就重新裝了一個centos7的虛擬機

跟着官方一步步安裝的時候也踩了不少坑,現在就按照踩完坑的步驟安裝 官網地址

1. 安裝centos7

這里不做贅述,如果是虛擬機安裝的話,一定要把處理器核心數設置在 2以上,這是k8s安裝配置要求的

2. 配置 ip

 vi /etc/sysconfig/network-scripts/ifcfg-ens33
 ## 簡單的就是設置為靜態ip
 ONBOOT=yes

3. 禁用selinux(坑 一)

vi /etc/sysconfig/selinux
## 這是設置一個屬性為disabled
SELINUX=disabled

配置完之后需要重啟 reboot

4. 官網要求

(1)節點必須能夠通過 SSH 連接。

(2)節點上可以使用 sudo/curl/openssl 命令。

(3)docker 可以由您自己安裝或由 KubeKey 安裝。

注意:如果你想離線安裝 KubeSphere,請務必提前安裝好 docker。

安裝要求的依賴

yum install socat conntrack ebtables ipset

5. 關閉防火牆(坑二)

systemctl stop firewalld.service # 停止
systemctl disable firewalld.service # 禁用防火牆,下次啟動也不會開啟

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

# 先執行以下命令以確保從正確的區域下載 KubeKey
export KKZONE=cn
# 執行以下命令下載 KubeKey
curl -sfL https://get-kk.kubesphere.io | VERSION=v1.0.1 sh -
# 為kk添加可執行權限
chmod +x kk

8. 安裝Kubernetes和kubesphere

# 安裝
./kk create cluster --with-kubernetes v1.17.9 --with-kubesphere v3.0.0

驗證結果

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.登錄


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM