IT4200 - The devops lifecycle

Modern Devops

Introduction

  • What is DevOps?
    • Do some google fu to see what definitions you come up withk

Topics Covered

  1. What is DevOps?
  2. Introduction to cloud computing
  3. Understanding modern cloud-native applications
  4. Modern DevOps vs. traditional DevOps
  5. The need for containers
  6. Container architecture
  7. Containers and modern DevOps practices
  8. Migrating to containers from virtual machines

Chapter Goals

By the end of this chapter, you should understand:

  • What DevOps is and its role in modern IT
  • The impact of cloud computing on IT services
  • Characteristics of modern cloud-native applications
  • The necessity and benefits of containers
  • Container architecture and operation
  • Contribution of containers to modern DevOps practices
  • Steps for migrating from VMs to containers

What is DevOps?

Traditional Development and Operations

  • Separate teams for development and operations
  • Communication gaps and slow release cycles

DevOps Overview

  • Bridges the gap between development and operations
  • Promotes collaboration, shared responsibilities, and continuous feedback
  • Focuses on automation in the software development life cycle

DevOps Principles

  • Collaboration across development and operations teams
  • Continuous integration and continuous delivery (CI/CD)
  • Monitoring and application management in production
  • Single team ownership of the entire SDLC

DevOps Team Structure

  • Combined team for development, deployment, and monitoring
  • Developers, operations engineers, and QA work together
  • Focus on business requirements and field issues

DevOps Workflow

Automation and Tools

  • Heavy reliance on automation
  • Focus on product quality and speedy delivery
  • Importance of people, processes, and tools

Continuous Integration (CI)

  • Frequent code changes merging into a shared repository
  • Automated builds and tests
  • Early bug detection and real-time feedback

Continuous Delivery (CD)

  • Shipping tested software to production
  • Automated deployment to test and production environments
  • Latest tested artifacts always ready to deploy

Infrastructure as Code (IaC)

  • Managing infrastructure with code and configuration files
  • Building infrastructure through API calls and templates
  • Storing infrastructure code in version control systems

Configuration as Code (CaC)

  • Managing configuration settings with code
  • Programmatic and reproducible configuration management
  • Goes hand in hand with IaC for scalable infrastructure

Monitoring and Logging

  • Capturing and analyzing software behavior and performance data
  • Insights into health, availability, and performance
  • Essential for identifying issues and making informed decisions

Communication and Collaboration

  • Promotes teamwork and knowledge sharing
  • Streamlined workflows across development and operations
  • Use of ticketing, Agile tools, wikis, and IM tools for communication

Introduction to Cloud Computing

Traditional IT Infrastructure

  • In-house data centers with physical servers
  • High capital expenditure and maintenance costs
  • Challenges in scaling infrastructure quickly

Emergence of Cloud Computing

  • Provided by giants like Amazon, Microsoft, and Google
  • Delivers on-demand computing resources over the internet
  • CSPs own and manage underlying infrastructure

Benefits of Cloud Computing

  • Scalability: Easily add and manage resources
  • Cost Savings: Pay-as-you-go model reduces CapEx
  • Flexibility: Variety of services beyond servers
  • Reliability: High availability and built-in redundancy
  • Security: Enhanced security measures by CSPs

Types of Cloud Services

Infrastructure-as-a-Service (IaaS)

  • Provides virtualized computing resources
  • Users control OSs, applications, and configurations
  • Find me an example?

Platform-as-a-Service (PaaS)

  • Platform and environment for application development
  • Abstracts infrastructure management complexities
  • Find me an example?

Software-as-a-Service (SaaS)

  • Pre-built applications for user consumption
  • Managed by CSPs, accessible through web or thin client
  • Find me an example?

Modern Cloud-Native Applications

  • New buzzword in the industry
  • Built to leverage cloud computing benefits
  • utilizes microservice architecture and containers
  • utilize devops practices
  • dynamic orchestration

