A Stockphoto - stock.adobe.com

Tip

How to implement CI/CD in network automation

CI/CD processes help deploy code changes to networks. Integrating a CI/CD pipeline into automation makes networks more reliable, reducing configuration errors and downtime.

The rise of automation doesn't mean replacing the network engineering workforce. Instead, automation presents enterprises an opportunity to thrive in a competitive digital society by enabling network teams to shift focus toward more demanding tasks.

Without the necessary skills in place, though, automation poses several challenges. Successful automation adoption requires skilled teams committed to tasks that provide complex workflows for improved network efficiency. Implementing continuous integration/continuous delivery (CI/CD) is crucial for a constantly changing network and can ease the automation transition.

CI/CD pipelines enable NetDevOps teams to deploy changes to network infrastructures in a fast, reliable way. By integrating a CI/CD pipeline into network automation, network teams can reduce errors and network downtime, as well as focus on more complex network tasks.

CI/CD components

CI/CD is a set of processes developers and network engineers use to deliver frequent and reliable code changes in software development and NetDevOps. Depending on how many components they use, engineers use a CI/CD pipeline to write, test and deploy code. In networking, it's a set of tools network engineers put together to automate tasks.

Components of a CI/CD pipeline usually include the following:

  • Source code repository. This component serves as the entry point for the CI/CD process. The process begins where source code is stored. Version control systems (VCSes), such as Git, play a crucial role in the repository.
  • Build automation. This component for deployment compiles the source code into binary.
  • Automation testing. This is where code testing happens to ensure quality, such as unit and integration tests.
  • Deployment automation. In this component, the artifact is automatically deployed to production.
  • Monitoring. Deployment isn't the only process required in the CI/CD pipeline. Monitoring tools are essential for tracking application performance and promptly identifying issues.

CI/CD benefits and challenges

Below is a breakdown of the common benefits and challenges associated with CI/CD.

Benefits

CI/CD offers tremendous benefits when automating network configurations. Manual tasks can lead to errors and network downtime. Implementing CI/CD in automation helps teams become more nimble with automated tasks and tools, enhances network reliability and prevents network downtime.

Network infrastructure deployment and management take a lot of time and manual effort. CI/CD pipelines can reduce both with a variety of automation tools. For example, network professionals can identify configuration errors and misconfigurations before deployment. CI/CD further increases efficiency and reliability with automated testing, such as security checks. This ensures that new configurations comply with regulatory standards and don't introduce vulnerabilities.

Reduced manual effort also helps with scalability. Thanks to CI/CD, scaling infrastructure has never been easier. Networks can adapt to changing demands without manual intervention. By using automation in these tasks, engineers can save time and focus on other projects.

Interdepartmental and interteam coordination and collaboration are other CI/CD benefits. Thanks to the DevOps philosophy and culture of sharing, CI/CD fosters collaboration among distributed teams. Multiple team members can work collaboratively on network configurations and merge changes seamlessly without conflict.

Challenges

CI/CD for network configurations is not without challenges. Addressing these common challenges involves several key considerations.

Learning to manage complex topologies is essential. Engineers must understand their network architecture to automate it and use CI/CD tools that can handle deployment across various network segments and layers. Network management tools can help effectively manage complex network topologies. Network mapping tools, such as SolarWinds Network Topology Mapper or Nagios, can help with network management. It is also vital to develop network models that enhance network topologies.

As stated above, a benefit of a CI/CD pipeline is automated security testing. However, enterprises should ensure they stay compliant with security policies. Compliance is crucial, and security checks should be a regular part of the CI/CD pipeline. This ensures new configurations comply with industry standards, such as Payment Card Industry Data Security Standard v4.0 and HIPAA.

Tools and VCS integration

Myriad network automation tools are available. Network teams can't use them all in a CI/CD pipeline, so they should define organizational needs and outcomes before using any tools.

Organizations must select appropriate CI/CD tools that integrate properly with automation tools. These tools should support network change lifecycles. Jenkins, GitLab and CircleCI are well known in the industry for the comprehensive features they provide for network automation and change management.

VCSes are helpful to integrate into CI/CD pipelines. A VCS enables management and codebase tracking for network teams. It also enables automated build, test and deployment processes triggered by code changes. Git remains the most used VCS by developers and network teams.

Network teams should consider implementing automated testing frameworks to validate network configurations. Automated testing frameworks ensure that configurations are error-free and ready for deployment. Use frameworks such as Cypress, Selenium and TestCafe for automated testing. When it comes to network automation, pyATS is useful thanks to its multiple parsers and features.

Staging environments to mirror production networks ensures teams can test any changes in a scenario similar to a real production environment. By selecting and integrating all the components properly, network teams and developers can create a CI/CD pipeline that provides efficiency, reliability and security for network infrastructure deployments.

How a CI/CD pipeline works in a real-world scenario.
Figure 1. How a CI/CD pipeline works in a real-world scenario

The CI/CD pipeline in action

Figure 1 explains how a CI/CD pipeline works in a real-world scenario. This example uses GitHub as the source code repository:

  1. Network engineers pull the latest update from GitHub.
  2. Network engineers change the code on their local machine through the text or code editor, such as Visual Studio Code. The engineer then performs unit tests.
  3. Once the changes are complete, the network engineer pushes the committed changes from the local repository to a feature branch in the remote repository. The main branch refers to the repository.
  4. GitHub offers rich features, including actions and built-in CI. GitHub's CI server can detect modifications and start a job.
  5. To validate the code or configuration, run defined tests in a testing lab environment. GitHub's CI enables engineers to use tools such as Cisco Modeling Labs, EVE-NG, or other virtual or physical lab networks to achieve this task.
  6. GitHub's CI server can run a set of defined tests against the code or configuration in the remote repository to validate the new change. Network engineers can use myriad tools to detect the changes.
  7. Engineers can configure a webhook to send notifications to report back test results. It also notifies DevOps or NetDevOps teams of different events in the pipeline, so a team can know why a test has passed or failed.

Verlaine Muhungu is a self-taught tech enthusiast, DevNet advocate and aspiring Cisco Press author, focused on network automation, penetration testing and secure coding practices. He was recognized as a Cisco top talent in sub-Saharan Africa during the 2016 NetRiders IT Skills Competition.

Dig Deeper on Network strategy and planning