CentOS安装 All-in-One 模式安装 KubeSphere,


Kubesphere官方文档:

https://kubesphere.com.cn/docs/quick-start/all-in-one-on-linux/

1. 安装CentOS

要把处理器核心数设置在 2以上,这是k8s安装配置要求的

2. 配置 ip

  1. vi /etc/sysconfig/network-scripts/ifcfg-ens33 
  2. ## 简单的就是设置为静态ip 
  3. ONBOOT=yes 

3. 禁用selinux(坑 一)

  1. vi /etc/sysconfig/selinux 
  2. ## 这是设置一个属性为disabled 
  3. SELINUX=disabled 

配置完之后需要重启 reboot

4. 官网要求

(1)节点必须能够通过 SSH 连接。

(2)节点上可以使用 sudo/curl/openssl 命令。

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

注意:如果你想离线安装 KubeSphere,请务必提前安装好 docker。

安装要求的依赖

  1. yum install socat conntrack ebtables ipset 

5. 关闭防火墙(坑二)

  1. systemctl stop firewalld.service # 停止 
  2. systemctl disable firewalld.service # 禁用防火墙,下次启动也不会开启 

6. 安装docker(坑三)

  1. # 1. 安装docker 
  2. yum  install docker docker.io 
  3. # 2. 配置docker 源 
  4. vim /etc/docker/daemon.json 
  5.         "registry-mirrors": [ 
  6.                 "https://registry.docker-cn.com" 
  7.         ] 
  8. # 3. 重载docker 
  9. sudo systemctl daemon-reload 
  10. sudo systemctl restart docker 

7. 安装KubeKey

  1. # 先执行以下命令以确保从正确的区域下载 KubeKey 
  2. export KKZONE=cn 
  3. # 执行以下命令下载 KubeKey 
  4. curl -sfL https://get-kk.kubesphere.io | VERSION=v1.0.1 sh - 
  5. # 为kk添加可执行权限 
  6. chmod +x kk 

8. 安装Kubernetes和kubesphere

  1. # 安装 
  2. ./kk create cluster --with-kubernetes v1.17.9 --with-kubesphere v3.0.0 

验证结果

  1. kubectl logs -n kubesphere-system $(kubectl get pod -n kubesphere-system -l app=ks-install -o jsonpath='{.items[0].metadata.name}') -f 
  1. ************************************************** 
  2. ##################################################### 
  3. ###              Welcome to KubeSphere!           ### 
  4. ##################################################### 
  5. Console: http://192.168.106.135:30880 
  6. Account: admin 
  7. Password: P@88w0rd 
  8. NOTES: 
  9.   1. After logging into the console, please check the 
  10.      monitoring status of service components in 
  11.      the "Cluster Management". If any service is not 
  12.      ready, please wait patiently until all components 
  13.      are ready. 
  14.   2. Please modify the default password after login. 
  15. ##################################################### 
  16. https://kubesphere.io             2021-08-28 12:20:55 
  17. ##################################################### 

9.登录

CentOS安装 All-in-One 模式安装 KubeSphere

相关内容