Skip to main content

Posts

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. ...
Recent posts

Commonly Used Kubernetes Commands

These are the basic commands you’ll use often when working with Kubernetes. Think of them as tools to check , create , change , and fix things inside your Kubernetes system. 1. Viewing What's Running These commands help you see what’s going on inside your Kubernetes cluster. kubectl get pods # shows all running pods kubectl get deployments # shows all deployments kubectl get services # shows all services kubectl get all # shows most resources in the current namespace 2. Getting Detailed Information kubectl describe pod my-pod # details about one pod kubectl describe node my-node # details about one node 3. Creating Things kubectl create -f my-deployment.yaml # create from file 4. Updating Things kubectl apply -f my-deployment.yaml # update using the file 5. Deleting Things kubectl delete pod my-pod # delete a specific pod kubectl delete service my-service # delete a specific service Debugging and Fixing Problems ...

Kubernetes Networking Overview

  Pod Networking Kubernetes Pods share the same network namespace, allowing them to communicate with each other via localhost . Each Pod is assigned a unique IP address to enable communication across different nodes. Service Networking Services provide stable access points to Pods. Some common types include: ClusterIP : Internal access within the cluster. NodePort : Exposes services on a port on each node for external access. LoadBalancer : Exposes services externally with a load balancer. Ingress Networking Ingress controls external access to services based on HTTP/HTTPS rules. Ingress controllers manage routing traffic to the correct services within the cluster. Network Policies Network policies define rules for communication between Pods and external resources. This allows for fine-grained control over network traffic within the cluster....

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. ...

Real-time Ansible Interview Questions and Answers

1. How would you ensure that a specific package is installed on multiple servers? Answer: You can use the package module in an Ansible playbook to ensure a specific package is installed across multiple servers. For example: - name: Ensure package is installed package: name: httpd state: present 2. How do you handle different environments (development, testing, production) with Ansible? Answer: You can manage different environments by using separate inventory files and group variables. Each environment can have its own inventory file (e.g., dev.ini , test.ini , prod.ini ), and you can define environment-specific variables using group_vars directories. This allows you to target specific groups or environments. 3. How would you restart a service after updating a configuration file? Answer: Use the notify feature to trigger a handler that restarts the service once the configuration file is updated. For example: - n...

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...