The physical machine operating system uses Centos7.3 64-bit, the details are as follows.
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:
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
Configure the Docker configuration file to allow images to be pulled from the registry.
Set the boot to start automatically and start the service
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:
Start the service and set the boot to start automatically
See 3.1
See 3.2
The following components need to be run on the kubernetes node:
Kubelet
Kubernets Proxy
Correspondingly, change the color information in the following configuration texts:
Start the service and set the boot to start automatically
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.
Execute the following commands on master and node to install
Version is 0.0.5
Edit /etc/sysconfig/flanneld on both master and node, modify the red part
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)
After starting Flannel, you need to restart docker and kubernete in turn.
Execute in master:
Execute on node:
Recommended Posts