Posts

Ansible Reboot Module: Automate Linux Reboots after patching

Image
Hello DevOps enthusiasts!  Welcome back to another hands-on automation experiment. In this article, we will explore how to use the Ansible reboot module to automate Linux VM/server reboots . A server reboot is a very common requirement in enterprise DevOps environments. When Operating System (OS) patching or kernel updates are performed across Development, Test, Stage, and Production environments , a reboot may be required for the changes to take effect. Instead of manually logging into each server, rebooting it, waiting for it to become available, and then checking whether important services are running, we can automate the entire workflow using Ansible. This article demonstrates a simple but practical pre-reboot → reboot → post-reboot validation approach. What We'll Learn By the end of this article, you will understand how to: Use the Ansible reboot module Automate Linux VM/server reboots Configure reboot_timeout Perform post-reboot validation Check server uptime after reboot ...

Ansible 2: Ad-hoc commands and Getting start Writing a Playbook

Image
Overview of Ansible PLAYBOOK  An Ansible playbook is a single YAML file that contains multiple plays.  Each Play will be defined with a set of activities that are treated as tasks,  and these tasks can be executed at the remote host that is the Ansible client. The task can be a single action that can be one of:   Execute a command    Run a script    install patch or package   Reboot VM/box    Restart services Simple ansible play can be  check the timestamp reboot server wait for connect back check the uptime  check timestamp  Complex ansible play Take a backup of files on 20 DB VMs Deploy application on 100 App boxes 100 servers patch apply 100 VM reboot after patch  Mail and slack notifications on patch process  Ansible ad-hoc command When you plan to write a playbook first you need to test the ad-hoc commands as trial and error will gives more confidence to run in a play # Ansible ad-...

Ansible 3 Exploring on the files, copy, fetch modules

Image
Hello Guys this is another post on the Ansible learning experiments, well in this post,  I've explored about files and directories which can be created and copied and downloaded and uploaded. We could also do file permission changes how we do in Linux 'chmod' and 'chown' commands. Let's begin with effectively doing automation management with configurations and deploy the challenges related to files and directories. We can compare ansible modules copy and fetch both are related to file moment and they work in opposite directions as shown below: Ansible modules copy vs fetch We have many files related modules available in the Ansible.  acl archive unarchive iso_extract read_csv synchronize assemble tempfile template xattr xml blockinfile lineinfile patch  copy fetch file find stat replace In this post we will have three modules to experiment here. file copy fetch Prerequisites  Ansible installed controller node SSH password less connectivity established Here is a ...

Installation of Ansible on Rocky | RHEL | OpenSuse | Ubuntu

Image
 Hello Guys!!  In this post let's explore the installation options for Ansible Core. We can get the detailed Documentation provided by Ansible in the Installation Guide. I've also gone through the Amazing Book : Ansible for DevOps   Here he explained that beginners can start with playing in Laptop by setting up the Virtual Boxes for Ansible learnings.  Today I have started experimenting with Ansible installation on the Rocky Linux Vagrant box, As you know Ansible is from the RedHat. Ansible having 3300+ modules freely available. At the end of the installation, we can test the connectivity with the ' ping ' and ' shell ' module which will be referred to the inventory hosts which is present in the "/etc/ansible/hosts" location. Prerequisites for Ansible installation Create Vagrant Boxes where Ansible engine runs on the master node and SSH-Agents will run on two different nodes. PasswordAuthentication enable for sshd_config SSH Connectivity with ssh-keyge...

Kubernetes Storage Volumes Part -2 HostPath

Image
 Hello DevOps Guys!! This post is about Kubernetes Volume type hostPath type. In this post, I've tried multiple options with Volume with hostPath type association with Pods. Volume type - hostPath  it posts the persistent data to a specific file or directory on the Host machine's file-system Pods running on same node and using the same path in their volume  this hostPath volume is not deleted when Pod crashed or brought down intentionally Specialty of the hostPath Volume is retained, if a new Pod is started as replacement, the files in the hostPath volume will be reused and re-attached to new Pod. If we compare with emptyDir if the pod dies the Volume will be reclaimed by the Kubernetes Control Plane. whereas in hostPath it remains on the host path. Pre-requisites Docker Engine installed   Kubernetes Cluster Up and Running (You can do a test on MiniKube as well) Enough disk space to define in the PV manifestation In this post we will do two experiments Bare ...

Kubernetes DaemonSet (ds): Deploy Node-Level Agents Across Kubernetes Cluster

Image
Greetings of the day, dear Cloud Native enthusiasts! Imagine you are managing a Kubernetes cluster with 50 worker nodes and hundreds of microservices. Your applications are running successfully, but your operations team has several questions: Who collects CPU, memory, disk, and network metrics from every worker node? How do you collect container logs from all nodes? How do you deploy a security monitoring agent consistently across the cluster? When a new worker node joins the cluster, how do you ensure that the monitoring agent is installed automatically? What happens when a worker node is replaced during an infrastructure upgrade? You could manually deploy an agent on every node, but that approach quickly becomes difficult to maintain. This is exactly where Kubernetes DaemonSet becomes important. A DaemonSet automates the deployment of node-level services by ensuring that a copy of a specified Pod runs on every eligible node or a selected subset of nodes. ...

Helm charts Package Management and Application Deployment Best Practices for Kubernetes

Image
Hello DevOps Engineers, DevSecOps Professionals, SREs, Platform Engineers, and Kubernetes Enthusiasts! As Kubernetes adoption grows, managing large numbers of YAML manifests becomes increasingly difficult. A typical application deployment may require multiple Kubernetes objects such as: Deployments Services ConfigMaps Secrets Ingress Resources Horizontal Pod Autoscalers (HPA) Service Accounts Managing all these resources individually can quickly become complex and error-prone. This is where Helm comes into the picture. Helm is the most widely used package manager for Kubernetes and is often referred to as the "apt" or "yum" of Kubernetes." In this blog post, we'll learn & explore: What Helm is Why Helm is important How Helm Charts work Installing Helm on Linux Creating and validating Helm Charts Deploying applications using Helm Customizing deployments with values files Best practices for production environments What is a helm chart?  Helm is a package...