Importance of Containers

  • Solve critical problem: reliable, distributed software with scalability
  • Enable microservices architecture
  • "Package once, deploy anywhere" concept
  • Integral to cloud-native applications

Container Benefits

  • Application isolation
  • Efficient resource management
  • Portability across environments
  • Simplifies software deployment

Containers: A Shipping Analogy

  • Standard method for transporting goods
  • Provides isolation and ease of handling
  • Application to software: isolation and portability

Software Portability Challenges

  • Different environments: development, testing, production
  • Shared OS issues: resource conflicts, dependency management
  • Containers solve these by providing isolation

Managing Multiple Applications

  • Dependencies and versions conflict
  • Physical servers become unmanageable
  • Solution: Virtual machines and containers

Virtual Machines

  • Emulate an OS using hypervisor
  • Heavy resource usage due to guest OS layer
  • Examples: VMware, Oracle VirtualBox

Advantages of Containers Over Virtual Machines

  • No heavy guest OS layer
  • Isolate application runtime and dependencies
  • Efficient resource utilization

Container Runtimes

  • Docker: most popular
  • Alternatives: Rkt, Containerd
  • Based on Linux kernel cgroups

"It Works on My Machine" Syndrome

  • Build once, run anywhere concept
  • Standardized setup reduces admin overhead
  • Developers manage application responsibilities

Importance of Testing Containerized Applications

  • Ensures functionality, performance, and compatibility
  • Identifies and resolves issues early in the development cycle
  • Leads to more robust and reliable applications

Deployment and Rollout

Deploying Containerized Applications

  • Deploy container images to target environment
  • Make application available for use
  • Utilize automated runbooks and CI/CD pipelines

Rollout Process

  1. Test containers thoroughly
  2. Deploy to production
  3. Monitor and learn from production environment
  4. Make necessary adjustments

Techniques for Rollout

  • Define automated runbook
  • Develop CI/CD pipeline
  • Perform A/B testing to identify potential issues

Assessing Applications for Containerization

Types of Application Workloads

  • Stateless: APIs, functions, etc.
  • Stateful: Databases, applications requiring persistent storage

Stateless vs. Stateful Workloads

  • Stateless workloads are easier to containerize
  • Stateful workloads require careful consideration of storage dependencies

Infrastructure Considerations

  • Assess infrastructure for hosting applications
  • Avoid heterogeneous environments if running on Kubernetes

Suitable Use Cases for Containerization

Microservices Architecture

  • Independent services packaged as separate containers
  • Easier development, deployment, scaling, and management

Web Applications

  • Frontend applications, backend APIs, web services
  • Consistent runtime environment across different stages

CI/CD Tools

  • Containerize CI/CD tools like Jenkins, GitLab CI/CD, CircleCI
  • Consistent build, test, and deployment pipelines

Development and Testing Environments

  • Isolated and reproducible environments for consistent development and testing

IoT Applications

  • Lightweight and portable runtime environments for IoT scenarios

Machine Learning and Data Analytics

  • Seamless deployment and scaling of data-intensive applications

Breaking Applications into Smaller Pieces

Benefits of Independent Application Parts

  • Frequent releases with less impact on other parts
  • Independent scaling of application parts
  • Isolated issues do not compromise the entire system

Avoiding Over-Fragmentation

  • Logical components for business needs
  • Avoid excessive splitting of application into tiny components

ROI from Containerization

  • Lift and shift from VMs to containers might not yield benefits
  • Rearchitect applications to fit container landscape

Virtual Machines and Containers

Coexistence of VMs and Containers

  • Virtual machines will continue to exist
  • Containers often run on virtual machines in the cloud

Integration with Cloud Infrastructure

  • Containers as part of standard cloud setup
  • Container runtime installed on VMs

Role of Orchestrators

  • Kubernetes decides where to run containers
  • Considers factors like resource availability