部署kubernetes (基于docker环境)

部署kubernetes (基于docker环境)

kbs01 192.168.226.10 master
kbs02 192.168.226.11 node01
kbs03 192.168.226.12 node02

搭建基本环境
ssh 免密登录和域名解析
[root@kbs01 ~]# vim /etc/hosts
192.168.226.10 kbs01
192.168.226.11 kbs02
192.168.226.12 kbs03
[root@kbs01 ~]# ssh-keygen -t rsa
[root@kbs01 ~]# ssh-copy-id kbs02
[root@kbs01 ~]# ssh-copy-id kbs03
[root@kbs01 ~]# scp /etc/hosts kbs02:/etc/
hosts 100% 221 184.5KB/s 00:00
[root@kbs01 ~]# scp /etc/hosts kbs03:/etc/
hosts 100% 221 137.5KB/s 00:00
禁用swap
[root@kbs01 ~]# swapoff -a //临时禁用swap
[root@kbs01 ~]# vim /etc/fstab //永久禁用swap
#/dev/mapper/centos-swap swap swap defaults 0 0
[root@kbs01 ~]# mount -a
[root@kbs01 ~]# free -h
total used free shared buff/cache available
Mem: 2.7G 654M 1.1G 21M 971M 1.8G
Swap: 0B 0B 0B
[root@kbs02 ~]# swapoff -a
[root@kbs02 ~]# vim /etc/fstab
#/dev/mapper/centos-swap swap swap defaults 0 0
[root@kbs02 ~]# mount -a
[root@kbs02 ~]# free -h
total used free shared buff/cache available
Mem: 2.7G 653M 1.1G 21M 985M 1.8G
Swap: 0B 0B 0B
[root@kbs03 ~]# swapoff -a
[root@kbs03 ~]# vim /etc/fstab
#/dev/mapper/centos-swap swap swap defaults 0 0
[root@kbs03 ~]# mount -a
[root@kbs03 ~]# free -h
total used free shared buff/cache available
Mem: 2.7G 669M 1.1G 21M 983M 1.8G
Swap: 0B 0B 0B
配置yum源
[root@kbs01 ~]# cd /etc/yum.repos.d/
[root@kbs01 yum.repos.d]# vim kubernetes.repo
[kubernetes]
name=kubernetes
baseurl=https://mirrors.aliyun.com/kubernetes/yum/repos/kubernetes-el7-x86_64/
enabled=1
gpgcheck=0
[root@

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值