kubenetes安装

hostnamectl set-hostname master1
hostnamectl set-hostname node1
hostnamectl set-hostname node2

 kubenetes安装 

vim /etc/sysconfig/network- scripts/ifcfg-ens33 

 kubenetes安装

systemctl restart network
ip a s

 kubenetes安装

vim /etc/hosts
cat /etc/hosts

kubenetes安装

关闭firewalld 
systemctl stop firewalld 
systemctl disable firewalld 
firewall-cmd --state

kubenetes安装

SELINUX配置
[root@XXX ~]# sed -ri s/SELINUX=enforcing/SELINUX=disabled/ /etc/selinux/config

 

 

 kubenetes安装

 

 

 

主机时间同步
yum -y install ntpdate
crontab -l 0 */1 * * * ntpdate time1.aliyun.com
date

kubenetes安装

 

 

 

永久关闭swap分区
vim /etc/fstab   #在swap文件系统对应的行,行首添加#表示注释。
cat /etc/fstab

kubenetes安装

 

 

添加网桥过滤及地址转发
 [root@XXX ~]# cat /etc/sysctl.d/k8s.conf
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
net.ipv4.ip_forward = 1
vm.swappiness = 0 

加载br_netfilter模块 
[root@XXX ~]# modprobe br_netfilter 
查看是否加载
[root@XXX ~]# lsmod | grep br_netfilter
br_netfilter 22256 0 
bridge 151336 1 br_netfilter
加载网桥过滤配置文件
[root@XXX ~]# sysctl -p /etc/sysctl.d/k8s.conf
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
net.ipv4.ip_forward = 1
vm.swappiness = 0

kubenetes安装

 

 

安装ipset及ipvsadm
yum -y install ipset ipvsadm

 

在所有节点执行如下脚本 
cat > /etc/sysconfig/modules/ipvs.modules <<EOF 
#!/bin/bash
modprobe -- ip_vs
modprobe -- ip_vs_rr
modprobe -- ip_vs_wrr
modprobe -- ip_vs_sh
modprobe -- nf_conntrack_ipv4
EOF
授权、运行、检查是否加载
[root@XXX ~]# chmod 755 /etc/sysconfig/modules/ipvs.modules && bash /etc/sysconfig/modules/ipvs.modules && lsmod | grep -e ip_vs -e nf_conntrack_ipv4
检查是否加载 [root@XXX ~]# lsmod | grep -e ipvs -e nf_conntrack_ipv4

kubenetes安装

 

kubenetes安装

上一篇:nginx编译部署配置https


下一篇:C++ socket编程