Blue-green Deployments

    Set up the “blue” environment, running version one of the address service:

    1. Create an upstream:

    2. Add two targets to the upstream:

      1. curl -X POST http://localhost:8001/upstreams/address.v1.service/targets \
      2. --data "target=192.168.34.15:80"
      3. --data "weight=100"
      4. curl -X POST http://localhost:8001/upstreams/address.v1.service/targets \
      5. --data "weight=50"
    3. Finally, add a route as an entry-point into the service:

      1. --data "hosts[]=address.mydomain.com"

    Requests with host header set to address.mydomain.com will now be proxied by Kong Gateway to the two defined targets. Two-thirds of the requests will go to http://192.168.34.15:80/address (weight=100), and one-third will go to http://192.168.34.16:80/address (weight=50).

    Before deploying version two of the address service, set up the “Green” environment:

    Incoming requests with host header set to address.mydomain.com are now proxied by Kong to the new targets. Half of the requests will go to http://192.168.34.17:80/address (weight=100), and the other half will go to (weight=100).