Posts

Kubernetes Troubleshooting Guide for DevOps Engineers

Image
Hello DevOps, Platform Engineers, SREs, and Kubernetes Administrators! Modern applications are increasingly built using microservices and deployed on Kubernetes clusters. While Kubernetes provides scalability, resiliency, and automation, troubleshooting failures can sometimes become challenging because issues may originate from multiple layers of the platform. One of the biggest mistakes engineers make during troubleshooting is focusing on a single component without understanding the overall architecture. Effective Kubernetes troubleshooting requires a structured approach that helps quickly identify where the problem exists. Over time, while working on Kubernetes administration, troubleshooting production incidents, and practicing Kubernetes scenarios from KodeKloud labs by Munshi Mohammad, I found it useful to classify Kubernetes issues into three major categories: Application Failures Control Plane (Master Node) Failures Worker Node Failures By identifying the category first, trouble...

50 Kubernetes Admin Commands and Troubleshooting Tricks for Every DevOps Engineer

Image
Hello DevOps Engineers! Over the years, while working with Kubernetes clusters, preparing for certifications, and troubleshooting production incidents, I've collected several command-line shortcuts, administration tricks, and troubleshooting techniques that save significant time. In this article, I share practical Kubernetes commands that I frequently use for: Kubernetes administration Cluster maintenance ETCD backup and recovery Node troubleshooting Cluster upgrades Context and namespace management Network debugging JSONPath queries Productivity improvements Whether you're preparing for the CKA exam , managing production clusters, or simply looking to become faster with Kubernetes, this guide will help. The 'kubectl' command flow architecture This helps beginners understand where each command fits. Come on! let's explore about the API resources which we might be frequently use when we prepare the YAML files for each Kubernetes Obj...

Ansible powerful parameters - delegate_to, connection

  Delegation to a host Here is an example where we can delegate the task to a particular host. This play book is using inventory_hostname from the gather facts. - name: Delegation to localhost hosts: all tasks: - name: create a file on target server file: path: /tmp/i_m_on_target_server.txt state: touch - name: create a file with host named file by delegation to localhost file: state: touch path: "/tmp/{{ inventory_hostname }}.txt" delegate_to: localhost connection paramer We can use this "connection" parameter add to your task level or play level. # Filename: connection_local.yml # To do some task on ansible server # local means without doing ssh command (no need of password and no need of ssh keys) # with the local connection parameter for the play --- - name: This is to determine how the connection parameter works with local hosts: app connection: local gather_facts: false tasks: - name: connecti...

Ansible Vault - To save Secrets

Image
Hello DevOps Automations Engineers!!  Ansible provides us special command 'ansible-vault' that is used to encrypt, decrypt, view an Ansible  playbook, this is also have amazing feature specific to role, vars YAML files, we can apply this to string of text in regular variables.  Why do we need to encrypt our Play books? Our Ansible automation projects, we need to work on multiple tasks and which may have some sensitive data such as database user credentials, any cloud IAM role details or it can be some other applications login credentials that's used to validate URL availability. Or it can be used to store the SSL certificates. At any point of time if the system is using plain text and it  has trouble to your confidential and sensitive data otherwise it could causes huge damage to your organization. Where we need a way to store the sensitive data can be protected by data encryption  tool, and this can be done using the Ansible-vault command.  Le...

Ansible Handlers and Notify Explained with Examples – Restart Services Only When Changes Occur

Image
Hello DevOps Experts!! let's zoom  into the usage of the Ansible Handlers and notifies   Have you ever restarted a service in Ansible even though nothing actually changed? Many beginners add service restart tasks directly into their playbooks. While this works, it can cause unnecessary service interruptions, increase deployment times, and introduce avoidable downtime. Ansible provides a smarter mechanism called Handlers , which execute only when a task reports a change. Combined with the notify directive, handlers help build efficient, idempotent, and production-ready automation. In this article, we'll explore how Ansible Handlers work, when to use them, and common DevOps use cases. What We'll Learn By the end of this article, you will understand: What Ansible Handlers are Why handlers are important How the notify keyword works When handlers are triggered How multiple tasks can notify a single handler Real-world DevOps use cases Best practices for handle...

Ansible real-time project - Installing and configure Tomcat 10

Image
 Hey DevOps or DevSecOps or SRE Guys!! What's up? in the automation journey one more wonderful learning here!  In this post we will be implementing all our Ansible modules one after other to build a complete solution for Java based Application server installation and running using Ansible playbook. At present Tomcat latest version is 10.0.27 so I've used same  Pre-requisites:  To install Apache Tomcat there is separate JDK/JRE compatibility we need to validate before we proceed Create a dedicated user account as 'tomcat' with shell as bash  to manage Tomcat application server Create a separate directory for tomcat server to be installed Execution of multiple tasks in the Playbook will be as follows: Download the Tomcat software from Apache Tomcat 10.0.27.tar.gz Uncompressing the tomcat tar.gz file Change the file permissions and ownership Cleanup after unarchive the tar.gz file Start the Tomcat server Have a task to stop the Tomcat server --- - n...

Undoing changes - git reset

Image
Hello Guys!! HEAD pointer movement HEAD points to specific commit in the local repo-branch as new commits are made, the pointer changes HEAD always points to the "tip" of the currently checked-out branch in the repo (not the working directory or staging index) last state of repo (what was checkout initially HEAD points to parent of next commit(where writing next commit takes place) HEAD Movement in Git branches Git Reset movements This is most common need of every DevOps team development phase need. There are three options we have but of course two of them are mostly used. Git reset movements at three tree levels soft mixed hard Using --soft reset The soft reset command is to combine many commits into a single one. git reset --soft HEAD (going back to HEAD) git reset --soft HEAD^ (going back to the commit before HEAD) git reset --soft HEAD~1 (equivalent to "^") git reset --soft HEAD~2 (going back to 2 commits before HEAD) Using hard reset mov...