https://github.com/nomadicmehul/devops-101
https://github.com/nomadicmehul/devops-101
cloud cloudcomputing devops jenkins linux
Last synced: 10 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/nomadicmehul/devops-101
- Owner: nomadicmehul
- License: mit
- Created: 2023-10-01T11:10:04.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-10-09T03:02:16.000Z (over 2 years ago)
- Last Synced: 2025-04-09T21:56:29.708Z (10 months ago)
- Topics: cloud, cloudcomputing, devops, jenkins, linux
- Homepage:
- Size: 37.1 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## 1. Introduction to DevOps
**What Is DevOps:**
DevOps is a set of practices that combines software development (Dev) and IT operations (Ops) to shorten the system development life cycle and provide continuous delivery with high software quality. It fosters collaboration and automation across the entire software development and deployment process.
**History of DevOps:**
DevOps emerged as a response to the challenges of traditional software development methodologies like the Waterfall model. In traditional models, development and operations teams worked in silos, leading to inefficiencies and slower releases.
**DevOps Definition:**
DevOps is often defined as a culture, a set of practices, or a combination of both. It emphasizes the following core principles:
- **Collaboration:** Encouraging collaboration between development and operations teams.
- **Automation:** Automating manual processes wherever possible.
- **Measurement:** Using metrics to track progress and make data-driven decisions.
- **Sharing:** Sharing knowledge and responsibilities across teams.
**DevOps and Software Development Life Cycle:**
DevOps principles are applied throughout the software development life cycle (SDLC). This means DevOps practices are integrated from planning and coding to testing, deployment, and monitoring.
**Waterfall Model:**
The Waterfall model is a traditional, linear approach to software development where each phase must be completed before the next one begins. It lacks flexibility and doesn't easily accommodate changes during development.
**Agile Model:**
The Agile model is an iterative and flexible approach to software development. It allows for changes and collaboration throughout the development process. Agile methodologies include Scrum and Kanban.
**Continuous Integration & Deployment (Jenkins):**
Continuous Integration (CI) is a DevOps practice that involves frequently integrating code changes into a shared repository. Jenkins, a popular CI tool, automates building, testing, and deploying applications, ensuring that code changes do not introduce errors.
**Containers and Virtual Development (Docker, Vagrant):**
Containers like Docker provide a consistent and isolated environment for applications to run. They encapsulate an application and its dependencies. Vagrant is used for creating and managing virtualized development environments, which can be especially useful when testing applications.
**Configuration Management Tools (Ansible, Puppet, Chef):**
Configuration management tools automate the provisioning and management of infrastructure, ensuring that it's consistent and reproducible. Ansible, Puppet, and Chef are among the popular tools used for this purpose. They help in managing servers, defining configurations, and enforcing desired states.
---
## 2. Continuous Integration - Jenkins
**Introduction to Jenkins:**
Jenkins is an open-source automation server used for building, testing, and deploying code changes. It plays a pivotal role in the CI/CD (Continuous Integration and Continuous Deployment) pipeline.
**Continuous Integration with Jenkins:**
Continuous Integration (CI) is a practice where developers frequently integrate their code changes into a shared repository. Jenkins automates this process, ensuring that code changes are integrated smoothly, and any issues are detected early in the development cycle.
**Configure Jenkins:**
Jenkins can be configured to work with different programming languages, version control systems (e.g., Git), and build tools (e.g., Maven). Configuration settings allow Jenkins to adapt to the specific needs of a project.
**Jenkins Management:**
Jenkins provides a user-friendly web-based interface for managing various aspects, including:
- **Jobs:** Define and configure build jobs.
- **Plugins:** Extend Jenkins functionality using plugins.
- **Nodes:** Manage machines (nodes) where Jenkins jobs run.
- **Security:** Set access controls and authentication mechanisms.
- **Scheduling Build Jobs:** Jenkins can be scheduled to execute build jobs at specific times or in response to code changes, ensuring a consistent and automated build process.
---
## 3. Containers and Virtual Development - Docker
**Docker Image:**
A Docker image is a lightweight, standalone, and executable package that contains everything needed to run an application, including code, runtime, libraries, and system tools. It encapsulates the application and its dependencies, ensuring consistent execution across different environments.
**Docker Installation:**
Docker can be installed on various operating systems, including Linux, Windows, and macOS. Once installed, Docker provides the Docker Engine, which is responsible for running containers.
**Working with Docker Containers:**
Docker containers are instances created from Docker images. They are isolated environments that run applications. Key concepts include:
- **Containerization:** Creating isolated environments for applications.
- **Docker Engine:** The core component responsible for managing containers.
- **Creating Containers with an Image:** Using Docker images to create container instances.
- **Working with Images:** Managing Docker images, including pulling, pushing, and building images.
- **Docker Command Line Interface:** The Docker CLI allows users to interact with Docker through commands. Common commands include `docker run`, `docker stop`, and `docker logs`.
**Docker Compose:**
Docker Compose is a tool for defining and running multi-container Docker applications. Developers can specify the services, networks, and volumes in a single YAML file, making it easy to manage complex applications composed of multiple containers.
**Docker Hub:**
Docker Hub is a cloud-based registry service that hosts Docker images. It serves as a central repository for sharing and distributing Docker images. Developers can pull images from Docker Hub to use in their projects.
**Docker Trusted Registry:**
Docker Trusted Registry (DTR) is a secure image storage solution that integrates with Docker Enterprise Edition. It provides features like image signing, scanning, and access control, ensuring image security.
**Docker Swarm:**
Docker Swarm is a native clustering and orchestration solution for Docker. It allows users to create and manage a swarm of Docker nodes, making it easier to deploy and scale containerized applications across a cluster.
**Docker Attach:**
Docker attach is a command that allows users to attach to a running container's process. This is useful for troubleshooting and debugging.
**Docker File & Commands:**
A Dockerfile is a script that contains a set of instructions for building a Docker image. It specifies the base image, environment variables, and commands required to create a working image. Dockerfiles help automate the image-building process.
---
## 4. Configuration Management Tools - Ansible
**Introduction to Ansible:**
Ansible is an open-source automation tool used for configuration management, application deployment, and task automation. It simplifies IT automation, allowing administrators to define infrastructure as code.
**Ansible Server Configuration:**
To use Ansible, you need an Ansible control node (server). The control node manages the automation process, including defining playbooks and executing tasks on remote hosts.
**Infrastructure Management:**
Ansible excels at managing infrastructure. Using Ansible playbooks, administrators can define the desired state of servers and networking devices, ensuring that systems are configured consistently.
**SSH Connection in Ansible Master:**
Ansible uses SSH to connect to remote hosts. The control node establishes SSH connections to execute tasks on remote machines. SSH keys are commonly used for secure authentication.
**YAML Scripts:**
Ansible playbooks are written in YAML (Yet Another Markup Language). YAML is human-readable and easy to write. Playbooks define tasks, hosts, and variables in a structured format.
**Host Inventory:**
Ansible uses host inventory files to define hosts and groups of hosts. These files list the machines Ans
ible will manage and can include host-specific variables.
**Ad-hoc Commands:**
Ansible allows for the execution of single commands on remote hosts without writing full playbooks. Ad-hoc commands are useful for quick tasks like checking system status.
**Playbooks:**
Playbooks are at the heart of Ansible automation. They define a series of tasks to be executed on remote hosts. Playbooks can include:
- **Variables:** To make playbooks reusable and adaptable.
- **Conditionals:** To perform tasks based on conditions.
- **Loops:** To repeat tasks for multiple items.
- **Handlers:** To define actions triggered by events.
- **Templates:** For generating configuration files.
- **Modules:** Ansible provides a wide range of modules for tasks like package installation, service management, and file manipulation.
- **Ansible Role:** An Ansible role is a collection of playbooks and associated files organized to be reusable and shareable. Roles simplify playbook management.