Skip to main content Skip to search
Start Your Free Trial
Blog

Continuous Delivery Using A10 Lightning Application Delivery Service (ADS)

Continuous delivery is a practice used in the software industry to automate and improve the process of software delivery. It is all about adopting practices to release high-quality software fast through automation of the build, test and deployment processes. This post describes features in A10 Lightning Application Delivery Service (ADS) to facilitate continuous delivery, and the specific ways our DevOps team achieves continuous delivery by using Lightning ADS internally.

What is Blue-Green Deployment?

An important technique for reducing risks in case of continuous deployments is known as blue-green deployment. Typically the current live production environment is termed as “blue.” The technique consists of bringing up a parallel “green” environment with the new version of the software so the switch from old to new (or blue to green) instantaneously without a downtime.

A10 LIghtning ADS provide a mechanism to reduce the risk further by allowing you to split the live traffic between blue and green deployments. You can test new deployments of your application by sending a small fraction of your traffic to the green environment and monitoring the health analytics. If you see any issue, simply roll back (just by disabling the split condition) so that all traffic flows to the blue environment. Once the issue is fixed, you can deploy the new green instance and resume the split test. As confidence in the green instance grows, you can increase the amount of traffic flowing to the new environment. Once 100 percent of traffic flows to green and it’s declared as production, you can safely decommission and archive the legacy environment.

While splitting the traffic, A10 Lightning ADS preserves the user experience by sticking the traffic to either blue or green.

Continuous Delivery at A10 with Blue-Green Deployments

Below are the steps our team uses to automate blue-green deployment internally, including the some screen captures and sample code.

Step 1. In the A10 Lightning ADS settings page click on the “Blue/Green” tab to configure blue-green service.

click on the “Blue/Green” tab

Step 2. Select the “Blue” service from the drop list. A green service will be cloned by Lightning ADS for that service.

Select the "Blue" service from the drop list

Step 3. Supply name for the green service and you can spilt traffic based on certain rules as shown below:

Supply name for the green service

For illustration lets spilt traffic based on condition:

lets spilt traffic based on condition

Here, I am sending traffic landing on /web/index.html which is my new resource URL to the green service.

Step 4. In next section, you need to provide server IP of the green server OR pick server from an existing IP address.

a) Adding green server IP manually

Adding green server IP manually

b) Picking green server IP from existing slot.

Picking green server IP from existing slot

Step 5. Once the green service has been created, you can start your benchmarking.

In this, I am using curl call to fire up couple of hundred requests to the green server.

for i in {1..100}; do echo "Request Number:" $i ; curl ‘https:// www. example. com/web/index.html' -o /dev/null -w "%{http_code} n" -s ; done
Request Number: 1
200
Request Number: 2
200
Request Number: 3
200

As you see in above sample, my calls are succeeding with a response status code of 200 – OK.

Creating the green service, we are ensuring current traffic is not disrupted and new deployment works as expected.

Step 6. Now, confirm the traffic analytics through the Lightning ADS Analytics dashboard.

Click on Analytics –> Blue-Green

In this section, you will notice stats like average CPU utilization

average CPU utilization

and service errors.

service errors

In this case application metrics looks good. We have successfully tested the green service.

Working Faster and Smarter with the A10 Lightning API

To speed up our work, our DevOps team frequently automates the steps I described above by using the A10 Lightning API. Here are some of the powerful API calls to automate blue-green deployment:

LIST ALL TRAFFICSPLITS:

METHOD: GET

HOST: https:// api. a10networks. com

URL Path: /api/v2/applications/{app}/hosts/{host}/trafficsplits

Note: UserRole: ApplicationAdmin, ApplicationUser
Parameters to supply :
Response

Content Type: application/json X-Account(Parameter Type: header) : X-User (Parameter Type: header) : application (Parameter Type: path): host(Parameter Type: path) : trafficsplit(Parameter Type: path):

 

CREATE A NEW TRAFFICSPLIT:

METHOD: POST

HOST: https:// api. a10networks. com
URL Path: /api/v2/applications/{application}/hosts/{host}/trafficsplits

Parameters to supply :
Response

Content Type: application/json
X-Account :
X-User :
application : [required]
host: [required]
body : {
"name": "string",
"description": "string",
"state": "string",
"splitSlices": [
{
"service": "string",
"percentage": "integer",
"condition": "string",
"code": "string"
}
],
"id": "string"
}

 

UPDATE A TRAFFICSPLIT:

METHOD: PUT

HOST: https:// api. a10networks. com

URL Path: /api/v2/applications/{application}/hosts/{host}/trafficsplits/{trafficsplit}

Parameters to supply :
Response

Content Type: application/json
X-Account :
X-User :
application : [required]
host: [required]
trafficsplit : [required]
body :
{
"name": "string",
"description": "string",
"state": "string",
"splitSlices": [
{
"service": "string",
"percentage": "integer",
"condition": "string",
"code": "string"
}
],
"id": "string"
}

 

As cloud service availability is critical to A10 and our customers, we continue to find automated ways to maintain availability while rolling out new features. Blue-green deployment is an important step in our deployment process. It is designed with the expectation that application/infrastructure failure can happen and will happen and enables us to react quickly to negative events. Having the flexibility to use a graphical interface or API calls provides even stronger control over an improved continuous delivery process.