The blue-green upgrade strategy is a Kong Gateway upgrade option used primarily for traditional mode deployments and for Control Planes in hybrid mode.
This guide refers to the old version as cluster X and the new version as cluster Y.
Blue-green upgrades are derived from the in-place upgrade strategy.
This upgrade strategy benefits from the fact that kong migrations up
leaves the database in a state
where it can serve requests by either the current cluster X or the new cluster Y.
The compatibility of the database with cluster X is only lost when kong migrations finish
is executed.
This is a more advanced strategy than the dual-cluster upgrade in that there is no need to deploy a new database. It still supports gradually diverting traffic from the current cluster X to the new cluster Y, shown in the following diagram. Furthermore, runtime metrics (for example, Rate Limiting Advanced plugin counters) are sent to the same database. Metrics are continuously collected from both clusters during the upgrade process.
flowchart TD DB[(Database)] CPX(Current Kong Gateway X) Admin(No admin write operations) Admin2(No admin write operations) CPY(New Kong Gateway Y) LB(Load balancer) API(API requests) API --> LB & LB & LB & LB Admin2 -."X".- CPX LB -.90%.-> CPX LB --10%--> CPY Admin -."X".- CPY CPX -.-> DB CPY --"kong migrations up \n (NO kong migrations finish)"--> DB style CPX stroke-dasharray:3 style Admin fill:none!important,stroke:none!important,color:#d44324!important style Admin2 fill:none!important,stroke:none!important,color:#d44324!important linkStyle 4,7 stroke:#d44324!important,color:#d44324!important linkStyle 3,6,9 stroke:#b6d7a8!important
Figure 1: The diagram shows a Kong Gateway upgrade using the blue-green strategy. The new Kong Gateway cluster Y is deployed alongside the current Kong Gateway cluster X. Both clusters use the same database. Traffic is gradually switched over to the new deployment, until all API traffic is migrated.
Compared to dual-cluster and in-place upgrades, blue-green upgrades consume less resources since there is no extra database required, and still allow for no business downtime.
Important: Support from Kong for upgrades using this strategy is limited. Though blue-green upgrades are supported, it is nearly impossible to fully cover all migration tests, because we have to cover all combinations, given the number of Kong Gateway versions, upgrade strategies, features adopted, and deployment modes. If you must use this strategy, only use it to upgrade between patch versions.
In traditional mode, blue-green upgrades are available starting in 2.8.2.x. If you have a Kong Gateway 2.8.x version earlier than 2.8.2.x, upgrade to at least 2.8.2.0 before starting any upgrades to the 3.x series.