What is Kubernetes? Definition
Kubernetes is an open-source platform for container management and orchestration. Containers are self-contained software packages that allow programmers to package part or all of an application into a single object. Containers make it easier to employ continuous integration and continuous delivery (CI)/CD) and move applications between environments. Kubernetes helps engineers and administrators monitor, manage, and orchestrate these discrete packages within the larger environment. With Kubernetes, responding to failures, managing application configurations, and updating applications can all be automated.
Originally built by engineers at Google, Kubernetes was donated to the Cloud Native Computing Foundation (CNCF), an open-source organization, in 2016. Two years later it was the first project to graduate from the CNCF incubator program.
Kubernetes is a platform based on Google’s internal container cluster manager, Borg. Since it is based off of a Google-designed platform, it is potentially capable of handling workloads at Google’s scale, which is hard to exceed.
Google introduced Kubernetes as an open-source project in 2014. Within a week, the first commit was posted in Github, with many well-known tech companies and open source organizations joining the project soon after. Eventually, it became the first hosted project of the Cloud Native Computing Foundation.
Since going open source, the platform has become one of the most contributed-to open-source projects on GitHub.
Kubernetes was Created For Distributed Systems
Kubernetes was created specifically for cloud-native or distributed applications. It can control container instances across servers, making it well-suited for managing complex, distributed systems.
This high-level diagram of the Kubernetes architecture shows the relationship between the platform, what it controls, and the cloud. Source: Kubernetes
Cloud-Native and DevOps Use Cases
The cloud-native and DevOps approaches can gain a lot from Kubernetes. Automation makes the DevOps process more efficient, helping the teams optimize their cloud-native applications.
When developers update an application, the platform creates and deploys new containers incrementally in an automated rolling fashion. Horizontal scaling compensates for the pods taken offline for the update, so application availability never changes. A pod is a collection of containers and is the smallest object in Kubernetes.
While scaling, a minimum and maximum number of pods can be established in code. A developer should base this scaling on the resource usage of the pods’ containers. When demand on an application spikes, the platform autoscales to keep the application running. When demand drops, pods can be scaled down to avoid idle resource use.
Another aspect of a rolling update is the possibility of faulty code or containers. A developer can set a desired state for a container so that it continues to function in a way the developer wants it to. The platform checks if the containers it controls match that desired state; if they do not, the containers are pulled from production in favor of the last working version. When the developer has a working updated version ready, the newer version is automatically rolled out as described above.
What is Kubernetes? Features
The master components of Kubernetes are the control plane for a cluster. These components make global decisions about the cluster (such as scheduling) and detect and respond to events in the cluster (such as when a new pod starts).
Service Discovery and Load Balancing
Kubernetes is capable of using the domain name system (DNS) of a service so pods can automatically discover services. Load balancing across containers through Kubernetes is done by giving pods IP addresses and sets of pods DNS names.
When a container is destroyed, the files that were added during runtime are lost. To provide storage across container instances, volumes can be mounted to containers.
Automated Deployment and Rollbacks
Developers can change a defined desired state so the platform automatically deploys the new containers the developers have improved. Kubernetes also maintains the desired state with rollbacks by automatically replacing problematic pods with working older copies.
Automatic Resource Redistribution
A user can specify how much CPU and memory a container can use. The scheduler allocates containers to machines with ideal amounts of resources.
In Kubernetes, a “secret“ is an object with sensitive data. A secret gives the user control over how the data is used and accessed. Kubernetes automatically creates secrets with credentials for accessing its API.