Unit 5 - Notes

INT331

Unit 5: DevOps Trends

1. DevOps Market Trends

The DevOps landscape is continuously evolving, driven by the need for speed, security, and efficiency in software delivery. Below are the current and emerging trends shaping the market.

Key Trends

  • DevSecOps (Shift-Left Security): Security is no longer an afterthought added at the end of the lifecycle. Security checks are integrated early into the pipeline (Shift-Left), ensuring code is secure before it is deployed.
  • AIOps (Artificial Intelligence for IT Operations): The use of AI and Machine Learning (ML) to analyze big data from monitoring tools to predict outages, automate root cause analysis, and optimize resource allocation.
  • Serverless Computing: Moving away from managing servers entirely to event-driven architectures (e.g., AWS Lambda). This reduces operational overhead and costs.
  • GitOps: Using Git repositories as the single source of truth for infrastructure and application code. Changes to infrastructure are made via pull requests.
  • Microservices Architecture: A shift from monolithic applications to loosely coupled, independently deployable services, requiring robust orchestration tools like Kubernetes.
  • No-Code/Low-Code DevOps: Simplifying CI/CD setup so that developers with limited operational knowledge can configure pipelines via visual interfaces.

2. The DevOps Ecosystem

The DevOps ecosystem refers to the convergence of People, Processes, and Technology working together to enable continuous delivery. It is a cyclical system rather than a linear one.

Components of the Ecosystem

  1. Planning: Agile project management (Jira, Trello).
  2. Coding: Version control and code merging (Git).
  3. Building: Compiling code and managing dependencies (Maven, Gradle).
  4. Testing: Automated quality assurance (Selenium, JUnit).
  5. Release: Managing release versions and artifacts.
  6. Deploying: Push to production/staging environments (Jenkins, ArgoCD).
  7. Operating: Infrastructure management (Ansible, Puppet).
  8. Monitoring: Feedback loops and performance tracking (Nagios, Prometheus).

3. DevOps Delivery Pipeline

The Delivery Pipeline is the core implementation of DevOps, automating the movement of software from version control to the end-users. It consists of three major phases:

A. Continuous Integration (CI)

Developers frequently commit code to a shared repository.

  • Trigger: Code commit.
  • Actions: Automated compilation, dependency resolution, and unit testing.
  • Goal: Detect integration errors as quickly as possible.

B. Continuous Delivery (CD)

The build is automatically deployed to a staging environment for rigorous testing (integration, load, and UAT).

  • Trigger: Successful CI build.
  • Actions: Deployment to staging, automated acceptance tests.
  • Goal: Ensure the software is always in a release-ready state. Manual approval is usually required for production.

C. Continuous Deployment

An extension of Continuous Delivery where the release to production is fully automated.

  • Trigger: Successful tests in staging.
  • Actions: Deployment to production without human intervention.
  • Goal: Minimize lead time from code commit to customer availability.

4. Role of a DevOps Engineer

A DevOps Engineer is not a specific job title defined by a rigid set of tasks, but rather a bridge-builder between development and operations teams.

Core Responsibilities

  • Pipeline Management: Designing, building, and maintaining CI/CD pipelines.
  • Automation: Writing scripts to automate repetitive tasks (infrastructure provisioning, backups).
  • Infrastructure Management: Managing cloud resources and servers.
  • Monitoring & Logging: Ensuring system availability and setting up alerts for failures.
  • Collaboration: Facilitating communication between developers (who want change) and operations (who want stability).
  • Security Integration: Implementing security best practices within the infrastructure and pipeline.

5. DevOps Engineer Skills

To succeed, a DevOps engineer requires a "T-shaped" skill set: deep knowledge in one area and broad knowledge across others.

Hard Skills (Technical)

  • Linux Fundamentals: Proficiency in shell scripting (Bash), file systems, and server management.
  • Coding/Scripting: Knowledge of Python, Go, or Ruby for automation scripts.
  • Cloud Computing: Expertise in AWS, Azure, or Google Cloud Platform (GCP).
  • Infrastructure as Code (IaC): Terraform, CloudFormation.
  • Containerization: Docker and Kubernetes.
  • Network Protocols: HTTP, HTTPS, DNS, TCP/IP, Firewalls.

Soft Skills

  • Communication: explaining technical constraints to non-technical stakeholders.
  • Problem-Solving: Rapid root-cause analysis during outages.
  • Adaptability: Willingness to learn new tools as the landscape changes rapidly.

