0
点赞
收藏
分享

微信扫一扫

uniapp小程序订单页面UI

DYBOY 2023-06-29 阅读 51

目录

1准备3台虚拟机(centos7.9)

2 每台虚拟机更新yum的软件包,时间设置等

3 关闭防火墙

4 添加三台服务器的域名设置

5 设置三台服务器之间免密

6 安装kubesphere必要依赖,每个节点都要装,不然报错:socat not found in system path

7 只用在主节点k8s-node1文件夹中下载k8s安装脚本

8 集群配置,创建配置文件,config-sample.yaml

 9 编辑config-sample.yaml

 10 启动脚本和配置文件

11 耐心等待安装完成,会把所有工作节点添加到k8s-node1(时间大概5-10分钟)

12 查看日志

13 查看节点状态

 14 删除集群,重新安装


1准备3台虚拟机(centos7.9

cd /etc/sysconfig/network-scripts
vim ifcfg-ens33
BOOTPROTO=static
ONBOOT=yes
IPADDR=192.168.207.138
GATEWAY=192.168.207.2
NETMASK=255.255.255.0
DNS1=114.114.114.114

2 每台虚拟机更新yum的软件包,时间设置等

yum -y update
yum install -y conntrack
yum makecache fast
yum install -y ntpdate
ntpdate time.windows.com
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
date

3 关闭防火墙

systemctl stop firewalld
systemctl disable firewalld

4 添加三台服务器的域名设置

vim /etc/hosts
192.168.207.138 k8s-node1
192.168.207.139 k8s-node2
192.168.207.140 k8s-node3

5 设置三台服务器之间免密

1、先在所有服务器上执行命令:
ssh-keygen -t dsa -P '' -f ~/.ssh/id_dsa

2、而后在所有服务器上执行命令:这样自身就能免密登陆
cat ~/.ssh/id_dsa.pub >>~/.ssh/authorized_keys

3、之后将每台服务器上的id_dsa.pub公钥发送到其他机器的/tmp文件夹下,如在master上执行
scp ~/.ssh/id_dsa.pub node1:/tmp/
scp ~/.ssh/id_dsa.pub node2:/tmp/

4、之后在其他的机器上将公钥追加到各自的authorized_keys里,执行以下命令:
cat /tmp/id_dsa.pub >>~/.ssh/authorized_keys

5、同样的,在其他的机器上将公钥发送到其他服务器上,然后在其他服务器上将公钥追加到各自的authorized_keys即可

6、最后是测试免密钥连接。
ssh node1

6 安装kubesphere必要依赖,每个节点都要装,不然报错:socat not found in system path

yum install -y socat conntrack ebtables ipset

7 只用在主节点k8s-node1文件夹中下载k8s安装脚本

export KKZONE=cn
curl -sfL https://get-kk.kubesphere.io | VERSION=v2.2.1 sh -
chmod +x kk

8 集群配置,创建配置文件,config-sample.yaml

./kk create config

 9 编辑config-sample.yaml

 10 启动脚本和配置文件

./kk create cluster --with-kubernetes v1.23.7 --with-kubesphere v3.3.0 -f config-sample.yaml -y

11 耐心等待安装完成,会把所有工作节点添加到k8s-node1(时间大概5-10分钟)

12 查看日志

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

13 查看节点状态

kubectl get nodes

 14 删除集群,重新安装

./kk delete cluster

高级模式删除

./kk delete cluster [-f config-sample.yaml]
举报

相关推荐

0 条评论