Actual Combat 4 Node Centos7.3 installation kubernetes cluster

Source: Internet
Author: User
Tags etcd

kubernetes cluster Installation Deployment

Kubernetes Cluster Components:

-master node

-Etcd a highly available k/v key value to the storage and service discovery system

-Kube-apiserver provides API calls to Kubernetes clusters

-Kube-controller-manager ensure Cluster service

-Kube-scheduler dispatch container, assign to Node

-minion node

-Flannel The communication of the container network of the boast host

-Kubelet boot container on node node according to the container specification defined in the configuration file

-Kube-proxy provides network proxy service

Cluster

Kubernetes Working mode Server-client,kubenetes Master provides centralized management of minions.

Deploy 1 Kubernetes Master nodes and 3 minion nodes,

192.168.137.142 Cmmaster

192.168.137.148 Cmnode1

192.168.137.199 Cmnode2

192.168.137.212 Cmnode3

Install the Epel source on all nodes

# yum-y Install Epel-release

Installation configuration Kubernetes master, on the master node

1. Install ETCD and kubernetes-master using Yum

# yum-y Install ETCD Kubernetes-master


2. Edit the/etc/etcd/etcd.conf file

Etcd_name=default

Etcd_data_dir= "/var/lib/etcd/default.etcd"

Etcd_listen_client_urls= "http://0.0.0.0:2379"

Etcd_advertise_client_urls= "http://localhost:2379"


3. Edit the/etc/kubernetes/apiserver file

Kube_api_address= "--insecure-bind-address=0.0.0.0"

Kube_api_port= "--port=8080"

Kubelet_port= "--kubelet-port=10250"

Kube_etcd_servers= "--etcd-servers=http://127.0.0.1:2379"

Kube_service_addresses= "--SERVICE-CLUSTER-IP-RANGE=10.254.0.0/16"

Kube_admission_control= "--admission-control=namespacelifecycle,namespaceexists,limitranger,securitycontextdeny , Resourcequota "

Kube_api_args= ""


4. Start the ETCD, Kube-apiserver, Kube-controller-manager, Kube-scheduler and other services, and set up boot.

Start Etcd, Kube-apiserver, Kube-controller-manager, Kube-scheduler and other services, and set up boot.

For SERVICES in Etcd kube-apiserver Kube-controller-manager Kube-scheduler; Do systemctl restart $SERVICES; systemctl enable $SERVICES; Systemctl status $SERVICES; Done


# SYSTEMCTL Status Etcd.service

# SYSTEMCTL Status Kube-apiserver.service

# SYSTEMCTL Status Kube-controller-manager.service

# SYSTEMCTL Status Kube-scheduler.service



5. Define the flannel network in ETCD

[[email protected] ~]# etcdctl mk/atomic.io/network/config ' {"Network": "172.17.0.0/16"} '




Installation Configuration Kubernetes Node

The following operations are performed on Cmnode1, Cmnode2, Cmnode3

1. Install flannel Kubernetes-node

Yum-y Install flannel Kubernetes-node


2. Specify the ETCD service for the Flannel network, modify the/etc/sysconfig/flanneld file

Flannel_etcd= "http://192.168.137.142:2379"

flannel_etcd_key= "/atomic.io/network"


3. Modify the/etc/kubernetes/config file

Kube_logtostderr= "--logtostderr=true"

Kube_log_level= "--v=0"

kube_allow_priv= "--allow-privileged=false"

Kube_master= "--master=http://192.168.137.142:8080"



4. Modify the corresponding node configuration file as follows/etc/kubernetes/kubelet

kubelet_address= "--address=0.0.0.0" #将127.0.0.1 modified to 0.0.0.0

Kubelet_port= "--port=10250"

Kubelet_hostname= "--hostname-override=192.168.137.148" #修改成对应Node的IP

Kubelet_api_server= "--api-servers=http://192.168.137.142:8080" #指定Master节点的API SERVER

Kubelet_pod_infra_container= "--pod-infra-container-image=registry.access.redhat.com/rhel7/pod-infrastructure:latest"

Kubelet_args= ""


5. Start the Kube-proxy,kubelet,docker,flanneld service on all node nodes and set the boot

# for SERVICES in Kube-proxy kubelet Docker flanneld;do systemctl restart $SERVICES; systemctl enable $SERVICES; Systemctl s Tatus $SERVICES; Done



? Verify that the cluster is installed successfully

Execute the following command on master

[[email protected] ~]# KUBECTL get node

NAME STATUS Age

192.168.137.147 Ready 7m

192.168.137.148 Ready 1m

192.168.137.199 Ready 7m

The above nodes are displayed normally, and the status is ready, which indicates the cluster is successfully built.



Actual combat 4 node Centos7.3 install kubernetes cluster

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.