6. DevOps Tools

The DevOps toolchain consists of specific tools designed to handle different stages of the lifecycle.

1. Git (Source Code Management)

A distributed version control system used to track changes in source code.

  • Type: Distributed Version Control System (DVCS).
  • Key Features: Branching, merging, pull requests, history tracking.
  • Usage:
    BASH
        git init          # Initialize repository
        git add .         # Stage files
        git commit -m "msg" # Commit changes
        git push origin main # Push to remote
        

2. Maven (Build Automation)

A build automation tool primarily used for Java projects.

  • Concept: Project Object Model (POM).
  • Configuration: pom.xml file manages dependencies and build lifecycle.
  • Lifecycle Phases:
    1. validate: Check if the project is correct.
    2. compile: Compile source code.
    3. test: Run unit tests.
    4. package: Create JAR/WAR files.
    5. install: Install package to local repository.

3. Selenium (Automated Testing)

An open-source framework for validating web applications across different browsers and platforms.

  • Key Component: WebDriver (interacts directly with the browser).
  • Usage in DevOps: Integrated into Jenkins pipelines to run functional tests (UI testing) automatically after a build.
  • Supports: Java, Python, C#, Ruby.

4. Jenkins (CI/CD)

An open-source automation server that acts as the orchestrator of the pipeline.

  • Architecture: Master-Slave (Controller-Agent). The Master schedules builds; Agents execute them.
  • Key Feature: Plugins. Jenkins has thousands of plugins to integrate with Git, Maven, Docker, AWS, etc.
  • Pipelines: Defined using a Jenkinsfile (Groovy syntax).
    GROOVY
        pipeline {
            agent any
            stages {
                stage('Build') { steps { sh 'mvn clean package' } }
                stage('Test') { steps { sh 'mvn test' } }
            }
        }
        

5. Docker (Containerization)

A platform for developing, shipping, and running applications in containers.

  • Container vs. VM: Containers share the host OS kernel and are lightweight; VMs need a full Guest OS and are heavy.
  • Key Components:
    • Dockerfile: A text file containing instructions to build an image.
    • Image: Read-only template.
    • Container: Runnable instance of an image.
  • Commands:
    BASH
        docker build -t myapp .  # Create image
        docker run -d -p 80:80 myapp # Run container
        

6. Kubernetes (Container Orchestration)

An open-source system for automating deployment, scaling, and management of containerized applications (often referred to as K8s).

  • Why use it? Docker manages single containers; Kubernetes manages clusters of containers across multiple hosts.
  • Architecture:
    • Control Plane (Master): API Server, Scheduler, Controller Manager, etcd.
    • Worker Nodes: Kubelet, Kube-proxy, Pods.
  • Key Concepts:
    • Pod: The smallest deployable unit (one or more containers).
    • Service: Network abstraction to expose a set of Pods.
    • Deployment: Manages updates and scaling of Pods.

7. Configuration Management Tools (Ansible vs. Puppet)

These tools maintain servers in a desired state (Infrastructure as Code).

Puppet

  • Architecture: Master-Slave (Agent-based).
  • Model: Pull Model. Agents poll the master periodically (every 30 mins) for configuration updates.
  • Language: Puppet Domain Specific Language (DSL) based on Ruby.
  • Pros: Strong compliance reporting, good for large stable enterprises.

Ansible

  • Architecture: Client-only (Agentless).
  • Model: Push Model. The control node pushes configurations to managed nodes via SSH.
  • Language: YAML (Playbooks).
  • Pros: Easy to learn, no agent installation required, lightweight.
  • Example Playbook:
    YAML
        - name: Install Nginx
          hosts: webservers
          tasks:
            - name: Ensure nginx is at the latest version
              apt: name=nginx state=latest
        

8. Nagios (Monitoring)

One of the oldest and most established monitoring systems.

  • Function: Monitors systems, networks, and infrastructure. Alerting via email/SMS when services go critical or recover.
  • Architecture: Server-Client. Uses NRPE (Nagios Remote Plugin Executor) agents on remote servers to gather metrics.
  • Checks: CPU usage, Disk usage, Memory, POP3, HTTP status, etc.
  • Status Codes: OK (0), WARNING (1), CRITICAL (2), UNKNOWN (3).