k3s 搭建
2024-08-03 23:03:54

安装docker

快捷安装脚本

1
curl -fsSl https://xmp.icu/sh/docker.sh | sh

配置docker

快捷安装脚本

1
curl -fsSl https://xmp.icu/sh/dockerconfig.sh | sh

初始化服务器

快捷安装脚本

1
curl -fsSl https://xmp.icu/sh/init.sh | sh

安装k3s

  1. 安装master
1
curl -sfL https://rancher-mirror.rancher.cn/k3s/k3s-install.sh | INSTALL_K3S_MIRROR=cn  K3S_TOKEN=ucarzw3ot8l79vbek4jmi0qg51pnh62y sh  -s - server --docker --node-external-ip="xxx.外网ip.xxx.xxx" feature-gates=RemoveSelfLink=false --disable=local-storage  --flannel-external-ip --cluster-init
  1. 加入master
1
curl -sfL https://rancher-mirror.rancher.cn/k3s/k3s-install.sh | INSTALL_K3S_MIRROR=cn K3S_TOKEN=ucarzw3ot8l79vbek4jmi0qg51pnh62y sh  -s - server --server https://本机外网ip:6443  --docker --node-external-ip="主节点外网ip|内网ip"  --flannel-external-ip  --cluster-init
  1. 安装worker
1
curl -sfL https://rancher-mirror.rancher.cn/k3s/k3s-install.sh | INSTALL_K3S_MIRROR=cn K3S_URL=https://内网ip:6443 K3S_TOKEN=ucarzw3ot8l79vbek4jmi0qg51pnh62y sh -s - --docker  --node-external-ip="本机外网ip"

安装kubesphere

1
2
3
4
5
6
7
8
curl -L -O https://github.com/kubesphere/ks-installer/releases/download/v3.4.1/kubesphere-installer.yaml

kubectl apply -f kubesphere-installer.yaml

curl -L -O https://github.com/kubesphere/ks-installer/releases/download/v3.4.1/cluster-configuration.yaml

kubectl apply -f cluster-configuration.yaml

查看安装日志(https://kubesphere.io/zh/docs/v3.4/quick-start/minimal-kubesphere-on-k8s/)

1
kubectl logs -n kubesphere-system $(kubectl get pod -n kubesphere-system -l 'app in (ks-install, ks-installer)' -o jsonpath='{.items[0].metadata.name}') -f
上一页
2024-08-03 23:03:54