Overview: Perform in-place Kubernetes updates with a Blue/Green Deployment
Because Red Hat OpenShift is built on Kubernetes, it allows you to perform in-place updates of existing running applications. This feature means you can spin up a different version of an application—newer or older—and have the traffic automatically routed to that version. When done correctly, this can be used to create a zero-downtime deployment.
Put more succinctly: Kubernetes (and OpenShift) allow you to update an application with one simple command.
This OpenShift Developer Sandbox activity will guide you through the process of deploying an application, actively using the application, and then initiating a Blue/Green Deployment to switch to version 2 of that application. Immediately following that update, you will quickly switch back to version 1 of the application. Following that switch, you will again switch to version 2.
This immediate back-and-forth switching between versions is facilitated by the Blue/Green Deployment pattern. In this pattern, both versions of the application are running at the same time, with only one version being accessed at any given moment. The Blue/Green pattern allows you to introduce a new version while keeping the old version running. After both versions are up and running, traffic is very rapidly moved from the older version to the newer version. Monitoring, metrics, and log inspections are then used to determine if the newer version is working properly. If it is, you are finished with the deployment and you can stop and remove the older version. If the newer version is not meeting expectations, you can immediately revert to the older version.
Prerequisites
- An OpenShift Sandbox account
- The OpenShift command-line interface (CLI) installed on your local PC
The working environment for this activity
- The command line, using either Bash or PowerShell
- A web browser
What you will do
- Log in to your Developer Sandbox account.
- Spin up an application.
- Run a curl command loop.
- Spin up Version 2 of the application.
- Switch from Version 1 to Version 2.
- Observe the results.
- Switch back to Version 1.