部署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@