The Opsera integration with Azure is broken into two components: creation, management and execution of tasks (Opsera Tasks) for managing the clusters and then direct pipeline steps (Opsera Pipelines) to publish containers. The two aspects are necessary to work together in order to complete the functionality. Listed below are details on how to perform all of the tasks in Opsera.
Prerequisites: There must be a registered Azure tool with proper Connection credentials verified to create an Azure cluster template in Tasks. The user must then run the task in order for it to be accessed in the Azure pipeline step.
Azure AKS Cluster Tasks Creation
There are 2 steps to Azure Cluster creation. Template creation is a prerequisite to creating the cluster. Once the template has been created, you must select Run Task for the first cluster to be created.
To create an Azure AKS Cluster template, navigate to Tasks.
Select “Create Azure AKS Cluster” from the Type drop down. Once this has been selected, other drop down fields will become available to select to continue creation process.
Azure Tool - Select an established Azure tool from the Tool Registry.
Azure Credential - This field is fetched from Applications tab of the selected Azure tool.
Azure Region - The region selected is the location of the data center where the resources will operate. In selecting a region, consider that the region is close in proximity to customer (if necessary) and that it will meet all necessary legal or compliance needs.
Machine Type - Select the name of the desired virtual machine size.
Azure Kubernetes Version - Select the Kubernetes version. The default version will display for the region selected.
Cluster Name - Choose a unique name for the Azure cluster. Reference this name in the Azure pipeline step.
Disk Size - Select the disk size for template. Disk size is in GB and ranges from 32-1000
Minimum Nodes - Choose a minimum number of nodes.
Maximum Nodes - Choose a maximum number of nodes.
VPC CIDR Block - Select an existing VPC CIDR Block from the Azure portal.
Subnet CIDR Block - Select an existing Subnet CIDR Block from the Azure portal.
Once the user has filled in all the required information the user will be redirected to the task’s screen where the user can view the summary of the information entered and there is an option to run the task.
Tasks run in a similar fashion to the pipelines where they auto update based on the status of the orchestration once the run has been triggered. The logs can be viewed segregated by run count in the Activity Logs screen. Click on any row to view more log info, including detailed messages about failure or success.
Pipeline Setup
Azure Service Deployment Flow:
Build step → Azure ACR Push → Azure AKS Deploy
Azure ACR Push Step Configuration:
Once the initial Step Setup is configured with the Azure ACR Push tool, set the following values:
Jenkins Tool - Select a configured Jenkins tool from Tool Registry.
Jenkins Job - Select the Azure Docker Push job that was created in the selected Jenkins tool.
Build Step - Select the name of the preceding build step.
Azure Tool - Select the configured Azure Account Legacy tool from Tool Registry.
Resource - Value found in the Azure portal.
Azure Registry - Select the container registry to push the images into.
Use Existing Repository - Toggle on to view and select an existing repository in the Azure Registry to push the images into. Toggle off to create a new repository where the images will be pushed. Then enter a unique name for the new repository.
Repository Name - Select the name of the repository in the container to push to.
Select Save and proceed to setting up the next pipeline steps.
Azure AKS Deploy Step Configuration:
Once the user has successfully created the cluster template in tasks then successfully ran it to create the cluster in Azure, they can then use the Azure AKS Deploy pipeline step to deploy docker images to the Azure Cluster. In order to run this step successfully, there needs to be a build step and an Azure ACR Push step to be successfully configured in the pipeline.
Once the initial Step Setup is configured with the Azure AKS Deploy tool, set the following values:
Azure Tool - Select the configured Azure tool that was used to create the Azure cluster.
Azure Credential - Drop down values will include the selected tool’s configured applications.
Cluster Name - Drop down includes successfully run clusters created in Tasks.
Generate Dynamic Service Name - When switch is enabled, a unique service name for each pipeline run using the Dynamic Name Prefix given and the run count will be generated (for example: PrefixName -1, PrefixName-2).
Service Name - Azure Service names must also be unique hence we have the ability to generate unique service names for every run based on the run count which can be enabled via the specified toggle in the pipeline step.
Resource Group - If the Cluster Name selected was created via Opsera then the user should let the resource group option be disabled. However, If the selected cluster was not created via opsera then the user has to enable the resource group toggle and select the correct resource group with to the selected cluster. The drop down will contain generated names consisting of the above cluster name and “resource”.
Host URL - Host URL is unique to user.
Service Port - This is the location where service will be deployed.
Artifact Step - Select the corresponding Azure ACR push step.
After all the details have been configured the step will run as a general pipeline step and the logs can be viewed from the Summary/Activity Logs table