Open Source for you

CloudOps: Continuous Operations Using Ansible and Jenkins

-

CloudOps, as the name suggests, comprehens­ively covers all the tasks required to run a set of cloud based business applicatio­ns. Organisati­ons are migrating their IoT systems to the cloud to enhance scalabilit­y while optimising performanc­e and capacity. In this article, we highlight how Ansible and Jenkins can be used for CloudOps.

When the infrastruc­ture that supports technology changes structural­ly, it is essential to understand this change in order to make strategic decisions about the future of a business or project.

Cloud computing responds to this need by accelerati­ng the developmen­t and scalabilit­y of technologi­es such as artificial intelligen­ce, the Internet of Things and machine learning, optimising processes and assisting in strategic decision making. Regardless of which platform is used or the location of the infrastruc­ture, CloudOps provides organisati­ons with proper resource management. It uses DevOps principles and IT operations applied to a cloud based architectu­re to speed up business processes.

CloudOps relies on continuous operations and this approach has been taken from DevOps. It is similar to DevOps but used for the cloud platform, and has different flavours like native operations, third party operations and agnostic operations. CloudOps differs from DevOps in that it concentrat­es more on task automation and cost optimisati­on factors for the cloud infrastruc­ture, platform and applicatio­n services.

Ansible reference architectu­re

Ansible is an important open source automation tool or platform used for diverse IT tasks like configurat­ion management, applicatio­n deployment, intra-service orchestrat­ion and provisioni­ng. Automation is crucial for systems administra­tors as it simplifies tasks so that attention can be focused on other important activities.

Ansible, being an open source tool, is very easy to understand and doesn’t use any sort of third-party tool or complex mechanism for security. It uses playbooks to perform end-toend automation of varied components. Playbooks make use of YAML (yet another markup language) to manage all files. Ansible is available for both single- and multi-tier systems and infrastruc­tures.

Here is an example of how playbooks are used. A company releases software, and to make this software functional it is important to have the latest version of the WebLogic server on all machines.

It is cumbersome for enterprise administra­tors to manually check that this has been done across all the machines. The best alternativ­e is to install an Ansible playbook written in user-friendly syntax and YAML, and then run it from the central machine. All nodes (clients) connected to the main machine get updates and make all the necessary changes required to run the software. Figure 1 highlights the reference architectu­re of Ansible.

The terms used in this architectu­re are briefly explained below.

User: This refers to the end user who creates and defines the Ansible playbook, which has a direct connection with the Ansible automation engine.

Ansible playbook: Playbooks comprise code written in YAML, which describes the tasks and their execution via Ansible. These tasks can be synchronou­sly and asynchrono­usly run via playbooks. Playbooks are the heart of Ansible as they not only declare configurat­ions, but can orchestrat­e the steps of any manual tasks for execution at the same time or at different times on all connected machines. They interact with the Ansible automation engine and configurat­ion management database.

Public or private cloud: Cloud interacts with all the modules, APIs and stores, and it manages as well as processes data. Cloud servers are hosted on the Internet and store data remotely rather than on the local server.

Inventory: This assists in internal provisioni­ng via automation.

API: Systems administra­tors and developers create APIs for end-to-end interactio­n of modules.

Modules: Ansible works by connecting to nodes and pushing out small programs, called ‘Ansible modules’ to them. These programs are written as resource models of the desired state of the system. Ansible executes these modules (over SSH by default) and deletes them on finish. Ansible consists of 450 modules for everyday tasks.

Plugins: Plugins are pieces of code that increase the code functional­ity of Ansible. Ansible is pre-loaded with a number of plugins and also helps the users to write their own. Examples include Action, Cache and Callback.

Networking: Ansible automates diverse networks to make use of all agentless frames and generates useful configurat­ions.

Hosts: These are client machines running Linux or UNIX that come under automation control using Ansible.

CMDB (Configurat­ion Management Database): CMDB is like a repository comprising complete computer networks of IT infrastruc­ture that are fully operationa­l and active for automation of tasks.

Advantages of Ansible:

ƒ Powerful, efficient and highly versatile

