kubernetes a practice: the basic concepts and principles

Here kubernetes record content and use of the process of learning.

CentOS7 k8s-1.13 flanneld-0.10 docker-18.06 etcd-3.3

This section documents the basic concepts of kubernetes.

kubernetes basic concepts

Master

Master control is Kubernetes in the cluster nodes, each k8s cluster node requires a Master responsible for the management and control of the entire cluster, the basic k8s all control commands are initiated by its, if it goes down, the whole All cluster control commands may not be used. All general it is a physical or virtual machine.
Need to start the following service on general Master node:

  • kube-apiserver (Kubernetes Api Server), to provide critical service process HTTP Rest interface, service entrance is the only entrance, but also in the operation of all cluster resources k8s add, delete, search, change control, etc..
  • kube-controller-manager (Kubernetes Controller Manager), k8s in all resource objects Automation Center, to manage all the resources.
  • kube-scheduler (Kubernetes Scheduler), responsible for resource scheduling (Pod scheduling) services.

In fact, there is a etcd service, all data stored in k8s resource object.

Node

k8s nodes in the cluster and work into the management node Master node Node, called Minion in earlier versions. And Master, as it usually is a physical or virtual machine. Master in charge of the task assigned schedule, Node is responsible for the implementation of the task, the actual work is on Node node (using the docker), when a Node down, its task will be assigned to other nodes Node.
Node node there are some key services:

  • kubelet: Pod responsible for the corresponding container to create, start and stop tasks, while close collaboration with the Master node, the basic functions of cluster management.
  • Important components communicate with load balancing mechanism Kubernetes Service are: kube-proxy
  • Docker Engine (docker): docker engine, the unit responsible for the container creation and management.
  • flanneld: k8s strictly speaking it is not a core component, which is used to manage network k8s cluster.

Use the command

[root@k8s-master ~]# kubectl get nodes     
NAME            STATUS   ROLES    AGE    VERSION
192.168.10.11   Ready    <none>   2d7h   v1.13.0
192.168.10.12   Ready    <none>   2d2h   v1.13.0

Under

K8s Pod is the most important and basic concept, each Pod has a special called "root container," the Pause container. Pause image corresponding to part of the container k8s platform, each Pod Pause a container and a service container components.

Why such a concept and structure Pod Pod: the following reasons:

  • In the case of a group of containers as a unit, we are difficult to "whole" easily determined and act effectively. The introduction of business-related death is not easy to Pause and container as the root container Pod, from its ground state to state on behalf of the entire container group, in order to solve this problem.
  • Pod in multiple service container vessels shared Pause IP, shared Pause container mounted Volume, so that not only simplifies the communication problems between closely related container business, but also a good solution to the problem of file sharing between them.

Pod Kubernetes each be assigned a unique IP address, called IP Pod, a plurality of containers in a Pod Pod shared IP address. Layer k8s virtual network technologies, such as flanneld, OpenvSwitch other cluster REALIZATION TCP tasks between two Pod / IP to communicate directly.

Pod two types: static and ordinarily Pod Pod (static Pod)

  • Stored in the Common Pod etcd, create k8s after being scheduled on a Node, then a group of containers kubelet instantiated and started. By default, if the Pod in a container stop, restart Pod all containers, if the location of Node is down, the dispatcher on the other Node.
  • static Pod stored in a particular Node to a particular file, and only start to run on this Node.

The following is the relationship Pod, container and Node are:

[root@k8s-master ~]# kubectl get pods
NAME          READY   STATUS    RESTARTS   AGE
mysql-f8g28   1/1     Running   0          80m
myweb-529z6   1/1     Running   0          73m
myweb-dkb4n   1/1     Running   0          73m
myweb-ggvwz   1/1     Running   0          73m
myweb-j5t4x   1/1     Running   0          73m
myweb-l6wqv   1/1     Running   0          73m
nginx         1/1     Running   1          88m

Guess you like

Origin www.cnblogs.com/xingyys/p/11574597.html