Kubernetes

Kubernetes
Initial release 6 June 2014 (2014-06-06)[1]
Stable release
1.4.3[2] / October 16, 2016 (2016-10-16)
Repository github.com/kubernetes/kubernetes
Development status Active
Written in Go
Operating system Cross-platform
Type Cluster management software
License Apache License 2.0
Website kubernetes.io

Kubernetes (commonly referred to as "k8s") is an open source container cluster manager originally designed by Google and donated to the Cloud Native Computing Foundation. It aims to provide a "platform for automating deployment, scaling, and operations of application containers across clusters of hosts".[3] It usually works with the Docker container tool and coordinates between a wide cluster of hosts running Docker.

History

Kubernetes (from κυβερνήτης: Greek for "helmsman" or "pilot") was founded by Joe Beda, Brendan Burns and Craig McLuckie[4] and first announced by Google in 2014.[5] Its development and design are heavily influenced by Google's Borg system,[6][7] and many of the top contributors to the project previously worked on Borg. Kubernetes v1.0 was released on July 21, 2015.[8] Along with the Kubernetes v1.0 release, Google partnered with the Linux Foundation to form the Cloud Native Computing Foundation (CNCF)[9] and offered Kubernetes as a seed technology.

Design

Kubernetes defines a set of building blocks ("primitives") which collectively provide mechanisms for deploying, maintaining, and scaling applications. The components which make up Kubernetes are designed to be loosely coupled and extensible so that it can meet a wide variety of different workloads. The extensibility is provided in large part by the Kubernetes API, which is used by internal components as well as extensions and containers running on Kubernetes.[10]

Pods

The basic scheduling unit in Kubernetes is called a "pod". It adds a higher level of abstraction to containerized components. A pod consists of one or more containers that are guaranteed to be co-located on the host machine and can share resources.[10] Each pod in Kubernetes is assigned a unique (within the cluster) IP address, which allows applications to use ports without the risk of conflict.[11] A pod can define a volume, such as a local disk directory or a network disk, and expose it to the containers in the pod.[12] Pods can be manually managed through the Kubernetes API, or their management can be delegated to a controller.[10]

Labels and Selectors

Kubernetes enables clients (users or internal components) to attach key-value pairs called "labels" to any API object in the system, such as pods and nodes. Correspondingly, "label selectors" are queries against labels that resolve to matching objects.[10]

Labels and selectors are the primary grouping mechanism in Kubernetes, and are used to determine the components to which to apply an operation.[13]

For example, if the Pods of an application have labels for "tier" (front-end, back-end, etc.) and "release_track" (canary, production, etc.), then an operation on all of the back-end canary nodes could use a selector such as the following:[14]

tier=back-end AND release_track=canary

Controllers

A controller is a reconciliation loop that drives actual cluster state toward the desired cluster state.[15] It does this by managing a set of pods. One kind of controller is a Replication Controller, which handles replication and scaling by running a specified number of copies of a pod across the cluster. It also handles creating replacement pods when the node a pod is running on fails.[15] Other controllers that are part of the core Kubernetes system include a “DaemonSet Controller” for running exactly one pod on every machine (or some subset of machines), and a “Job Controller” for running pods that run to completion, e.g. as part of a batch job.[16] The set of pods that a controller manages is determined by label selectors that are part of the controller’s definition.[14]

Services

A Kubernetes service is a set of pods that work together, such as one tier of a multi-tier application. The set of pods that constitute a service are defined by a label selector.[10] Kubernetes provides service discovery and request routing by assigning a stable IP address and DNS name to the service, and load balances traffic in a round-robin manner to network connections of that IP address among the pods matching the selector (even as failures cause the pods to move from machine to machine).[11] By default a service is exposed inside a cluster (e.g. back end pods might be grouped into a service, with requests from the front-end pods load-balanced among them), but a service can also be exposed outside a cluster (e.g. for clients to reach frontend pods)[17]

Architecture

Kubernetes Architecture Diagram

Kubernetes follows the master-slave architecture.The components of Kubernetes[18] can be divided into those that manage an individual node and those that are part of the control plane.[10][19]

Kubernetes control plane

The Kubernetes Master is the main controlling unit of the cluster that manages its workload and directs communication across the system. The Kubernetes control plane consists of various components, each its own process, that can run both on a single master node or on multiple masters supporting high-availability clusters.[19] The various components of Kubernetes control plane are as follows:

etcd

etcd is a persistent lightweight, distributed key-value data store developed by CoreOS that reliably stores the configuration data of the cluster, representing the overall state of the cluster at any given point of time. Other components watch for changes to this store to bring themselves into the desired state.[19]

API Server

The API server is a key component and serves the kubernetes API using JSON over HTTP, which provides both the internal and external interface to Kubernetes.[10][20] The API server processes and validates REST requests and updates state of the API objects in etcd, thereby allowing clients to configure workloads and containers across Worker nodes.

