Centos7 deploys Kubernetes cluster

**1、 Environmental introduction and preparation: **

1.1 Physical machine operating system

The physical machine operating system uses Centos7.3 64-bit, the details are as follows.

1.2 Host Information

This article has prepared three machines for deploying the operating environment of k8s. The details are as follows:

Set the hostname of the three machines:

Execute on Master:

Execute on Node1:

Execute on Node2:

To set up hosts on the three machines, execute the following commands:


1.3 Turn off the firewall on the three machines

2、 Deploy etcd

K8s depends on etcd to run, and etcd needs to be deployed first. This article uses yum to install:

The default configuration file of etcd installed by yum is in /etc/etcd/etcd.conf. Edit the configuration file and change the following colored information:

Start and verify status

3、 Deploy master

3.1 Install Docker

Configure the Docker configuration file to allow images to be pulled from the registry.

Set the boot to start automatically and start the service

3.2 Install kubernets

3.3 Configure and start kubernetes

The following components need to be run on kubernetes master:

Kubernets API Server

Kubernets Controller Manager

Kubernets Scheduler

Correspondingly, change the color information in the following configurations:

3.3.1 /etc/kubernetes/apiserver

3.3.2 /etc/kubernetes/config

Start the service and set the boot to start automatically

4、 Deploy node

4.1 Install docker

See 3.1

4.2 Install kubernets

See 3.2

4.3 Configure and start kubernetes

The following components need to be run on the kubernetes node:

Kubelet

Kubernets Proxy

Correspondingly, change the color information in the following configuration texts:

4.3.1 /etc/kubernetes/config

4.3.2 /etc/kubernetes/kubelet

Start the service and set the boot to start automatically

4.4 View status

View the nodes and node status in the cluster on the master

So far, a kubernetes cluster has been built, but the cluster is not working well at present, please continue with the next steps.

5、 Create an overlay network——Flannel

5.1 Install Flannel

Execute the following commands on master and node to install

Version is 0.0.5

5.2 Configure Flannel

Edit /etc/sysconfig/flanneld on both master and node, modify the red part

5.3 Configure the key of flannel in etcd

Flannel uses Etcd for configuration to ensure the configuration consistency between multiple Flannel instances, so you need to configure the following on etcd: ('/atomic.io/network/config' This key is the same as the above /etc/sysconfig/flannel The configuration item FLANNEL_ETCD_PREFIX in is corresponding, if it is wrong, there will be an error when starting)

5.4 start up

After starting Flannel, you need to restart docker and kubernete in turn.

Execute in master:


Execute on node:


Recommended Posts

Centos7 deploys Kubernetes cluster
CentOS7.3.1611 deploys k8s1.5.2 cluster
Centos7 build Kubernetes cluster
CentOS7 deploys k8s cluster
Centos7.2/7.3 cluster install Kubernetes 1.8.4 + Dashboard
CentOS7 install Kubernetes 1.16.3
Centos7 deploys HAproxy to implement Nginx cluster
Centos6.9 build rabbitmq 3.6.8 cluster
CentOS 7 deploys RabbitMQ service
CentOS 6.8 deploy zookeeper cluster
Centos7 install kubernetes tutorial
Centos7 mqtt cluster installation
CentOS7 deploys NFS service
CentOS cluster related issues
Rapid deployment of Kubernetes (k8s) cluster in CentOS7 environment
Centos7.4 deployment configuration Elasticsearch5.6 cluster
CentOS7 install rabbitmq cluster (binary)
Glusterfs cluster installation on Centos7
Redis cluster installation under CentOS
CentOS 7 Galera Cluster installation guide
Redis cluster installation under CentOS
CentOs7.3 build SolrCloud cluster service
Centos7 deploys python3 virtual environment
Centos7 install k8s cluster 1.15.0 version
CentOS 8 (2)
RabbitMQ cluster deployment record under Centos6.9
Centos7 hadoop cluster installation and configuration
Build a PXC cluster under CentOS8
Elasticsearch cluster deployment record under CentOS7
CentOS 8 (1)
k8s practice (1): Centos 7.6 deployment k8s (v1.14.2) cluster
CentOS8 deploys KMS service to activate Office
(1) Centos7 installation to build a cluster environment
Simple practice of RHCS cluster in CentOS6