KubeSphere单节点(all-in-one)平台搭建记录
KubeSphere单节点(all-in-one)平台搭建记录
一、主机准备
1.1 主机配置
| 主机IP | 角色 | 系统版本 | 主机配置 |
|---|---|---|---|
| 192.168.122.201 | all-in-one | CentOS 7.4 | CPU:2 核,内存:4 G,硬盘:60 G |
1.2 环境准备
关闭防火墙
systemctl disable --now firewalld
关闭SELinux
setenforce 0
关闭swap
swapoff -a
echo "vm.swappiness=0" >> /etc/sysctl.conf
sysctl -p /etc/sysctl.conf
sed -ri 's/.swap./#&/' /etc/fstab
内核参数设置
cat > /etc/sysctl.d/k8s.conf << EOF
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
net.ipv4.ip_forward = 1
EOF
sysctl --system
时间同步(ntp或chrony)
yum install -y ntpdate
ntpdate time.windows.com
检查DNS
cat /etc/resolv.conf
安装依赖组件
yum install -y curl socat conntrack
| 依赖项 | Kubernetes 版本 ≥ 1.18 | Kubernetes 版本 < 1.18 |
|---|---|---|
| socat | 必须 | 可选但建议 |
| conntrack | 必须 | 可选但建议 |
| ebtables | 可选但建议 | 可选但建议 |
| ipset | 可选但建议 | 可选但建议 |
安装、设置docker
集群必须有一个可用的容器运行时。如果使用 KubeKey 搭建集群,KubeKey 会默认安装最新版本的 Docker。或者,也可以在创建集群前手动安装 Docker 或其他容器运行时。
| 支持的容器运行时 | 版本 |
|---|---|
| Docker | 19.3.8+ |
| containerd(试验版,未经充分测试) | 最新版 |
| CRI-O(试验版,未经充分测试) | 最新版 |
| iSula(试验版,未经充分测试) | 最新版 |
二、下载kubekey
wget -c https://kubesphere.io/download/kubekey-v1.0.0-linux-amd64.tar.gz --no-check-certificate -O - | tar -xz
三、kubesphere安装并访问
3.1 安装kubesphere
./kk create cluster --with-kubernetes v1.18.6 --with-kubesphere v3.0.0
3.2 查看安装日志
kubectl logs -n kubesphere-system $(kubectl get pod -n kubesphere-system -l app=ks-install -o jsonpath=’{.items[0].metadata.name}’) -f

3.3 kubesphere访问
Console: http://192.168.122.201:30880
Account: admin
Password: P@88w0rd


浙公网安备 33010602011771号