Installation version:
CentOS version: 7.4docker version: 18.03.1-cekubectl version: v1.10.1etcdctl Version: 3.2.18Flannel version: v0.10.0
Basic architecture:
IP Address |
Host Name |
Service |
10.200.3.105 |
K8s-master |
Etcd/docker/kube-apiserver/kube-controller-manager/kube-scheduler/flannel |
10.200.3.106 |
K8s-node-1 |
Etcd/docker/kube-proxy/kubelet/flannel |
10.200.3.107 |
K8s-node-2 |
Etcd/docker/kube-proxy/kubelet/flannel |
1. Turn off SELinux and firewalls
#systemctl Disable Firewalld.service#systemctl Stop Firewalld.service
2. Set the host name:
# hostnamectl--static set-hostname k8s-master# hostnamectl--static set-hostname k8s-node-1# hostnamectl--static set-ho Stname k8s-node-2
3. Set/etc/hosts to ensure that the hostname resolves
10.200. 3.105 k8s-Master10.200. 3.106 k8s-node-110.200. 3.107 k8s-node-2
4. Set up SSH password-free login to all other nodes of the deployment node
[Email protected] ~]# Ssh-keygen-t RSA [[email protected]-master ~]# ssh-copy-id k8s-master[[ Email protected]-master ~]# ssh-copy-id k8s-node-1[[email protected]-master ~]# Ssh-copy-id k8s-node-2
5. Installing Docker
Step one: Use a domestic docker source
[Email protected] ~]# cd/etc/yum.repos.d/[[Email protected]-Master yum.repos.d]# wget> https://Mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo--2018- to- - -: -: ---HTTPS://Mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repoResolving mirrors.aliyun.com (mirrors.aliyun.com) ...103.15.99.96,103.15.99.93,103.15.99.94, ... Connecting to Mirrors.aliyun.com (mirrors.aliyun.com)|103.15.99.96|:443... connected. HTTP request sent, awaiting response ... $oklength:2640(2.6K) [application/octet-Stream] Saving to: ' Docker-Ce.repo ' -%[===========================================================================================>]2,640--.-k/sinch0s2018- to- - -: -: the(63.8MB/s)-' Docker-ce.repo ' saved [2640/2640]
Step Two: Docker installation:
[email protected] yum.repos.d]# Yum install-y docker-ce
Step three: Start the background process:
[[email protected] ~]# Systemctl start Docker
6. Prepare the Deployment directory
#mkdir-P/opt/kubernetes/{cfg,bin,ssl,log}
Kubernetes one of the cluster deployments system environment initialization