An Overview of Kunernetes and Industry Use Case of Kubernetes
By: Parag Rahate
Tags: Case Study, Kubernetes, Kubernetes Cluster, Kubernetes Engine, New York Times

Containers have been helping teams of all sizes to solve issues with consistency, scalability, and security. Using containers, such as Docker, allow you to separate the application from the underlying infrastructure. Gaining that separation requires some new tools in order to get the most value out of containers, and one of the most popular tools used for container management and orchestration is Kubernetes.

What is Kubernetes?

♦ Kubernetes(also known as k8s or “kube”) is an open-source container orchestration tool designed to automate deploying, scaling, and operating containerized applications. Kubernetes can support data center outsourcing to public cloud service providers or can be used for web hosting at scale. Website and mobile applications with complex custom code can deploy using Kubernetes on commodity hardware to lower the costs on web server provisioning with public cloud hosts and to optimize software development processes. The Kubernetes project is written in the Go programming language, and you can browse its source code on GitHub.

♦ Kubernetes was originally created by Google as an open source project in 2014. Today, Kubernetes is a rapidly growing open source community, with engineers from Google, Red Hat, and many other companies actively contributing to the project. Additionally, the Cloud Native Computing Foundation, a project of the Linux Foundation, operates to provide a common home for development of Kubernetes and other applications seeking to offer modern application infrastructure solutions.

Need of Kubernetes.

♦ We love containers as containers provide a lightweight mechanism for isolating an application’s environment. Containers are a streamlined way to build, test, deploy, and redeploy applications on multiple environments from a developer’s local laptop to an on-premises data center and even the cloud. However, what happens if your container dies? Or even worse, what happens if the machine running your container fails? Containers do not provide a solution for fault tolerance. Or what if you have multiple containers that need the ability to communicate, how do you enable networking between containers? How does this change as you spin up and down individual containers? Container networking can easily become an entangled mess. Lastly, suppose your production environment consists of multiple machines — how do you decide which machine to use to run your container?

♦ Kubernetes is often described as a container orchestration platform. A container orchestration platform manages the entire lifecycle of individual containers, spinning up and shutting down resources as needed. If a container shuts down unexpectedly, the orchestration platform will react by launching another container in its place. On top of this, the orchestration platform provides a mechanism for applications to communicate with each other even as underlying individual containers are created and destroyed.

How Kubernates Works?

♦ Kubernetes is an example of a well-architected distributed system. It treats all the machines in a cluster as a single pool of resources. It takes up the role of a distributed operating system by effectively managing the scheduling, allocating the resources, monitoring the health of the infrastructure, and even maintaining the desired state of infrastructure and workloads. Kubernetes is an operating system capable of running modern applications across multiple clusters and infrastructures on cloud services and private data center environments.

Kubernetes Terminology

1. Pods

A pod is the smallest execution unit in Kubernetes. A pod encapsulates one or more applications. Pods are ephemeral by nature, if a pod (or the node it executes on) fails, Kubernetes can automatically create a new replica of that pod to continue operations. Pods include one or more containers (such as Docker containers).

2. Kube proxy

The Kube proxy routes traffic coming into a node from the service. It forwards requests for work to the correct containers.

3. Kubelet

A Kubelet tracks the state of a pod to ensure that all the containers are running. It provides a heartbeat message every few seconds to the control plane. If a replication controller does not receive that message, the node is marked as unhealthy.

4. Nodes

A Kubernetes node manages and runs pods; it’s the machine (whether virtualized or physical) that performs the given work. Just as pods collect individual containers that operate together, a node collects entire pods that function together. When you’re operating at scale, you want to be able to hand work over to a node whose pods are free to take it.

5. API Server

The API server exposes a REST interface to the Kubernetes cluster. All operations against pods, services, and so forth, are executed programmatically by communicating with the endpoints provided by it.

6. Scheduler

The scheduler is responsible for assigning work to the various nodes. It keeps watch over the resource capacity and ensures that a worker node’s performance is within an appropriate threshold.

7. Controller manager

The controller-manager is responsible for making sure that the shared state of the cluster is operating as expected. More accurately, the controller manager oversees various controllers which respond to events (e.g., if a node goes down).

8. etcd

etcd is a distributed key-value store that Kubernetes uses to share information about the overall state of a cluster. Additionally, nodes can refer to the global configuration data stored there to set themselves up whenever they are regenerated.

9. Kubernetes Master

This is the main entry point for administrators and users to manage the various nodes. Operations are issued to it either through HTTP calls or connecting to the machine and running command-line scripts.

Kubernetes is an orchestration tool for containerized applications. It is responsible for:

Deploying images and containers

Managing the scaling of containers and clusters

Resource balancing containers and clusters

Traffic management for services

Who Use Kubernetes?

2253 companies reportedly use Kubernetes in their tech stacks, including Google, Shopify, and Slack.

Use Case of Kubernetes

CASE STUDY: The New York Times

The New York Times is an American daily newspaper based in New York City with a worldwide influence and readership. Founded in 1851 and known as the newspaper of record, The New York Times is a digital pioneer: Its first website launched in 1996, before Google even existed.

Challenge

When the company decided a few years ago to move out of its data centers, its first deployments on the public cloud were smaller, less critical applications managed on virtual machines. “We started building more and more tools, and at some point we realized that we were doing a disservice by treating Amazon as another data center,” says Deep Kapadia, Executive Director, Engineering at The New York Times. Kapadia was tapped to lead a Delivery Engineering Team that would “design for the abstractions that cloud providers offer us.”

Solution

The team decided to use Google Cloud Platform and its Kubernetes-as-a-service offering, GKE. To get the most out of the cloud, Kapadia was tapped to lead a new Delivery Engineering Team that would “design for the abstractions that cloud providers offer us.” In mid-2016, they began looking at the Google Cloud Platform and its Kubernetes-as-a-service offering, GKE.

Impact

Speed of delivery increased. Some of the legacy VM-based deployments took 45 minutes; with Kubernetes, that time was “just a few seconds to a couple of minutes,” says Engineering Manager Brian Balser. Adds Li: “Teams that used to deploy on weekly schedules or had to coordinate schedules with the infrastructure team now deploy their updates independently, and can do it daily when necessary.” Adopting Cloud Native Computing Foundation technologies allows for a more unified approach to deployment across the engineering staff, and portability for the company.

In early 2017, the first production application — the nytimes.com mobile homepage — began running on Kubernetes, serving just 1% of the traffic. Today, almost 100% of the nytimes.com site’s end-user facing applications run on GCP, with the majority on Kubernetes.

Conclusion

Lastly, the conclusion is that Kubernetes is an exciting project that allows users to run scalable, highly available containerized workloads on a highly abstracted platform.

Thank You!!!