Skip to main content

Posts

Showing posts with the label DevOps Tools

A Complete CI/CD Pipeline

Complete CI/CD Pipeline Using GitHub, Jenkins, Maven, SonarQube, Nexus, and Docker A well-designed CI/CD pipeline plays a critical role in modern DevOps practices by automating software delivery, improving code quality, and reducing deployment risks. In this article, I will explain how I build an automated CI/CD pipeline using GitHub, Jenkins, Maven, SonarQube, Nexus Repository, Docker, and Docker Hub. Source Code Management with GitHub The CI/CD workflow begins with storing the application source code in GitHub. Developers regularly push code changes or create pull requests to collaborate on features and bug fixes. Whenever new code is pushed to the repository, GitHub triggers Jenkins automatically through a webhook. This integration helps start the CI/CD pipeline without manual intervention. Code Checkout Stage in Jenkins The first stage of the pipeline is the checkout process. Jenkins connects to the GitHub repository and pulls the latest version of the source code. ...

25 Essential DevOps Interview Questions

Preparing for a DevOps interview? Here are 25 critical questions to help you stand out and demonstrate your expertise! What is CI/CD and why is it important? Continuous Integration (CI) and Continuous Deployment (CD) are essential practices in modern software development. CI ensures that code changes are automatically tested and integrated into a shared repository, while CD automates the deployment process. Together, they help teams deliver software faster, with fewer errors and a higher level of consistency. What is the difference between Docker and Kubernetes? Docker is a platform used for building, deploying, and running containers, which are lightweight and portable. Kubernetes, on the other hand, is a container orchestration platform that automates the deployment, scaling, and management of containerized applications. ...

Essential Ansible Commands

Essential Ansible Commands Essential Ansible Commands This guide contains some essential Ansible commands with their explanations for managing infrastructure efficiently. Ping all hosts to check connectivity ansible all -m ping This command checks the connection to all hosts in the inventory file. Run a command on all hosts ansible all -m shell -a "uptime" This runs the uptime command on all hosts. You can replace uptime with any command you want to run. Run a playbook ansible-playbook playbook.yml This runs the playbook.yml file against the hosts defined in the inventory. Specify a different inventory file ansible-playbook -i myinventory.ini playbook.yml This uses myinventory.ini instead of the default /etc/ansible/hosts. ...

Handlers and Notify in Ansible

Handlers and Notify in Ansible Handlers and Notify in Ansible In Ansible, handlers are a special type of task that only run when notified by other tasks. They are commonly used for actions that should occur only when there is a change in the state of a resource, optimizing playbook runs by avoiding unnecessary operations. How Handlers Work Definition: Handlers are defined like regular tasks but are placed under a handlers section in your playbook. Notification: A task can notify a handler when it makes a change, using the notify keyword. Execution: Handlers are executed at the end of a play, after all tasks have run, and only if they have been notified. Example --- - name: Example Playbook hosts: webservers tasks: - name: Install nginx apt: name: nginx state: present notify: Restart nginx # Notify the handler if this task changes - name: Update ngin...

Steps to Set Up Ansible on AWS EC2 Instances

Ansible Setup on AWS Ansible Setup on AWS Step 1: Launch Instances Launch Amazon Linux instances on AWS: Control Node: The server to install Ansible. Managed Nodes: Servers managed by Ansible. Step 2: Install Ansible on the Control Node Update the system: sudo yum update -y Install EPEL Repository: sudo amazon-linux-extras install epel -y Install Ansible: sudo yum install ansible -y Step 3: Create a User on All Servers Create a user, for example, ansibleuser : sudo useradd ansibleuser sudo passwd ansibleuser Step 4: Grant Sudo Permission to the User Edit the sudoers file: sudo visudo Add this line: ansibleuser ALL=(ALL) NOPASSWD: ALL Step 5: Setup Passwordless Authentication on All Servers Edit SSH configuration: sudo vim /etc/ssh/sshd_config Set PasswordAuthentication to yes and restart SSH: sudo service ssh...

Ansible FAQs

  Ansible FAQs Ansible FAQs 1. What is Ansible? Ansible is an open-source IT automation tool used for configuration management, application deployment, and orchestration. It utilizes YAML (in Playbooks) for writing automation scripts, making it user-friendly. 2. Installing Ansible on Amazon Linux Ansible can be installed via the EPEL repository: amazon-linux-extras install epel Install Ansible using: yum install ansible Amazon Linux 2 supports amazon-linux-extras for easier package management. 3. How Ansible Communicates with Managed Nodes Ansible is agentless; no software needs to be installed on managed nodes. It communicates using SSH for Linux nodes and WinRM for Windows nodes. 4. Configuring SSH on Amazon Linux for Ansible Passwordless SSH access is configured using SSH key pairs, allowing Ansible to execute tasks without manual intervention. 5. What is the Ansible Inventory? ...

Ansible Installation on Amazon Linux

Ansible on Amazon Linux Ansible on Amazon Linux Ansible is a popular open-source automation tool used for configuration management, application deployment, and task automation. Running Ansible on Amazon Linux is efficient, especially for managing AWS infrastructure, as it integrates seamlessly with AWS services. Key Points for Using Ansible on Amazon Linux: 1. Installing Ansible on Amazon Linux Update the system: sudo yum update -y Install EPEL Repository: sudo amazon-linux-extras install epel -y Install Ansible: sudo yum install ansible -y 2. Configuring Ansible on Amazon Linux Ansible Inventory: Modify the inventory file: sudo nano /etc/ansible/hosts SSH Access: Ensure password-less SSH access is configured for the managed nodes. 3. Running Playbooks Create Playbooks: --- - hosts: webservers tasks: - name: Install Nginx yum: name: nginx ...

Setting Up a Jenkins Pipeline Without Writing a Script for a GitHub Repository

Jenkins Pipeline Setup Guide Jenkins Pipeline Setup Guide This guide outlines the steps to set up a Jenkins pipeline using the graphical user interface (GUI) to connect to a GitHub repository, specifically https://github.com/SuneelG2021/spring3_project.git . 1. Launch an EC2 Instance Create an EC2 Instance Log in to the AWS Management Console and launch a new EC2 instance using Amazon Linux 2 or another preferred Linux distribution. Choose an instance type (e.g., t2.micro). Configure instance settings, ensuring that security groups allow traffic on ports 22 (SSH) and 8080 (Jenkins). Connect to Your EC2 Instance ssh -i your-key.pem ec2-user@your-ec2-public-ip 2. Install Jenkins on EC2 Add Jenkins Repository sudo wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo ...

Commonly Used Network Ports in DevOps and Cloud Environments

Here's a breakdown of commonly used network ports and their significance in a DevOps and cloud environment: Service Port Description HTTP 80 Used for unencrypted web traffic. It’s the foundation of data communication on the web. HTTPS 443 Secures HTTP traffic with encryption using SSL/TLS. Essential for secure web browsing. SSH 22 Enables secure remote login and command execution on servers. Vital for server administration. FTP 21 Used for file transfers over a...