With a Canary deployment strategy, the application release happens incrementally to a subset of users. Initially, the new version gets deployed to a canary environment with no user traffic. The DevOps release pipeline can run validation tests against the new version and, once ready, route only a subset of users to the canary environment.
This technique allows the DevOps team to evaluate the new application version against real user traffic. They can compare the two application versions side-by-side before rolling out the new version to a larger user base. It also offers risk mitigation as the new version is only enabled for a small subset of users—these users can easily switch back to the previous version in case of any issues.
The OCI Terraform Provider is now available for automatic download through the Terraform Provider Registry. For more information on how to get started view the documentation and setup guide.
-
If you aren't already signed in, when prompted, enter the tenancy and user credentials.
-
Review and accept the terms and conditions.
-
Select the region where you want to deploy the stack.
-
Follow the on-screen prompts and instructions to create the stack.
-
After creating the stack, click Terraform Actions, and select Plan.
-
Wait for the job to be completed, and review the plan.
To make any changes, return to the Stack Details page, click Edit Stack, and make the required changes. Then, run the Plan action again.
-
If no further changes are necessary, return to the Stack Details page, click Terraform Actions, and select Apply.
Now, you'll want a local copy of this repo. You can make that with the commands:
git clone https://github.com/oracle-devrel/terraform-oci-arch-devops-deployment-strategies
cd terraform-oci-arch-devops-deployment-strategies/canary-deployments-oke/
ls
First off, you'll need to do some pre-deploy setup. That's all detailed here.
Secondly, create a terraform.tfvars
file and populate with the following information:
# Authentication
tenancy_ocid = "<tenancy_ocid>"
user_ocid = "<user_ocid>"
fingerprint = "<finger_print>"
private_key_path = "<pem_private_key_path>"
# Region
region = "<oci_region>"
# Compartment
compartment_ocid = "<compartment_ocid>"
# OCI User and Authtoken
oci_username = "<oci_username>
# For a federated user (single sign-on with an identity provider), enter the username in the following format: TenancyName/Federation/UserName.
# For example, if you use OCI's identity provider, your login would be, Acme/oracleidentitycloudservice/alice.jones@acme.com.
#If you are using OCI's direct sign-in, enter the username in the following format: TenancyName/YourUserName. For example, Acme/alice_jones. Your password is the auth token you created previously.
oci_user_authtoken = "<oci_user_authtoken>"
# You can get the auth token from your Profile menu -> click User Settings -> On left side click *Auth Tokens -> Generate Token
# Set a specific name for your deployments to prefix with a tag.
app_name = "<app_name>"
Deploy:
terraform init
terraform plan
terraform apply
Follow the link here to test the deployment - procedure
When you no longer need the deployment, you can run this command to destroy it:
-
Ensure to delete all load balancers (by Nginx and Applications) via console before proceeding for destruction.
terraform destroy