This topic describes how to implement a phased release or a blue-green release by using an ingress provided by Alibaba Cloud Container Service for Kubernetes (ACK).

Background information

You can implement a phased release or a blue-green release to create two identical production environments for the old and new service versions. In this case, when users send requests, ACK routes some traffic to the latest version on the fly based on specific rules. If the latest version runs without exceptions for a period of time, you can route all traffic from the earlier version to the latest version.

A/B testing is a way of phased releases. It allows some users to use the earlier version, and route traffic of other users to the latest version. If the latest version runs without exceptions for a period of time, you can gradually route all traffic to the latest version.

Scenarios

Scenario 1

Assume that Service A that provides an externally accessible Layer 7 service is available to all users. Before you roll out Service A' to all users, a new version that enables new features, you expect a small subset of users to receive the new version first. In this scenario, you expect to route client requests that contain request header foo=bar or cookie foo=bar to Service A'. If Service A' runs without exceptions for a period of time, you can route all traffic from Service A to Service A' and gradually discontinue Service A.Scenario 1

Scenario 2

Assume that Service B that provides an externally accessible Layer 7 service is available to all users. Before you roll out Service B' to all users, a new version that has fixed some bugs, you expect a small subset of users to receive the new version first. In this scenario, you expect to route 20% of the traffic to Service B'. If Service B' runs without exceptions for a period of time, you can route all traffic from Service B to Service B' and gradually discontinue Service B.Scenario 2

To meet the preceding requirements, ACK uses an ingress to enable traffic splitting based on the following methods:

A/B testing:
  • Traffic splitting based on request headers
  • Traffic splitting based on cookies
  • Traffic splitting based on query parameters

Blue-green releases: traffic splitting based on weighted services