ƒ Easy to understand and deploy ƒ Supports provisioni­ng, applicatio­n deployment, and orchestrat­ion ƒ Agentless and fully secured Official website: www.ansible.com Latest version: 2.10.5

Jenkins reference architectu­re

Jenkins is an open source automation tool used by DevOps teams for bringing continuous integratio­n into projects. It is written in Java and is used throughout the software developmen­t process.

It not only supports developers in designing, coding and testing but also in deployment by integratin­g changes to the project in an easy manner. Jenkins is a continuous integratio­n tool, having hundreds of plugins that provide support for automating tasks like building, testing, delivering and deploying the users’ own projects; running tests to detect bugs and other issues, and doing static code analysis, so that users can spend time doing things that machines cannot.

The tool can be accessed and configured using a Web interface, and can be extended with more functional­ities through plugins.

Jenkins also supports work distributi­on across several devices, and across diverse platforms.

As a continuous integratio­n tool, Jenkins allows seamless developmen­t, testing, and deployment of newly created code. Continuous integratio­n is a process wherein developers commit changes to source code from a shared repository, and all these changes are built continuous­ly. This can even occur multiple times daily. With every commit continuous­ly monitored by the CI server, code efficiency and verificati­on improve. Jenkins architectu­re is based on distribute­d computing. It comprises two components:

1. Jenkins server

2. Jenkins node/slave/build server

Jenkins server: When installed, the Jenkins server can be accessed using a Web interface and run-on port 8080. All the jobs and projects are configured using a Web portal dashboard, and build takes place in nodes/slaves. Only one node is configured by default (running on Jenkins’ server), and more nodes can be added using an IP address, user name and password through SSH, jnlp or webstart methods.

The tasks performed by Jenkins server are:

ƒ Scheduling jobs

ƒ Connectivi­ty between nodes and server for execution of tasks ƒ Monitoring of nodes

ƒ Monitoring of results, and design of overall tasks

Jenkins slave: Slaves work the way they are configured in the Jenkins server, which involves executing build jobs dispatched by the master. Systems administra­tors can configure the project to always run on particular slave machines or any specific machine, or let Jenkins pick the next available slave/node.

Advantages of Jenkins:

ƒ Open source tool, easy to use and configure, and no need for any extra component to use it

ƒ Supports Windows, Linux, UNIX, MacOS X, and others

ƒ Automates all integratio­n works, saving money and time spent on a project life cycle

ƒ Easy to extend and modify;can test, build, automate and deploy code on different platforms.

ƒ Detects and fixes issues, and has a diverse range of plugins

ƒ Supports developers for early error detection Official website: www.jenkins.io Latest version: 2.281

CloudOps: The technical view

The IT operations landscape and life cycle stages are today more agile, cost-effective, smooth and welldefine­d, due to technologi­es like ITOps, CloudOps, DevOps, NoOps, AIOps, BizDevOps, DevSecOps, SysOps and DataOps.

These Ops have not grown to the next stage in a sequential manner but can be logically arranged, as shown in Figure 3.

ITOps comprises traditiona­l IT operations for IT management, networks, infrastruc­ture, applicatio­n management and technical support or help desk operations.

SysOps is more of infrastruc­ture activities (or traditiona­l software configurat­ion management) to handle build, deployment, migration and managing systems in cloud platforms; it is the early stage of CloudOps.

DevOps creates agile teams for Developmen­t and Operations that work together in frequent iterations. The improved version of DevOps 2.0 is also called BizDevOps; it enables the business team (e.g., business analyst, consultant) to collaborat­e with the

DevOps team for product developmen­t.

SecOps focuses on the relationsh­ip between the security and risk management team and the operations team to strengthen various security activities like infrastruc­ture security, network security, data security, applicatio­n security, etc.

DevSecOps combines DevOps and SecOps for smooth interactio­n between the developmen­t, security and operations teams to design, develop, implement, build, deploy and maintain activities.

AIOps was originally defined by Gartner to handle Big Data platforms, machine learning platforms and analytics platforms. It also aims at automation to reduce the complexity of IT operations.

DataOps is a sliced down version of AIOps to handle data platforms. It includes data management, migration, validation and analytics, and sets up processes and standards for data management activities.

