Directory
- Kubernetes Introduction
- Kubernetes Main Concepts:
- Kubernetes Overall structure
- Reference
Kubernetes Introduction
Kubernetes is a Google Open source container orchestration system for automating deployment, scaling, and management of containerized applications.
- Run Anywhere: Support for public cloud, private cloud, hybrid cloud, physical machine
- Run and manage containers across machines in a clustered manner, addressing the communication issues between Docker's cross-machine containers.
- Scalable: Modular, pluggable, support hooks, can be any combination
- Self-healing: Automatic rescheduling, automatic restart, automatic replication
Kubernetes Main Concepts:
- Container Group (POD): A container group that is deployed on a single node and contains one or more containers, which can be created, dispatched, and Kubernetes to manage the smallest deployment unit, and all containers in the same container set share the same IP address, IPC, host name, and other resources. A container assembly abstracts the network and storage from the underlying container, which makes it easier for you to move containers in the cluster.
- Node: A node is a host, virtual machine, or physical host that is running Kubernetes.
- Management node (Master node): The computer used to control the Kubernetes node, where all task assignments are derived.
- Work nodes (Minion node): The computer that performs the request and assigns the task, which is the responsibility of the Kubernetes host for controlling the node.
- Namespaces (Namespace): Namespace is an abstract collection of resources and objects, such as those that can be used to divide objects within a system into different project groups or groups of users. Common pods, services, replication controllers, and deployments are all part of a namespace (default), and node, persistentvolumes, etc. are not to any namespace.
- Deployment (Deployment): Deployment is the next generation of objects for Pod management, and it provides a more complete function than Replication Controller, which is simpler and easier to use.
- Replication Controllers: Primarily responsible for the specified number of pods running together at the same time and maintaining balance. Solve the problem of linear expansion and contraction of pod.
- Services: Address pod Service discovery issues, which provide a single, stable name and address for a set of pods, which separates the work definition from the container set, and the Kubernetes service proxy automatically assigns the service request to the correct container set- This is true regardless of where the container assembly moves to the cluster, even if it has been replaced.
- Label (labels): a logical marker. Used to correlate service, replication controller, and pod.
- Volume (Volume): A shared directory in the pod that can be accessed by multiple containers, with the same lifecycle as the pod, regardless of the container.
In Kubernetes, all containers run in pods, one pod to accommodate a single container, or multiple cooperating containers. In the latter case, the containers in the Pod are guaranteed to be placed on the same machine, and resources can be shared. A pod can also contain 0 or more volume,volume that are private to a container or can be shared among the containers in the pod. For each Pod created by the user, the system will find a machine that is healthy and has enough capacity, and then start to start the appropriate container there. If a container fails, it is automatically restarted by the Kubernetes node agent, which is called Kubelet. However, if the Pod or his machine fails, it will not be automatically transferred or restarted unless the user also defines a Replication Controller.
A replica collection of Pods can collectively form an entire application, a microservices, or a layer in a multi-tiered application. Once the pods are created, the system continuously monitors their health and the health of the machine on which they run. If a pod is having problems with a software problem or a malfunctioning machine, the Replication controller automatically creates a new pod on a healthy machine.
The Kubernetes supports a unique network model. Kubernetes encourages the use of a flat address space, and does not dynamically allocate ports, but instead allows the user to choose any port that is appropriate for them. To achieve this, it assigns an IP address to each Pod.
Kubernetes provides a Service abstraction that provides a stable IP address and DNS name to correspond to a dynamic set of pods, such as a set of pods that make up a microservices. This pod group is defined by the Label selector, because any pod group can be specified. When a container running in the Kubernetes Pod is connected to this address, the connection is forwarded by the local agent (called Kube proxy). The agent runs on the source machine, the forwarding destination is a corresponding back-end container, the exact backend is selected by Round-robin's policy to balance the load. Kube proxy also tracks dynamic changes in the pod group on the backend, such as when the pod is replaced by a new pod on the new machine, so the IP and DNS name of the service does not have to change.
Each resource in a Kubernetes, such as a Pod, is identified by a URI and has a UID. A total component in the URI is the type of the object (for example, Pod), the name of the object, and the namespace (namespace) of the object. For a particular object type, each name is unique in its namespace, and the name of an object is not given in the form of a namespace, which is the default namespace, and the UID is unique in both time and space.
More about service: Service is an abstraction of application services, providing load balancing and service discovery for applications through labels. The Pod IP and port list matching the labels consists of endpoints, which is responsible for balancing the service IP load to these endpoints by Kube-proxy.
Each service is automatically assigned a cluster IP (a virtual address that is accessible only within the cluster) and a DNS name, and other containers can access the service through that address or DNS without needing to know the back-end container's operation.
Kubernetes Overall structure
- Master components:
- Apiserver: As the entrance of the kubernetes system, it encapsulates the operation of adding and deleting the core objects.
- Scheduler: A plug-in scheduler that is responsible for resource scheduling of the cluster, assigning machines to new pods.
- Controller: Responsible for managing various controllers. such as--Replicationcontroller,
- Endpointcontroller and so on.
- Node Component:
- Kubelet: Responsible for the control of Docker containers, such as Start/stop, monitor operation status.
- Proxy: Responsible for providing the agent for the pod. It periodically obtains all the service from ETCD and creates an agent based on the service information.
- Common components:
Reference
- Kubernetes Official documents
- Kubernetes Concept Finishing
- Container Docker and Kubernetes
- Kubernetes basic framework and basic concepts
- 10 minutes to take you to understand kubernetes core concepts
What is Kubernetes?