Kubernetes Schema Deployment

Source: Internet
Author: User
Tags etcd

Platform Environment: Centos 7.0

First, the architecture mode

Second, Core Services

Master

1) ETCD Service

ETCD is a highly available key-value storage system that Kubernetes uses to store the state of individual resources, enabling restful APIs. The ETCD service acts as the primary database for the Kubernetes cluster and needs to be installed and started before installing Kubernetes services.

2) Kube-apiserver

Apiserver is responsible for the provision of RESTful kubernetes API services, it is the unified interface of the system Management directives, any additions and deletions to the resources should be handed over to Apiserver to deal with cobalt in the ETCD.

3) Schedule

The schedule is responsible for dispatching pods to the appropriate node.

4) Controller Manager

Controller functions as a resource controller in Kubernetes.

Node

Kube-proxy: This module implements the service discovery and reverse proxy functions in the kubernetes. Kube-proxy supports TCP and UDP connection forwarding, default base round The robin algorithm forwards client traffic to a set of back-end pods that correspond to the service. Kube-proxy uses the ETCD watch mechanism to monitor the dynamic changes of service and endpoint object data in the cluster and to maintain a service-to-endpoint mapping From the page to ensure that the IP changes in the backend pod do not affect the visitor. Kube-proxy also supports session affinity.

Kublet:kublet is the agent of master on each node, and is the most important module on node, and it is responsible for maintaining and managing all the containers on that node, but it will not be managed if the container is not created by Kubernetes. Essentially, it is responsible for keeping the pod's running state consistent with the desired state.

III. Deployment and Installation

Server Assignment

master:192.168.56.155

node1:192.168.56.163

Master

1. Installation

Yum-y Install ETCD Kubernetes-master

2. Configure ETCD Service

SYSTEMD Service file:/usr/lib/systemd/system/etcd.service[unit]description=ETCD Serverafter=Network.target[service]type=notifyworkingdirectory=/var/lib/etcd/Environmentfile=-/etc/etcd/Etcd.confuser=root#SetGomaxprocs to number of Processorsexecstart=/bin/bash-c"gomaxprocs=$ (nproc)/usr/bin/etcd--name=\ "${etcd_name}\"--data-dir=\ "${etcd_data_dir}\"--listen-client-urls =\ "${etcd_listen_client_urls}\""Restart=on-Failurelimitnofile=65536[Install]wantedby=multi-user.target


Service profile:/etc/etcd/etcd.conf (Modify these four items)

Etcd_data_dir= "/var/lib/etcd/default.etcd"
Etcd_listen_client_urls= "http://0.0.0.0:2379"
Etcd_name= "Default"
Etcd_advertise_client_urls= "http://192.168.56.155:2379"

3, Configuration Kube-apiserver

SYSTEMD configuration file:/usr/lib/systemd/system/kube-apiserver.service[unit]description=Kubernetes API serverdocumentation=https://github.com/googlecloudplatform/kubernetesAfter=Network.targetafter=etcd.servicewants=Etcd.service[service]environmentfile=-/etc/kubernetes/Configenvironmentfile=-/etc/kubernetes/Apiserveruser=Rootexecstart=/usr/bin/kube-apiserver $KUBE _logtostderr $KUBE _log_level $KUBE _etcd_servers $KUBE _a Pi_address $KUBE _api_port $KUBELET _port $KUBE _allow_priv $KUBE _service_add Resses $KUBE _admission_control $KUBE _api_argsrestart=on-Failuretype=Notifylimitnofile=65536[Install]wantedby=multi-user.target


Service configuration file:/etc/kubernetes/apiserver

###
# kubernetes System Config
#
# The following values is used to configure the Kube-apiserver
#

# The address on the local server to listen.
Kube_api_address= "--address=0.0.0.0"

# The port is on the local server to listen.
# kube_api_port= "--port=8080"

# Port Minions Listen on
Kubelet_port= "--kubelet-port=10250"

# Comma separated list of nodes in the ETCD cluster
Kube_etcd_servers= "--etcd-servers=http://192.168.56.155:2379"

# Address range to use for services
Kube_service_addresses= "--SERVICE-CLUSTER-IP-RANGE=10.254.0.0/16"

# Default Admission Control policies
Kube_admission_control= "--admission-control=namespacelifecycle,namespaceexists,limitranger,securitycontextdeny , Resourcequota "

# ADD Your own!
Kube_api_args= ""

4, Configuration Kube-scheduler.service

