Kubernetes Deployment Strategies

Kubernetes Deployment Strategies

·

3 min read

What is Deployment?

Developing an application, such as a web server, is just the first step in making it available to users. To make the application functional, it needs to be deployed on one or more machines, so that different individuals, such as developers, testers, QA teams, and customers can access it. However, software deployment is not a simple process, as it involves a series of activities that ensure the successful installation, configuration, and testing of the application. The deployment process may vary based on the type of application and infrastructure it's running on, and it requires a deep understanding of the underlying technology stack, security considerations, and scalability requirements.

Containerization

Containerization has become an important part of the deployment process. Software can be run on any kind of computer or infrastructure with the help of containerization. In the past, you had to make sure you had the correct version of the software that matched your computer's operating system in order to run an application on it.

For instance, you had to install the Windows version of the software if you used a Windows computer. But with containerization, you can build a single "container" that contains all of the application's code, files, and libraries, as well as everything else it needs to function. This makes the container much more adaptable and simple to use because it can be used with any kind of device or operating system. Consequently, containerization facilitates the use of software on your computer or other devices, without worrying about compatibility issues.

Why do we need deployment strategies?

A deployment strategy is a technique for changing/upgrading a running application with a newer version or another version. This is a very common case because of folks continuously committing to the codebase, a new version/releases getting deployed daily. In that case, we not only want to containerize the application but also run the application on different machines means replacing the old containers with new containers ideally called a release. Hence we have to follow some kind of technique to replace all the older versions of pods from one build to another with the latest version.
Now one might say Why don't we delete the old pods and create new ones totally? which sounds meaningful but if the company is making profits from website downtime of the product can cause the company huge losses which would not be an ideal scenario.

Deployment Memes

Eg. Facebook lost around $90 million during the power outage according to reports same goes for Bank servers etc.

(Source:https://www.ccn.com/facebooks-blackout-90-million-lost-revenue/)

Facebook's Catastrophic Blackout Could Cost $90 Million in Lost Revenue

So to make sure there is zero downtime and faster rollbacks we follow certain deployment strategies to avoid such problems

Types of Deployment

  • Recreate: In recreate deployment whatever existing is present delete and create fresh. Some amount of downtime is acceptable in this deployment.

  • Ramped: It's also known as rolling-update or incremental. In this deployment Version B is slowly rolled out replacing Version A.

  • Blue/Green: In this deployment newer version is released alongside the older version and slowly the traffic is shifted to the newer version.

  • Canary: The newer version is roll out to a subset of user, then proceeds to a full roll-out.

💡: What type of deployment strategy would you choose if your startup generates a major percent of revenue from the site?

If you find the blog post make sure to leave a like in case you got a doubt you can find me here: https://linktr.ee/shaggyyyez

Â