Scheduler

The scheduler is the pluggable component that selects which node an unscheduled pod should run on based on resource availability. Scheduler tracks resource utilization on each node to ensure that workload is not scheduled in excess of the available resources. For this purpose, the scheduler must know the resource availability and their existing workloads assigned across servers.

Controller Manager

The controller manager is the process that the core Kubernetes controllers like DaemonSet Controller, Replication Controller run in. The controllers communicate with the API server to create, update, and delete the resources they manage (pods, service endpoints, etc.)[20]

Kubernetes node

The Node also known as Worker or Minion is the single machine (or virtual machine) where containers(workloads) are deployed. Every node in the cluster must run the container runtime (such as Docker), as well as the below mentioned components, for communication with master for network configuration of these containers.

kubelet

Kubelet is responsible for the running state of each node (that is, ensuring that all containers on the node are healthy). It takes care of starting, stopping, and maintaining application containers (organized into pods) as directed by the control plane.[10][21]

Kubelet monitors the state of a pod and if not in the desired state, the pod will be redeployed to the same node. The node status is relayed every few seconds via heartbeat messages to the master. Once the master detects a node failure, the Replication Controller observes this state change and launches pods on other healthy nodes.

kube-proxy

The kube-proxy is an implementation of a network proxy and a load balancer, and it supports the service abstraction along with other networking operation.[10] It is responsible for routing traffic to the appropriate container based on IP and port number of the incoming request.

cAdvisor

cAdvisor is an agent that monitors and gathers resource usage and performance metrics such as CPU, memory, file and network usage of containers on each node.

References

  1. "First GitHub commit for Kubernetes". github.com. 2014-06-07.
  2. "GitHub Releases page". github.com. 2016-10-16.
  3. "What is Kubernetes". Kubernetes. Retrieved 28 August 2015.
  4. "Google Made Its Secret Blueprint Public to Boost Its Cloud". Retrieved 2016-06-27.
  5. "Google Open Sources Its Secret Weapon in Cloud Computing". Wired. Retrieved 24 September 2015.
  6. Abhishek Verma; Luis Pedrosa; Madhukar R. Korupolu; David Oppenheimer; Eric Tune; John Wilkes (April 21–24, 2015). "Large-scale cluster management at Google with Borg". Proceedings of the European Conference on Computer Systems (EuroSys).
  7. "Borg, Omega, and Kubernetes - ACM Queue". queue.acm.org. Retrieved 2016-06-27.
  8. "As Kubernetes Hits 1.0, Google Donates Technology To Newly Formed Cloud Native Computing Foundation". TechCrunch. Retrieved 24 September 2015.
  9. "Cloud Native Computing Foundation".
  10. 1 2 3 4 5 6 7 8 9 "An Introduction to Kubernetes". DigitalOcean. Retrieved 24 September 2015.
  11. 1 2 Langemak, Jon (2015-02-11). "Kubernetes 101 – Networking". Das Blinken Lichten. Retrieved 2015-11-02.
  12. Strachan, James (2015-05-21). "Kubernetes for Developers". Medium (publishing platform). Retrieved 2015-11-02.
  13. Surana, Ramit (2015-09-16). "Containerizing Docker on Kubernetes". LinkedIn. Retrieved 2015-11-02.
  14. 1 2 "Intro: Docker and Kubernetes training - Day 2". Red Hat. 2015-10-20. Retrieved 2015-11-02.
  15. 1 2 "Overview of a Replication Controller". Documentation. CoreOS. Retrieved 2015-11-02.
  16. Sanders, Jake (2015-10-02). "Kubernetes: Exciting Experimental Features". Livewyer. Retrieved 2015-11-02.
  17. Langemak, Jon (2015-02-15). "Kubernetes 101 – External Access Into The Cluster". Das Blinken Lichten. Retrieved 2015-11-02.
  18. Mahajan, Rakesh (August 30, 2016). "Getting started with Kubernetes". TO THE NEW. Retrieved September 2, 2016.
  19. 1 2 3 "Kubernetes Infrastructure". OpenShift Community Documentation. OpenShift. Retrieved 24 September 2015.
  20. 1 2 Marhubi, Kamal (2015-09-26). "Kubernetes from the ground up: API server". kamalmarhubi.com. Retrieved 2015-11-02.
  21. Marhubi, Kamal (2015-08-27). "What [..] is a Kubelet?". kamalmarhubi.com. Retrieved 2015-11-02.

http://www.imotif.net/index.php/2016/11/08/google-kubernetes/

External links

This article is issued from Wikipedia - version of the 11/29/2016. The text is available under the Creative Commons Attribution/Share Alike but additional terms may apply for the media files.