Why & How MNC’s using Kubernetes for Solving BIG Issues.
What is Kubernetes
In a nutshell, Kubernetes is a system for deploying applications and more efficiently utilizing the containerized infrastructure that powers the apps. Kubernetes can save organizations money because it takes less manpower to manage IT; it makes apps more resilient and performant.
You can also run Kubernetes on-premises or within public Cloud. AWS, Azure, and GCP offer managed Kubernetes solutions to help customers get started quickly and efficiently operate K8s apps. Kubernetes also makes apps a lot more portable, so IT can move them more easily between different clouds and internal environments.
In a nutshell, Kubernetes is the new Linux OS of the Cloud.
Google created Kubernetes and it is now part of CNCF, with very active engagement and contribution from many enterprises large and small.
Fun fact: If you are looking for a comic-book style introduction to kubernetes, here’s an excellent asset from Google.
The Rise of Kubernetes
First released in 2014, Kubernetes is an open-source container orchestration tool that can automatically scale, distribute, and manage fault-tolerance on containers. Originally created by Google and then donated to Cloud Native Computing Foundation, Kubernetes is widely used in production environments to handle Docker containers and other container tools in a fault-tolerant manner. As an open-source product, it is available on various platforms and systems. Google Cloud, Microsoft Azure, and Amazon AWS offer official support for Kubernetes, so configuration changes to the cluster itself are not necessary.
The popularity of Kubernetes has steadily increased, with more than four major releases in 2017. K8s also was the most discussed project in GitHub during 2017 and was the project with the second most reviews.
Why Kubernetes?
The Docker adoption is still growing exponentially as more and more companies have started using it in production. It is important to use an orchestration platform to scale and manage your containers.
Imagine a situation where you have been using Docker for a little while, and have deployed on a few different servers. Your application starts getting massive traffic, and you need to scale up fast; how will you go from 3 servers to 40 servers that you may require? And how will you decide which container should go where? How would you monitor all these containers and make sure they are restarted if they die? This is where Kubernetes comes in.
Overview benefits
- Container orchestration
- Great for multi-cloud adoption
- Deploy and update applications at scale for faster time-to-market
- Better management of your applications
- You can use it to deploy your services, to roll out new releases without downtime, and to scale (or de-scale) those services.
- It is portable.
- It can run on a public or private cloud.
- It can run on-premise or in a hybrid environment.
- You can move a Kubernetes cluster from one hosting vendor to another without changing (almost) any of the deployment and management processes.
- Kubernetes can be easily extended to serve nearly any needs. You can choose which modules you’ll use, and you can develop additional features yourself and plug them in.
- Kubernetes will decide where to run something and how to maintain the state you specify.
- Kubernetes can place replicas of service on the most appropriate server, restart them when needed, replicate them, and scale them.
- Self-healing is a feature included in its design from the start. On the other hand, self-adaptation is coming soon as well.
- Zero-downtime deployments, fault tolerance, high availability, scaling, scheduling, and self-healing add significant value to Kubernetes.
- You can use it to mount volumes for stateful applications.
- It allows you to store confidential information as secrets.
- You can use it to validate the health of your services.
- It can load balance requests and monitor resources.
- It provides service discovery and easy access to logs.
When you should use it
If your application uses a microservice architecture
If you have transitioned or are looking to transition to a microservice architecture then Kubernetes will suit you well because it’s likely you’re already using software like Docker to containerize your application.
If you’re suffering from slow development and deployment
If you’re unable to meet customer demands due to slow development time, then Kubernetes might help. Rather than a team of developers spending their time wrapping their heads around the development and deployment lifecycle, Kubernetes (along with Docker) can effectively manage it for you so the team can spend their time on more meaningful work that gets products out the door.
“Our internal teams have less of a need to focus on manual capacity provisioning and more time to focus on delivering features for Spotify.” — Spotify
Lower infrastructure costs
Kubernetes uses an efficient resource management model at the container, pod, and cluster level, helping you lower cloud infrastructure costs by ensuring your clusters always have available resources for running applications.
When you shouldn’t use it
Simple, lightweight applications
If your application makes use of a monolithic architecture it may be tough to see the real benefits of containers and a tool used to orchestrate them. That’s because the very nature of a monolithic architecture is to have every piece of the application intertwined — from IO to the data processing to rendering, whereas containers are used to separate your application into individual components.
Culture doesn’t reflect the changes ahead
Kubernetes notoriously has a steep learning curve, meaning you’ll be spending a good amount of time educating teams and addressing the challenges of a new solution, etc. If you don’t have a team that’s willing to experiment and take risks then it’s probably not the choice for you.
What’s next?
Overall, Kubernetes boasts some pretty great features that can have a positive impact on your developing/DevOps teams and for the business as a whole. If you’re looking to get started with Kubernetes, you can check out A Practical Guide to Kubernetes, written by Viktor Farcical, a Developer Advocate at CloudBees, a member of the Google Developer Experts and Docker Captains groups, and a published author.
Kubernetes Use Cases:
1. The New York Times’s: From Print to the Web to Cloud-Native
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.
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.
2.Pinterest: Pinning Its Past, Present, and Future on Cloud Native
Challenge
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
The first phase involved moving services to Docker containers. Once these services went into production in early 2017, the team began looking at orchestration to help create efficiencies and manage them in a decentralized way. After an evaluation of various solutions, Pinterest went with 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.”
3.Spotify: An Early Adopter of Containers, Spotify Is Migrating from Homegrown Orchestration to Kubernetes
Challenge
Launched in 2008, the audio-streaming platform has grown to over 200 million monthly active users across the world. “Our goal is to empower creators and enable a really immersive listening experience for all of the consumers that we have today — and hopefully the consumers we’ll have in the future,” says Jai Chakrabarti, Director of Engineering, Infrastructure, and Operations. An early adopter of microservices and Docker, Spotify had containerized microservices running across its fleet of VMs with a homegrown container orchestration system called Helios. By late 2017, it became clear that “having a small team working on the features was just not as efficient as adopting something that was supported by a much bigger community,” he says.
Solution
“We saw the amazing community that had grown up around Kubernetes, and we wanted to be part of that,” says Chakrabarti. Kubernetes was more feature-rich than Helios. Plus, “we wanted to benefit from added velocity and reduced cost, and also align with the rest of the industry on best practices and tools.” At the same time, the team wanted to contribute its expertise and influence to the flourishing Kubernetes community. The migration, which would happen in parallel with Helios running, could go smoothly because “Kubernetes fit very nicely as a compliment and now as a replacement to Helios,” says Chakrabarti.
Impact
The team spent much of 2018 addressing the core technology issues required for a migration, which started late that year and is a big focus for 2019. “A small percentage of our fleet has been migrated to Kubernetes, and some of the things that we’ve heard from our internal teams are that they have less of a need to focus on manual capacity provisioning and more time to focus on delivering features for Spotify,” says Chakrabarti. The biggest service currently running on Kubernetes takes about 10 million requests per second as an aggregate service and benefits greatly from autoscaling, says Site Reliability Engineer James Wen. Plus, he adds, “Before, teams would have to wait for an hour to create a new service and get an operational host to run it in production, but with Kubernetes, they can do that on the order of seconds and minutes.” In addition, with Kubernetes’s bin-packing and multi-tenancy capabilities, CPU utilization has improved on average two- to threefold.