Learn KOP - Part 3 - Rolling Update Deployment Pattern - Rafay Product Documentation

Rolling Update

This is Part 3 of a multi-part, self-paced quick start exercise.

What Will You Do

In part 2, you will test how the "Rolling Update" deployment pattern works. A deployment defined with a strategy of type "Rolling Update" updates pods in a rolling fashion i.e. a secondary ReplicaSet is created with the new version of the application, then the number of replicas of the old version is decreased and the new version is increased until the correct number of replicas is reached.

The rolling update strategy ensures there are some pods available to continue serving traffic during the update, so there is no downtime. However, both the old and new pods run side by side while the update is taking place, meaning any data stores or clients must be able to interact with both versions.

Advantages

Disadvantages

Estimated Time

Estimated time burden for this part is 5 minutes.

Background

This part assumes you completed Part-2 and are continuing from that point onwards.

Step 1: Setup

while true; do sleep 1; curl http://<External-IP from above>;done

This will execute cURL against the configured IP every second. You should see something like the following.

Blue v2
Blue v2
Blue v2....

Step 2: Update Strategy

  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxSurge: 2
      maxUnavailable: 1

When using the RollingUpdate strategy, there are options that allow us to fine-tune the update process:

Step 3: Update Message

The update will trigger the Gitops pipeline and it will automatically update the workload on the cluster. You should see something like the following in a few minutes. Notice that the new pods (based on v3) are created in parallel to the existing pods and that there is "zero downtime" for the application

Blue v2
Blue v2
Blue v2
Blue v3
Blue v3
Blue v3
Blue v3

Recap

In this part, you tested and experienced how the "Rolling Update" deployment pattern/strategy works.