Learn about modern application deployment strategies Oracle Cloud, OCI Infrastructure, DevOps revolu

Mondo Culture Updated on 2024-02-01

To run your applications efficiently in the cloud, it's critical to deliver software quickly. Oracle DevOps provides developers with a continuous integration and deployment (CI CD) platform that you can use to easily build, test, and deploy software and applications on Oracle Cloud. DevOps build and deployment pipelines reduce change-induced errors and reduce customer time spent building and deploying releases. The service also provides private git repositories to store yours and supports connections to external repositories. Whether you're migrating workloads to OCI (from on-premises or other clouds) or developing new applications on OCI, you can simplify the software delivery lifecycle with DevOps services. This reference architecture describes two different deployment strategies, the blue-green deployment strategy and the canary deployment strategy. Deployment strategies are models and practices that make modifications or upgrades of applications possible. They allow DevOps teams to define how applications are deployed to production. Choosing between different deployment strategies enables administrators to make the right trade-offs between the risk of deploying a new version, the impact of the new version on users, and the infrastructure overhead required to implement the policy. The strategies presented here give customers more options to make the right trade-offs based on their application needs. Blue-green deploymentThe blue-green deployment strategy allows DevOps teams to release a new version of an application by using two identical environments, one of which is active at a specific time. The current version of the application is deployed in the active environment, while the new version is deployed in the standby environment. Deploying to an on-demand environment doesn't impact the active environment or user traffic. DevOps release pipelines can run validation tests against a new version and, once approved, promote them to production by simply switching user traffic to an on-demand environment. This process is repeated for each new version of the application. The main advantage of this strategy is that it provides near-zero downtime and instant rollback capabilities. If there are any issues with the new version, the traffic can be immediately reverted back to the previous stable version. In addition, the on-call environment can be used to debug issues in application releases. Blue-green deployments offer the following benefits: they can be deployed quickly and risk-free.

It provides an effective and simple rollback mechanism.

It is an effective way to conduct a B software test.

It requires little to no downtime because of the production ring.

The environment is always served by an active environment controlled by a load balancer. However, you should be aware of these drawbacks: running two identical environments is costly and resource-intensive to maintain.

When managing releases between two identical environments, you need to monitor both environments closely.

Managing database dependencies between deployments can be complex.

The following diagram illustrates the blue-green deployment architecture:

Follow your instructions, keep the structure of the original text, and continue to make changes:Canary deploymentIn a canary deployment strategy, the release of an application is progressively made to a subset of users. Initially, the new version was deployed into a canary environment with no user traffic. DevOps release pipelines can perform validation testing of new versions and, once ready, route only a subset of users' traffic to the canary environment. This technique allows DevOps teams to evaluate new versions of an application against real user traffic. They can compare the two versions of the app before rolling out the new version to a larger user base. If anything goes wrong, these users can easily switch back to the previous version, which also provides risk mitigation. Canary deployment offers the following benefits: You can test both app versions with real users.

Zero downtime for new releases.

Rolling back to a previous version is very easy and with minimal risk.

However, you should be aware of these drawbacks: the complexity of testing and validating new releases on a large scale.

Getting feedback on a new release from user testing takes time.

The following diagram illustrates the canary deployment strategy:

These schemas contain the following components:GeographyAn OCI region is a local geographic region that contains one or more data centers, known as availability domains. Regions are independent of each other, and they may be far apart from each other (across countries or even continents). The architecture uses a single geograph.

DevOps projectsA logical grouping of DevOps resources required to implement a CI CD workflow. DevOps resources can be artifacts, build pipelines, deployment pipelines, external connections, triggers, and environments. DevOps projects make it easy to enable logging, monitoring, and notifications for all DevOps resources.

Build pipelinesThe build pipeline obtains the commit ID from the source repository and runs the build instruction with that source. A build pipeline defines a series of stages in the build process: building, testing, and compiling software artifacts, delivering artifacts to OCI repositories, and optionally triggering deployments. You define the process and instructions for the build run in the build specification file.

Build phaseA stage is a single action that occurs during a pipeline run. The various build phases mentioned here include:

Manage Build Stages: Manage build stages for build and test sources.

Shipper stage: The stage where the output of the build phase is pushed to various repositories; For example, push a container image to a container repository or a deployment manifest to an artifact registry.

Invoke Deployment: Once the build stage is complete, invoke the stage of the deployment pipeline while parsing the variables exported from the Manage Build stage to the deployment pipeline stage.

WarehouseA private Git repository hosted by DevOps services. You can use these DevOps repositories to store, manage, and develop sources.

Deploy pipelinesA series of steps to deliver and deploy a set of artifacts to the target environment. By defining the stages that can run serially or in parallel, you can control the flow and logic of software release.

Deployment phaseA stage is a single action that occurs during a pipeline run. The build phases used for blue-green deployments include:

Blue-green OKE deployment or blue-green instance group deployment: The stage at which the update is deployed in the target environment.

Deployment validation: An optional stage where you can use a function to validate the deployment.

Control: Approve: Approves the control stage that will be deployed to the target production environment.

Blue-green OKE traffic transfer or blue-green instance group traffic transfer: In the final stage, production traffic is transferred to the latest deployed environment.

The build phase of a canary deployment includes:Canary OKE Deployment or Canary Instance Group Deployment: The phase at which the update is deployed in the target environment.

Deployment validation: An optional stage where you can use a function to validate the deployment.

Canary OKE Traffic Transfer or Canary Instance Group Traffic Transfer: The stage where traffic is switched to the canary environment based on the traffic diversion limit ** traffic percentage shifted.

