Kubernetes Deployment Strategies

  • In the old days, we typically use to upgrade applications by just shutting down the older application and installing the newer application, and restarting the server.
  • This is the biggest challenge is to speed up the deployment speed.
  • Kubernetes provides an advanced platform for making cloud-native deployments easy.

Here, we will discuss various different strategies to upgrade applications from the older version to newer version capabilities.

1. Recreate

  • Recreate deployment strategy will terminate all the running pod instances then recreate them with the newer version.
  • It is also called dummy deployment.
  • This technique implies downtime of the application that depends on both shutdown and boot duration of the application.

Pros

  • When it comes to easy setup, Recreate is a good option.
  • Application state entirely renewed.

Cons

  • High impact on the user, expect downtime that depends on both shutdown and boot duration of the application.

2. Rolling Update

  • This deployment strategy is the default strategy in Kubernetes.
  • In this, pods of the previous version are slowly replaced one by one pod of the new version without any cluster downtime.
  • Also, this is one of the best deployment strategies in Kubernetes.
  • For example, let’s imagine an application with four pods.
  • When the developers start to upgrade to the newer version, pods are upgraded one at a time until all pod instances are replaced with the newer applications.

Pros

  • Slow-release of version across instances.
  • Useful for stateful applications that can handle the data.

Cons

  • In this strategy, rollout and rollback take time.
  • There is no control over the traffic.

3. Canary

  • In this Kubernetes deployment strategy, traffic is split based on weight.
  • A canary deployment consists of slowly moving production traffic from version A to version B.
  • This is an ideal deployment strategy for someone who wants to test the newer version before it is 100 percent deployed.
  • In the above example, First, you may upgrade from version1 to version2 and do then do some testing, If the test results are good, then you can upgrade the remaining three pod instances.

Pros

  • In this strategy, rollback is fast.
  • Convenient for monitoring of application performance and error rates.

Cons

  • The rollout is slow in this strategy.

4. Blue/Green

  • Using this deployment strategy, we deploy the same number of the newer versions of the app along with the older version of the instance.
  • Then switch the user traffic from older to newer instances, if there are any issues with the newer version, it is very easy to switch back to the older version.
  • We can remove the older version when your newer one is working fine.

Pros

  • rollout and rollback are fast.
  • Versioning issues are fixed as a whole application state is changed completely.

Cons

  • The cost factor, as this strategy requires double the resources.
  • Required proper testing of application before deploying it to the production.

--

--

--

DevOps Engineer

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

A Literate Programming Environment For Existing Repositories

Reflection And Attributes(C#)

ANSIBLE Use-Case: How NASA Using Ansible For Solving The Challenges ?

1st Project : Blinking ESP 32

Flutter Experiment #1: Flutter layout from xml

15 things I learned doing serverless for a year and a half

The Software That Makes You Think Better

A white Pegasus is flying in the sky.

Partition Equal subset sum | Dynamic Programming

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Bikram

Bikram

DevOps Engineer

More from Medium

Kubernetes Application High-Availability — Part 1 (The Very-Basic Basics)

Kubernetes — Resource Request & Limit

Kubernetes Pods

Kubernetes Labels, Selectors & Annotations — Chapter 10