rke安装k8s

文档地址:
https://docs.rancher.cn/docs/rancher2.5/installation/resources/k8s-tutorials/ha-rke/_index/
https://docs.rancher.cn/docs/rke/_index


环境准备
1. 安装docker-ce
2. 禁用所有worker节点交换功能
3. 修改内核参数
net.bridge.bridge-nf-call-iptables=1

下载rke
https://github.com/rancher/rke/releases/download/v1.2.12/rke_linux-arm64
https://github.com/rancher/rke/releases/download/v1.2.12/rke_linux-amd64

chmod a+x rke_linux-amd64
mv rke_linux_amd64 /usr/local/bin/rke


创建rancher-cluster.yml 

注:nodes是唯一必须要配置的,其他参数详见https://docs.rancher.cn/docs/rke/_index   Kubernetes配置选项

nodes:
  - address: 172.20.42.51
    user: root       // ssh连接的用户
    role: [controlplane, worker, etcd]
  - address: 172.20.42.52
    user: root
    role: [controlplane, worker, etcd]
  - address: 172.20.42.53
    user: root
    role: [controlplane, worker, etcd]

上述配置表示三个节点复用控制节点、计算节点、etcd节点

安装rke集群
rke up --config rancher-cluster.yml

清除rke集群
rke remove --config rancher-cluster.yml

节点添加/删除
通过修改cluster.yml文件的内容,添加额外的节点,并指定它们在 Kubernetes 集群中的角色;或从cluster.yml中的节点列表中删除节点信息,以达到删除节点的目的。
rke up --update-only --config rancher-cluster.yml

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值