在 ubuntu 上以 All-in-One 模式安装 KubeSphere

297 阅读1分钟

设置仓库

更新 apt 包索引。

sudo apt-get update -y
sudo apt-get install -y  openssh-server

卸载旧版本

Docker 的旧版本被称为 docker,docker.io 或 docker-engine 。如果已安装,请卸载它们:

$ sudo apt-get remove docker docker-engine docker.io containerd runc

docker安装命令如下

curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun

curl -sSL https://get.daocloud.io/docker | sh

配置镜像源

vi /etc/docker/daemon.json

{
  "log-opts": {
    "max-size": "5m",
    "max-file":"3"
  },
  "exec-opts": ["native.cgroupdriver=systemd"],
  "insecure-registries": ["192.168.8.75"]
}

修改完成后reload配置文件

 systemctl daemon-reload 
 systemctl restart docker.service

查看状态

sudo systemctl status docker -l

ubuntu 防火墙的卸载和关闭

sudo ufw disable
sudo apt-get remove iptables  openssh-server

安装必须插件

apt-get install -y socat conntrack

使用KubeKey安装kubesphere

curl -sfL https://get-kk.kubesphere.io | VERSION=v1.2.0 sh -
chmod +x kk
./kk create cluster --with-kubernetes v1.21.5 --with-kubesphere v3.2.0

输入以下命令以检查安装结果。

kubectl logs -n kubesphere-system $(kubectl get pod -n kubesphere-system -l app=ks-install -o jsonpath='{.items[0].metadata.name}') -f