How Kubernetes is used in Industries and what all use cases are solved by Kubernetes?
By: Abhya Singh
Tags: Case Study, Kubernetes, Kubernetes Cluster

What is Kubernetes?

Kubernetes is an open source orchestration system for Docker containers. It handles scheduling onto nodes in a compute cluster and actively manages workloads to ensure that their state matches the users declared intentions.

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

Docker, Microsoft Azure, Ansible, Vagrant, and Google Compute Engine are some of the popular tools that integrate with Kubernetes.

CASE STUDY:

Challenge:

With over 250 million monthly active users and serving over 10 billion recommendations every single day, the engineers at Pinterest knew these numbers are going to grow day by day, and they began to realize the pain of scalability and performance issues.

After eight years in existence, Pinterest had grown into 1,000 microservices and multiple layers of infrastructure and diverse set-up tools and platforms. In 2016 the company launched a roadmap towards a new compute platform, led by the vision of creating the fastest path from an idea to production, without making engineers worry about the underlying infrastructure.

solution:

Their initial strategy was to move their workload from EC2 instances to Docker containers; they first moved their services to Docker to free up engineering time spent on Puppet and to have an immutable infrastructure.The next strategy was to move to Kubernetes.

Impact:

“By moving to Kubernetes the team was able to build on-demand scaling and new failover policies, in addition to simplifying the overall deployment and management of a complicated piece of infrastructure such as Jenkins,” says Micheal Benedict, Product Manager for the Cloud and the Data Infrastructure Group at Pinterest. “We not only saw reduced build times but also huge efficiency wins. For instance, the team reclaimed over 80 percent of capacity during non-peak hours. As a result, the Jenkins Kubernetes cluster now uses 30 percent less instance-hours per-day when compared to the previous static cluster.”

The Cloud Management Platform team at Pinterest started their journey on Kubernetes back in 2017. they dockerized most of their production workloads, including the core API and Web fleets, by the first half of 2017. Extensive evaluation on different container orchestration systems was then done by building prod clusters and operating real workloads on them. By the end of 2017, they decided to go down the path of Kubernetes because of its flexibility and extensive community support.

So far, they’ve built their own cluster bootstrap tools based on Kops and integrated existing infrastructure components into our Kubernetes cluster, such as network, security, metrics, logging, identity management and traffic. they introduced Pinterest-specific custom resources to model our unique workloads while hiding the runtime complexity from developers. they’re now focusing on cluster stability, scalability, and customer onboarding.

Pinterest custom resources and controllers

In order to pave an easier way for our engineers to adopt Kubernetes and make infra development faster and smoother, they designed their own Custom Resource Definitions (CRDs).

PinterestService resource puts together a deployment, a service, an ingress and a configmap, so service developer will not need to worry about setting up DNS for their service.Inject necessary runtime support for the applications. The user only needs to focus on the container spec for their own business logic, while the CRD controller injects necessary sidecars, init containers, environment variables and volumes into their pod spec. This provides an out-of-box experience to the application engineers.CRD controllers also do life cycle management for the native resources and handle visibility and debuggability. This includes but is not limited to reconciling the desired spec and the actual spec, CRD status updating and event recording. Without CRDs, app engineers must manage a much larger set of resources, and this process has proved to be error prone.

Application Deploy Workflow

They ramped up the cluster, and working with a team of four people, got the Jenkins Kubernetes cluster ready for production. “We still have our static Jenkins cluster,” says Benedict, “but on Kubernetes, we are doing similar builds, testing the entire pipeline, getting the artifact ready and just doing the comparison to see, how much time did it take to build over here. “We’re currently building the entire Pinterest JVM stack on this new cluster,” says Benedict. “At peak, we run thousands of pods on a few hundred nodes. Overall, by moving to Kubernetes the team was able to build on-demand scaling and new failover policies, in addition to simplifying the overall deployment and management of a complicated piece of infrastructure such as Jenkins.

THANKS FOR READING!!