Blue-green Deployments
Set up the “blue” environment, running version one of the address service:
Create an upstream:
Add two targets to the upstream:
curl -X POST http://localhost:8001/upstreams/address.v1.service/targets \
--data "target=192.168.34.15:80"
--data "weight=100"
curl -X POST http://localhost:8001/upstreams/address.v1.service/targets \
--data "weight=50"
Finally, add a route as an entry-point into the service:
--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
).