Oc set route-backends prod prod = 100 canary = 0 Oc set env dc/canary RESPONSE = "Hello from Canary" Oc run canary -image =openshift/hello-openshift Again we will use the hello-openshift image for that purpose: Let's try implementing the canary deployment using OpenShift.
The most advanced feature toggle I am aware of, gatekeeper, is implemented at Facebook. A feature toggle allows you to gate access to certain features based on specific criteria (e.g., gender, age, country of origin).
There are a few possible approaches, with the simplest being to serve only some percentage of the traffic to the new application (I will show how to do that in OpenShift), to a more complicated solutions, such as a feature toggle. Canary deploymentĬanary is about deploying an application in small, incremental steps, and only to a small group of people.
One final disadvantage of this strategy is the need for N-1 data compatibility, which applies to all of the strategies discussed in later parts of this article. In the worst case, you easily can roll back to the old version of the application.
Because of the nature of this approach, we have a full environment for tests (again, an ideal world for developers), which makes us confident about the application working as expected. The other important benefit of this approach is that tests are performed in production. That is definitely something to take into account when applying this approach. Unfortunately, at the same time this can cause problems-all current transactions and sessions will be lost, due to the physical switch from one machine serving the traffic to another one. Zero downtime is by far the biggest advantage of this approach, because the switch is almost instantaneous (which is close to ideal), causing users not to notice when their request was served by the new environment. Let me try to summarize the blue-green deployment strategy. OpenShift web console, route preview after the switch to the green environment Below is the screenshot showing that traffic is currently served by the green environment: When we are satisfied that the new version is working properly, we can flip the switch and route the entire traffic to the green environment: oc set route-backends bluegreen blue = 0 green = 100Īll of the above steps can be performed from the web console. In the meantime, the green version goes through all necessary tests (integration, end-to-end, etc.). Oc set route-backends bluegreen blue = 100 green = 0īoth of our applications are currently running, but only blue is getting the entire traffic. # created earlier but with the entire traffic coming to blue # this attaches green service under hello route, Oc set env dc/green RESPONSE = "Hello from Green" Oc run green -image =openshift/hello-openshift -replicas = 9 Running Kubernetes on your Raspberry Pi.A practical guide to home automation using open source tools.6 open source tools for staying organized.An introduction to programming with Bash.A guide to building a video game with Python.