In this blog post Ill tell you something about Kubernetes. What is Kubernetes? What are the Kubernetes concepts? The Kubernetes Components Architecture and the benefits of using Kubernetes.
Contents
What is Kubernetes?
Kubernetes is an open source project designed to manage container clusters without worrying about your underlying resources. Kubernetes manages and runs Docker containers on a large number of hosts as well as providing co-location and replication of large numbers of containers. The project was started by the Google engineers Joe Beda, Brendan Burns, and Craig McLuckie in mid-2014 and is now supported by many companies including Microsoft, RedHat, IBM etc.
The project has two objectives. If you are using Docker containers, the next question is how to scale and run the containers at once on a large number of Docker hosts and how to balance them. The project offers a high-level API that defines a logical grouping of containers that allows you to define container pools, load balancing, and container placement.
Kubernetes Concepts
Kubernetes have a set concepts to describe, build and manage your Kubernetes Cluster.
- Nodes: Node is a machine in the Kubernetes cluster.
- Pods: A pod is an entity that consists of one or more containers placed on the same host and configured to share network stack resources and other resources like volumes. Pods are basic building blocks from which applications running on the Kubernetes platform are built.
- Replication Controller: The replication controller ensures that a certain number of “replicas” of pods are run at any given time.
- Services: A service in Kubernetes is an abstraction that defines a logical combined pod set and its access policy.
- Volumes: Volume is a directory, possibly with data in it, which is available in the container.
- Labels: Are key/value pairs that are attached to objects such as pods. Labels can be used to create and select sets of objects.
- Kubectl: A kubectl command line interface to control Kubernetes.
The Kubernetes Components Architecture
The Kubernetes control system is divided into several components. These components work together to provide a single view of the cluster.
Etcd
The state of the master is stored in copy etcd. This ensures that configuration data is stored securely and other components are notified of changes in the state in a timely manner.
Kube API Server
The Kubernetes API provides an api server. It mainly handles REST operations, checking them and updating corresponding objects in etcd (and event-driven in other storages).
Scheduler
The Scheduler binds non-running pods to nodes via the call /binding API. Scheduler is connected; support for multiple schedulers and custom schedulers is planned.
Kubernetes Controller Manager Server
All other cluster level functions are presented in Controller Manager. For example, nodes are detected, managed and controlled by node controller means. This entity can eventually be divided into separate components to make them independently pluggable.
Kubelet
An agent that monitors the containers that are inside a node and communicates with the main node. This all happens with API Calls to the Kube ApiServer.
Kubernetes networking
At the heart of the Kubernetes network device is an important architectural principle: “Each feed has its own unique IP”. The IP feed is divided between all its containers and is available (routed) for all other feeds. The big advantage of this model – IP for each feed (IP-per-pod) – is that there are no IP/port conflicts on the downstream host. And we don’t have to worry about which ports applications use. Therefore, the only requirement of Kubernetes is that all these IP addresses of the sub-pods must be accessible/routed from the rest of the sub-pods, no matter what host they are located on.
Benefits of using Kubernetes?
Simplified Deployment
What does this mean for a developer? It means that he doesn’t have to worry about the number of nodes, where exactly containers are launched, and how they interact. He doesn’t have to deal with hardware optimization or worry about nodes that could be disrupted (and something like that, according to Murphy’s law, is bound to happen), since new nodes can be added to the Kubernetes cluster if needed. If there is something wrong with some of the existing nodes, Kubernetes will deploy containers on those nodes that are still functional.
Stability of work
You no longer have these sticks and scotch around your installations, so everything is kind of Mainstream.
Less technology involved
It makes it possible to dispose of the machines as much as possible. In general, without Kubernetes you would run one application, run the second virtual machine, run the second application. With Kubernetes in mind, it transports and places the nodes in a way that places the application to maximize CPU utilization.