Control: Approve: Approves the control stage that will be deployed to the target production environment.

Canary Deployment Instance Group Production or OKE Deployment Production: In the final stage, production traffic is transferred to the latest deployed environment.

DevOps artifactsA DevOps artifact is a reference or pointer to any file, binary, package, manifest, or image that makes up your application. When you create an artifact, you need to tell Oracle DevOps where the actual artifact is coming from. DevOps supports OCI container image registry and OCI artifact registry repository.

Product warehouseAn artifact repository creates a repository to group similar artifacts. After creation, you can upload artifacts to this repository. These artifacts are collections of text files, binaries, and deployment manifests that are delivered to the target deployment environment. Each artifact has a name, consisting of its path: version. A path is a string used to organize artifacts.

OCI Logs and Notification ServiceOCI Log Service stores logs related to deployments. The deployment runtime output and the final result of the deployment are displayed as log entries. The OCI Notification Service provides visibility into the up-to-date status of the deployment project and its resources, and takes any necessary action. For example, you'll be notified when an important event occurs, such as a stage in a deployment pipeline that is waiting for approval. Once you receive the notification message, you can go to the DevOps deployment pipeline and approve the stage.

Deploy the environmentThis environment is a collection of computing resources that deploy artifacts. Environments can be functions, compute virtual machines (VMs) or bare metal instances, or OKE clusters. Blue-green deployments are only available for OKE clusters and compute VMs.

The following recommendations can be used as a starting point when deploying a continuous integration and deployment (CI CD) platform using Oracle DevOps services. Your needs may differ from the architecture described here. This architecture uses an Oracle Linux OS image with an E3 or E4 elastic shape, and the minimum resource configuration is used to host the computing hosts in the OKE cluster nodes. If your application requires more memory or cores, you can choose from different shapes.

When you create a VCN, determine the number of CIDR blocks and the size of each block based on the number of resources you plan to connect to the VCN subnet. CIDR blocks within a standard private IP address space are used. Once the VCN is created, you can change, add, and remove its CIDR blocks. This architecture uses a public VCN to host Oracle Container Engine (Kubernetes). You can also use a private VCN. In this case, a NAT gateway is used so that the cluster can be accessed over the public internet.

In this architecture, the OKE cluster is deployed as one of the target environments. The worker nodes are deployed on an E3 or E4 Oracle Linux OS. This architecture uses three worker nodes in a cluster, but you can create up to 1,000 nodes on each cluster.

If you choose this schema to deploy to an instance group, a new compute instance is created in your tenant with a choice of shapes.

This schema deploys the registry as a private docker registry for internal use. The docker image is pushed to the registry and pulled from it. You can also use the registry as a public docker registry, enabling anyone with internet access and knowledge of the corresponding URL to pull images from public repositories in Oracle Cloud.

This architecture creates an artifact for the software and configuration used by instance groups, OKE, and Functions deployments. The schema creates an artifact registry repository for internal use. Software binaries, text, and deployment configurations are uploaded to and from the artifact registry repository.

Consider the following factors when deploying a continuous integration and deployment (CI CD) platform with Oracle DevOps services. DevOps supports deployment to OKEs, compute hosts, and functions. This architecture is deployed to an OKE cluster. Depending on your specific needs, consider deploying to other endpoints.

Only Linux hosts can be used to deploy instance groups to compute instances.

Artifacts deployed using DevOps need to be stored in the OCI artifact registry or container image registry.

As a best practice, group each application and all of its microservices into a single project.

A sample stack of this reference architecture of Terraform** is available in Oracle Cloud Infrastructure Explorer. You can also download it from github*** and customize it to your specific needs. Deploy using the sample stack in Oracle Cloud Infrastructure Explorer:

Click the button that corresponds to your desired deployment strategy and follow the instructions in steps 2-6:

If you're not already signed in, enter your tenant and user credentials.

Select the region where you want to deploy the stack.

Follow the on-screen prompts and instructions to create a stack.

Once the stack is created, click on the Terraform action and select the plan.

Wait for the job to complete, and review the plan.

If you need to make any changes, return to the stack details page, click Edit Stack, and make the necessary changes. Then, run the plan action again.

If you don't need to make any further changes, go back to the stack details page, click Terraform Actions, and select Apply.

Visit GitHub.

Clone or repositorate to your local computer.

Follow the instructions in the README document.

As an Oracle Premier Partner, Agilewing is redefining the way enterprises experience Oracle Cloud Services. With its streamlined account opening process and best-in-class technical support, Agilewing transforms the complex process of account opening and operation into an easy, intuitive experience. With our one-stop shop, you can quickly get up and running with the full range of Oracle Cloud services, so you can seamlessly integrate into the cloud. Agilewing's AgileCDN service, combined with OCI's cloud-based services, provides a best-in-class global content acceleration solution. A strong network of more than 2,800 global POP nodes and 7,000 direct connection points ensures efficient and stable operation no matter where your business expands to the world. Leveraging the advanced technology of Oracle Cloud, Agilewing is committed to simplifying the process of cloud service building, cloud migration, and business going global. "Our partnership model provides customers with cost-effective solutions that allow them to focus more on their core business while enjoying the high performance and security of Oracle Cloud." Oracle Cloud Service, as a promising field, opens the door to new opportunities for enterprises with its high performance, security, and globally consistent service standards. Through Agilewing's professional services, both individual users and enterprises can easily enter this new era full of technological innovation and high performance. Let Agilewing start exploring Oracle Cloud Services and open the door to a whole new world today.

Related Pages