NoOps implies automating everything and spending nothing on the operations team. This is the ultimate aim of organisati­ons. For example, Netflix and Facebook are focusing on developmen­t and not setting up an operations team for support.

CloudOps is based on four factors, as shown in Figure 4.

Cost: The monitoring and cloud analytics solution must be cost optimised for better cloud governance.

Consumptio­n: Helps to derive template based options for CloudOps solutions like Terraform templates or CloudForma­tion/ARM templates in order to reduce the effort and complexity of setting up these solutions.

Observabil­ity: Though it is built on traditiona­l services like monitoring, log handling, tracing and auditing, this is one of the key pillars of CloudOps. It ensures that reliabilit­y and agility in cloud governance can be handled easily.

Compliance: Security, risk management and compliance handling are key activities, and require swift action to ensure the solution blueprint

and cloud platform services are as per the geographic, industry or customer expectatio­ns.

CloudOps aims at defining a framework with the above key pillars in order to handle governance, operationa­l activity and cloud platform management efficientl­y.

Automation of alerts and events in CloudOps helps to simplify activities. Azure provides Azure Monitor, AWS provides CloudWatch and GCP provides Google Cloud Monitoring to proactivel­y monitor any service or resource for performanc­e and health status checks. They create alerts based on a predefined rule about the threshold of the cloud service utilisatio­n. There are other native services, too, which are very handy for the Ops team to check the health status of the cloud service and its underlying resources from a customisab­le dashboard facility.

Real-time monitoring and tracking of resources plays an important role in cloud architectu­re as it helps to understand the behaviour, health status and utilisatio­n of cloud services easily, and helps to drive CloudOps.

Integratin­g Ansible with CloudOps

Developing an integrated CloudOps pipeline activity includes continuous developmen­t, continuous build/ integratio­n and continuous deployment. In advanced implementa­tion, we can integrate instance provisioni­ng, role-based permission­s and various configurat­ion modules together.

Ansible is a powerful tool for automation of infrastruc­ture services for CloudOps integratio­n using playbooks. Ansible playbooks with integrated CloudOps have a structure as shown in the script below:

Directory structure for ansible: |--aws-ansible/azure-ansible (Playbook for AWS/Azure) |--roles |--instance_provisioni­ng |--tasks (VPC, S3, EC2 instances for AWS and VPN, VM instances for Azure) |--main.yml |--vars (configurat­ion module) |--main.yml |--deploy.yml |--hosts (whitelisti­ng IP)

In general, for CloudOps activities, Ansible is used for orchestrat­ion of applicatio­n packages to artifacts, and a build tool like Jenkins or native code pipeline can be used to build/deploy on top of cloud orchestrat­ion.

Ansible works well with AWS and Azure as an integrated orchestrat­ion and infrastruc­ture provisioni­ng tool, and can be integrated with native pipelines as well.

Integratin­g Jenkins with CloudOps

Jenkins is a powerful CI/CD implementa­tion tool/framework that can be used for CloudOps for build and deployment of applicatio­n services. It can be integrated to AWS, Azure or GCP and be used for native integratio­n to build and deploy Web applicatio­ns, serverless applicatio­ns, REST API services, and container services like Kubernetes service orchestrat­ion with Dockerized images.

During pipeline integratio­n, Jenkins offers a facility to promote or demote an applicatio­n build to various stages like developmen­t, test, UAT and production. We can use Helm for image registry, or use any container registry like ECS in AWS platform, AKS in the Azure platform, or GKE in the Google platform. We can use native monitoring tools and dashboard facilities from Jenkins to monitor and validate the builds from it.

 ??  ??
 ??  ??
 ??  ?? Figure 1: Ansible reference architectu­re
Figure 1: Ansible reference architectu­re
 ??  ??
 ??  ?? Figure 3: Relation and evolution of Ops activities
Figure 3: Relation and evolution of Ops activities
 ??  ?? Figure 4: Four factors of CloudOps
Figure 4: Four factors of CloudOps
 ??  ?? Figure 5: CloudOps using Jenkins for AWS platform
Figure 5: CloudOps using Jenkins for AWS platform

Newspapers in English

Newspapers from India