introduction
Kubernetes
As a best practice cloud native, it has become a de facto standard container orchestration engine, but it also has become the era of container cloud infrastructure. This series of articles will lead us into the Kubernetes
world.
- Architecture Introduction
- core concept
- to sum up
First, the architecture introduced
(Picture from the network)
The figure can be seen that the following components, using a special icon indicates Service and the Label:
Pod
Container (container)
the Label (label) (tag)
the Replication the Controller (copy controller)
Service (Enter Image Description here Wallpaper) (service)
the Node (node)
Kubernetes master (Kubernetes master node)
Second, the core concept
1, POD
POD
is to Kubernetes
project a minimum scheduling unit. But we must be clear that, POD is a logical concept. POD is actually a set of shared some container resources. We often say that the vessel, its essence is the process. If we say that Kubernetes
the future of cloud native operating system, the container like a mirror image of the operating system exe
files. But the operating system does not exist as a single process, it is in the form of process groups to accomplish specific business. And Kubernetes
that is the concept of process group mapped to a container cloud.
POD
All containers share the same Network Namespace, and may declare share the same Volume.
2, Label
Label
in key/value
additional key-value pairs to any object, such as Pod, Service, Node, RC ( ReplicationController) / RS (ReplicaSet) and the like, which is used to transfer user-defined attributes.
3, Replication Controller
Kubernetes
through Controller
implemented for POD
operation. Deployment
It defines the overall operation of the arrangement of containers, such as provided spec.replicas = 2. So when in this cluster, the number of carry Pod custom label is greater than 2, there will be old Pod is deleted; on the contrary, there will be a new Pod is created.
We can look at pkg / controller directory Kubernetes project:
$ cd kubernetes/pkg/controller/
$ ls -d */
deployment/ job/ podautoscaler/
cloud/ disruption/ namespace/
replicaset/ serviceaccount/ volume/
cronjob/ garbagecollector/ nodelifecycle/ replication/ statefulset/ daemon/
...
(Picture from the network)
4, Service
POD
may not be persistent, when the IP may change after it is restarted, then the front end of the container how to find the right rear end of the container it? On the other hand it is because a group Pod
always have load balancing between instances of demand. Service
It is a series of definitions Pod
and strategies to access the Pod layer of abstraction. The main role of Service services, as is Pod
the Agent Portal ( Portal
), thus overriding Pod
the external exposure of a fixed network address.
Service
By kube-proxy
component, together with iptables
the common realization.
As a Service
definition.
For we created earlier named hostnames
the Service
, once it has been submitted to Kubernetes
, it kube-proxy
can, through Service
the Informer
perceived such an Service
added object.
apiVersion: v1
kind: Service
metadata:
name: sayservice
spec:
selector:
app: sayservice
ports:
- name: default
protocol: TCP
port: 8080
targetPort: 9376
(Picture from the network)
5、Node
Running the two most important components of the node - kubelet
and kube-proxy
. Node
Node is the Kubernetes
cluster workload nodes, each Node
will Master
assign some of the work load ( Docker
container), when a Node
time is down, the workload on the Master will automatically be transferred to other nodes up.
Third, the summary
This paper describes Kubernetes
some of the core concepts, I put together Kubernetes
a mind map, I hope you can give us clarify the relevant concepts and classification, as follows: