一、网络配置
1.1、yum 安装 net-tools
cd /etc/sysconfig/network-script/
vi ifcfg-eth0
修改ONBOOT=yes,重启电脑
1.2、安装net-tools
yum install net-tools
可以通过ifconfig查看网卡Ip配置
二、安全相关
2.1、关闭所有节点的SELinux
vi /etc/selinux/config
修改:SELINUX=disabled
2.2 关闭防火墙
systemctl stop firewalld systemctl disable firewalld swapoff -a
2.3 永久性禁用swap
vi /etc/fstab
在行首加 #,注释该行,重启电脑
三、安装Docker、官网
https://docs.docker.com/install/linux/docker-ce/centos/
yum install -y yum-utils device-mapper-persistent-data lvm2 yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo yum install docker-ce docker-ce-cli containerd.io systemctl enable docker systemctl start docker docker -v
配置阿里云加速
sudo mkdir -p /etc/docker sudo tee /etc/docker/daemon.json <<-'EOF' { "registry-mirrors": ["https://byedr9vm.mirror.aliyuncs.com"] } EOF sudo systemctl daemon-reload sudo systemctl restart docker
四、配置安装K8S
4.1配置源
cat>>/etc/yum.repos.d/kubrenetes.repo<<EOF [kubernetes] name=Kubernetes Repo baseurl=https://mirrors.aliyun.com/kubernetes/yum/repos/kubernetes-el7-x86_64/ gpgcheck=0 gpgkey=https://mirrors.aliyun.com/kubernetes/yum/doc/yum-key.gpg EOF