Skip to main content

Version: 3.2.14.6

Configure Blue-Green Deployment

Blue-green deployment is a strategy that minimizes downtime and risk by using two identical environments: Blue (current live) and Green (new version). Traffic is switched from Blue to Green once the new version is verified, allowing seamless updates. If issues occur, you can quickly revert to Blue, ensuring continuous service with minimal disruption.

Below is an interactive demo that provides a hands-on introduction to blue-green deployment using API7 Enterprise.

Configure Blue/Green Upstreams

  1. Select Published Services of your gateway group from the side navigation bar, then click the service you want to modify, for example, httpbin.
  2. Under the published service, select Upstreams from the side navigation bar.
  3. In the Default Upstream module, click Edit, rename the upstream to Blue Upstream, and click Save.
  4. In the Canary Rules module, click Start Canary.
  5. In the dialog box, do the following:
    • In the Weight field, enter 100.
    • In the Condition field, keep the button off.
    • Click Next.
  6. In the Canary Upstream field, choose Create a new upstream.
    • In the Upstream Name field, enter Green Upstream.
    • Click Edit to adjust the host of the node to point to the new backend. For example, use 172.16.1.82 as the host and 80 as the port.
    • Click Save.
  7. Click Start. The canary rules start working immediately.

Validate

Validate the Green Upstream by sending a request:

curl "http://127.0.0.1:9080/headers" -v

You will receive a 200 OK response with the header green.

Finish Canary Rules

  1. In the Canary Rules field, click Actions and Finish.
  2. In the dialog box, do the following:
    • In the Baseline Upstream field, choose Canary Upstream: Green Upstream.
    • In the Delete Unselected Upstream: Default Upstream field, turn off the button.
    • Click Finish. The Blue Upstream is a history upstream that you can send traffic to when necessary.

Additional Resources


API7.ai Logo

API Management for Modern Architectures with Edge, API Gateway, Kubernetes, and Service Mesh.

Product

API7 Cloud

SOC2 Type IIISO 27001HIPAAGDPRRed Herring

Copyright © APISEVEN Ltd. 2019 – 2024. Apache, Apache APISIX, APISIX, and associated open source project names are trademarks of the

Apache Software Foundation