Posts

Showing posts from December, 2022

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