SYSTEMD configuration file:/usr/lib/systemd/system/kube-scheduler.service[unit]description=Kubernetes Scheduler plugindocumentation=https://github.com/googlecloudplatform/kubernetesAfter=Etcd.serviceafter=kube-Apiserver.servicerequires=Etcd.servicerequires=kube-Apiserver.service[service]environmentfile=-/etc/kubernetes/Configenvironmentfile=-/etc/kubernetes/Scheduleruser=Rootexecstart=/usr/bin/kube-Scheduler $KUBE _logtostderr $KUBE _log_level $KUBE _master $KUBE _schedul Er_argsrestart=on-Failurelimitnofile=65536[Install]wantedby=multi-user.target


Service configuration file:/etc/kubernetes/scheduler

###
# kubernetes Scheduler Config

# Default Config should be adequate

# ADD Your own!
Kube_scheduler_args= ""

5, Configuration Kube-controller-manager

SYSTEMD configuration file:/usr/lib/systemd/system/kube-controller-manager.service[unit]description=Kubernetes Controller managerdocumentation=https://github.com/googlecloudplatform/kubernetesAfter=Etcd.serviceafter=kube-Apiserver.servicerequires=Etcd.servicerequires=kube-Apiserver.service[service]environmentfile=-/etc/kubernetes/Configenvironmentfile=-/etc/kubernetes/controller-Manageruser=Rootexecstart=/usr/bin/kube-controller-Manager $KUBE _logtostderr $KUBE _log_level $KUBE _master $KUBE _controlle R_manager_argsrestart=on-Failurelimitnofile=65536[Install]wantedby=multi-user.target


Service configuration file:/etc/kubernetes/controller-manager

###
# The following values is used to configure the Kubernetes Controller-manager

# defaults from config and apiserver should be adequate

# ADD Your own!
Kube_controller_manager_args= ""

6. Start the service

 forIinch{"Etcd.service","Kube-apiserver.service","Kube-scheduler.service","Kube-controller-manager.service"}; Dosystemctl enable $i;d One forIinch{"Etcd.service","Kube-apiserver.service","Kube-scheduler.service","Kube-controller-manager.service"}; DoSystemctl start $i;d One

Node

1. Installation

Yum-y Install Kubernetes-node

2, Configuration Kubelet

SYSTEMD configuration file:/usr/lib/systemd/system/kubelet.service[unit]description=Kubernetes Kubelet serverdocumentation=https://github.com/googlecloudplatform/kubernetesAfter=Docker.servicerequires=docker.service[service]workingdirectory=/var/lib/Kubeletenvironmentfile=-/etc/kubernetes/Configenvironmentfile=-/etc/kubernetes/Kubeletexecstart=/usr/bin/kubelet $KUBE _logtostderr $KUBE _log_level $KUBELET _api_server $KUBELET _address $KUBELET _port $KUBELET _hostname $KUBE _allow_priv $KUBELET _pod_inf Ra_container $KUBELET _argsrestart=on-Failurekillmode=Process[install]wantedby=multi-user.target


Service configuration file:/etc/kubernetes/kubelet

###
# kubernetes Kubelet (Minion) config

# The address for the info server to serve in (set to 0.0.0.0 or "" for all Interfaces)
Kubelet_address= "--address=127.0.0.1"

# The port for the info server to serve on
Kubelet_port= "--port=10250"

# Leave this blank to use the actual hostname
Kubelet_hostname= "--hostname-override=nginx2"

# Location of the Api-server
Kubelet_api_server= "--api-servers=http://192.168.56.155:8080"

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

# ADD Your own!
Kubelet_args= ""

3, Configuration Kube-proxy

SYSTEMD configuration file:/usr/lib/systemd/system/kube-proxy.service[unit]description=kubernetes kube-Proxy serverdocumentation=https://github.com/googlecloudplatform/kubernetesAfter=Network.target[service]environmentfile=-/etc/kubernetes/Configenvironmentfile=-/etc/kubernetes/Proxyexecstart=/usr/bin/kube-proxy $KUBE _logtostderr $KUBE _log_level $KUBE _master $KUBE _PROXY_ARGSR Estart=on-Failurelimitnofile=65536[Install]wantedby=multi-user.target Service configuration file: Vim/etc/kubernetes/proxy#### kubernetes proxy config#defaultconfig should be adequate# Add your own!Kube_proxy_args=""

4. Start the service

 forIinch{"Etcd.service","Kube-apiserver.service","Kube-scheduler.service","Kube-controller-manager.service"}; Dosystemctl enable $i;d One forIinch{"Etcd.service","Kube-apiserver.service","Kube-scheduler.service","Kube-controller-manager.service"}; DoSystemctl start $i;d One

Iv. Inspection

Get Nodesname      STATUS    AGEnode1    ready     3h

Literature: 76269853

Kubernetes Schema Deployment

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.