K8s+dashboard Cluster deployment under centos7-(1) Environment preparation and docker deployment
Foreword:
During the previous deployment, I saw a lot of online tutorials, most of which were not in the wrong direction, but after many practical verification, I found that some errors could not be avoided, so organize a summary of deployment:
Preparatory work:
The topology of this deployment is 1masterquarter 2node node, and the preparation includes all the devices:
A) turn off the firewall of each node and set it to power on and off
Systemctl stop firewalld
Systemctl disable firewalld
B) shut down the system selinux
Setenforce 0
Sed-I's etc/selinux/config for Eng.
C) close swap
Swapoff-a closes swapon-a turns on
Top to see if swap is 0
/ etc/fastb comment out swap permanent shutdown
D) Hostname and hosts configuration
Hostnamectl set-hostname master (centos7 sets hostname)
Cat / etc/hosts
172.16.32.10 master.tdr.com master
172.16.32.11 node01.tdr.com node01
172.16.32.12 node02.tdr.com node02
E) transfer bridged IPv4 traffic to the chain of iptables
Net.bridge.bridge-nf-call-ip6tables = 1
Net.bridge.bridge-nf-call-iptables = 1
Net.ipv4.ip_forward = 1
Execute: modprobe br_netfilter
Sysctl-p / etc/sysctl.d/k8s.conf
1.docker installation and deployment
First configure the yum source and use the aliyun source for yum
Wget https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo-O / etc/yum.repos.d/docker-ce.repo
Yum makecache fast
Yum repolist, check the source.
Yum list docker-ce.x86_64-- showduplicates | sort-r check the docker version you want to install. I have 18.03.1-ce installed here.
Yum install-y-setopt=obsoletes=0 18.03.1.ce-1.el7.centos
Start docker and boot:
Systemctl start docker
Systemctl enable docker
Iptabels-nvL
Verify that the default policy (pllicy) of the Foward chain in the iptables filter table is ACCEPT, because the Node and pod communication of k8s requires the FORWARD chain.