What does Kubernetes actually do?
As you read from its Github page:
Kubernetes is an open source system for managing containerized applications across multiple hosts, providing basic mechanisms for deployment, maintenance, and scaling of applications.
Kubernetes is:
lean: lightweight, simple, accessible portable: public, private, hybrid, multi cloud extensible: modular, pluggable, hookable, composable self-healing: auto-placement, auto-restart, auto-replication
Kubernetes builds upon a decade and a half of experience at Google running production workloads at scale, combined with best-of-breed ideas and practices from the community.
For me Kubernetes is a container orchestration tool from Google. Due to its design you can implement compatibility with any container engine, but I think now it's limited to Docker. There are some important concepts in its architecture:
Kubernetes works with the following concepts:
Clusters are the compute resources on top of which your containers are built. Kubernetes can run anywhere! See the Getting Started Guides for instructions for a variety of services.
Pods are a colocated group of Docker containers with shared volumes. They're the smallest deployable units that can be created, scheduled, and managed with Kubernetes. Pods can be created individually, but it's recommended that you use a replication controller even if creating a single pod. More about pods.
Replication controllers manage the lifecycle of pods. They ensure that a specified number of pods are running at any given time, by creating or killing pods as required. More about replication controllers.
Services provide a single, stable name and address for a set of pods. They act as basic load balancers. More about services.
Labels are used to organize and select groups of objects based on key:value pairs. More about labels.
So, you have a group of machines that forms a cluster where your containers are run. Yo can also define a group of containers that provide a service, in a similar way you do with other tools like fig (i.e.: webapp pod can be a rails server and a postgres database). You have also other tools to ensure a number of containers/pods of a service running at the same time, a key-value store, a kind of built-in load balancer...
If you know something about coreos, it's a very similar solution but from Google. Algo Kubernetes has a good integration with Google Cloud Engine.
The purpose of Kubernetes is to make it easier to organize and schedule your application across a fleet of machines. At a high level it is an operating system for your cluster.
Basically, it allows you to not worry about what specific machine in your datacenter each application runs on. Additionally it provides generic primitives for health checking and replicating your application across these machines, as well as services for wiring your application into micro-services so that each layer in your application is decoupled from other layers so that you can scale/update/maintain them independently.
While it is possible to do many of these things in application layer, such solutions tend to be one-off and brittle, it's much better to have separation of concerns, where an orchestration system worries about how to run your application, and you worry about the code that makes up your application.