YAML is a human-readable data serialization format that uses indentation, key-value pairs and lists to describe structured data. It is the default configuration language for much of the DevOps toolchain, including Kubernetes manifests, Ansible playbooks and inventories, Helm charts, CI pipelines and Git hook tools such as pre-commit.
The posts here start with the basics: what YAML is, how its specification rules and syntax work, and how it compares with XML and JSON. From there they move into real files you will write at work. You will find Kubernetes ReplicaSet and Deployment manifests with rollout strategies, Ansible examples covering inventory variables and multiple plays in one file, a Helm lab that builds and packages a chart, a Knative install on Minikube, a New Relic logging.d config, and a pre-commit setup guide with a .pre-commit-config.yaml file.
The collection suits engineers who keep hitting indentation errors, people moving from JSON to YAML-based tools, and candidates preparing for interviews. A set of 50 YAML interview questions and answers covers syntax, data structures and configuration usage.
Start here
- What is YAML and How it works? An Overview and Its Use Cases – Plain overview of YAML with scalar and collection examples, file extensions, pros and cons.
- Yaml tutorial specification rules and syntax – Covers indentation, key-value pairs and lists so your files parse correctly.
- Comparison between XML Vs JSON Vs YAML – Side-by-side comparison showing where YAML fits against XML and JSON.
- Kubernetes Deployment Explained: API Resource, YAML Example, and Use Cases – Real Kubernetes Deployment YAML with Recreate and RollingUpdate strategies explained.
- Ansible: All Ways to Define Variables in Ansible Inventory/Hosts – Shows YAML inventories plus host_vars and group_vars layouts in Ansible.
- Helm Lab – 4: Creating and Packaging a Helm Chart – Hands-on lab turning YAML templates into a packaged Helm chart.
- How to Install and Configure pre-commit on macOS, Windows, and Linux: Complete Step-by-Step Guide – Configure Git hooks and linting through a YAML config on any OS.
- <strong>Top 50 interview questions and answers for YAML</strong> – 50 questions and answers to check your YAML knowledge before interviews.
Latest YAML articles
Azure Devops Pipeline YAML Example
This page shows a minimal Azure Pipelines YAML file that builds a Docker image with the Docker@2 task on a Microsoft-hosted Ubuntu agent each time code is…
Gitlab – Complete Details of .gitlab-ci.yml
GitLab builds every pipeline from one entry-point configuration file, .gitlab-ci.yml by default, but that file can pull in any number of other YAML files with the include…
Kubernetes ReplicaSet Explained: API Resource, YAML Example, and Use Cases
Rajesh KumarI’m Rajesh Kumar, a DevOps, SRE, DevSecOps, Cloud, and Platform Engineering expert passionate about sharing practical knowledge, real-world experiences, and industry best practices. I have worked…
How to Install and Configure pre-commit on macOS, Windows, and Linux: Complete Step-by-Step Guide
SEO Title: How to Install and Configure pre-commit on Mac, Windows & Linux (2026) Meta Description: Learn how to install and configure pre-commit Git hooks on macOS,…
GitHub Actions Essentials — Learn CI/CD in 2 Hours
Audience: Beginners, developers, junior DevOps engineers, QA engineers, and students Level: Beginner to early-intermediate Duration: About 120 minutes Format: Learn, modify, run, break, and fix Goal: By…
Kubernetes Job & CronJob Explained: API Resource, YAML Example, and Use Cases
Kubernetes Jobs and CronJobs Explained with Examples: Complete Hands-on Guide for DevOps Engineer Keywords 1. Introduction In Kubernetes, not every workload is a long-running application like a…
Kubernetes Secret Explained: Secret API Resource, YAML Example, and Use Cases
What is Kubernetes SecretsA Secret is an object that contains a small amount of sensitive data such as a password, a token, or a key. Objects of…
Kubernetes Deployment Explained: API Resource, YAML Example, and Use Cases
Fearture of Kubernetes Deployment Note:ReplicaSets = Replication+Controller in the Deployment Kubernetes Deployement Strategy Type of deployment .spec.strategy specifies the strategy used to replace old Pods by new…
Kubernetes ReplicationController Explained: API Resource, YAML Example, and Use Cases
A ReplicationController is a Kubernetes controller that ensures that a specified number of pod replicas are running at any one time. In other words, a ReplicationController makes…
Kubernetes PersistentVolume, PersistentVolumeClaim, volume using hostPath
pv.yaml $ kubectl create -f pv.yaml $ kubectl get pv pvc.yaml $ kubectl create -f pvc.yaml $ kubectl get pvc pod.yaml Rajesh KumarI’m Rajesh Kumar, a DevOps,…
Ansible: All Ways to Define Variables in Ansible Inventory/Hosts
Here’s a comprehensive tutorial on all the ways to define and use variables in Ansible inventory/hosts, covering every major approach—including their best use cases and clear examples…
Kubernetes Ingress Rules: Complete Guide with Examples
Here’s a comprehensive, practical, and easy-to-follow tutorial on all main types of Kubernetes Ingress rules—with detailed explanations, diagrams, and YAML examples for each. This guide is aimed…
Helmfile Tutorial: From Beginner to Advanced
1. Introduction to Helmfile What is Helmfile? Helmfile is an open-source tool that lets you declare, manage, and deploy multiple Helm charts as a unified, version-controlled “desired…
Kubernetes Service Example Programs
Here’s a complete YAML file that contains three Deployments and their corresponding Services: Each container runs on port 80. ✅ Full Kubernetes YAML (deployment-and-services.yaml) 🚀 Usage To…
Openshift: Add All OperatorHub.io Operators to OpenShift
Here’s a complete, step-by-step tutorial — with explanations — to add OperatorHub.io operators to OpenShift by creating a custom CatalogSource pointing to their community catalog image from…
Gitlab – Top 30 GitLab Pipeline Automation FAQ
Here’s a curated set of 30 most frequently asked real-world questions about GitLab CI/CD pipeline automation, with clear and concise answers — perfect for training sessions or…
GitLab CI/CD Pipeline Configuration Keywords
Below is a comprehensive table listing the key stanzas (keywords) used in GitLab CI/CD pipeline configuration files (.gitlab-ci.yml). These keywords are categorized based on their scope and…
Openshift Tutorials for DeploymentConfigs
OpenShift DeploymentConfigs are a core resource in OpenShift used to manage the deployment and lifecycle of applications. While Kubernetes uses Deployments to manage the rolling updates of…
GitHub Actions: Terminology
Here’s a table that summarizes key GitHub Actions terminology, providing a clear and concise explanation of each term: Term Definition Workflow A configurable automated process made up…
Azure DevOps Pipelines Fundamental Tutorials
Here is an in-depth, step-by-step tutorial on Azure DevOps Pipelines that covers everything from the fundamentals to advanced concepts. This guide is designed to help you understand…
Helm Tutorials: templateFiles section of the value file
The templateFiles section of the Helm chart custom values file is used to define template files that are to be generated in addition to the template files…
Helm Tutorials: Global Values in Helm Chart
In Helm, you can define global values that are accessible across all templates within a chart. Global values are useful for defining configuration settings or variables that…
Helm Lab – 4: Creating and Packaging a Helm Chart
Windows Commands Linux Commands Rajesh KumarI’m Rajesh Kumar, a DevOps, SRE, DevSecOps, Cloud, and Platform Engineering expert passionate about sharing practical knowledge, real-world experiences, and industry best…
Knative: Example of Knative Service Example with all the options available
The metadata section includes the name and namespace of the service, as well as annotations that specify the creator of the service and its visibility. The spec…
Install Knative with YAML using minikube
Prerequisite kn cli We need to install kn cli https://knative.dev/docs/client/install-kn/#install-the-knative-cli Knative Serving For prototyping purposes, Knative works on most local deployments of Kubernetes. For example, you can…
GitLab Tutorials: Example of .gitlab-ci.yml
.gitlab-ci.yml file to run with Docker runner Build a Docker image with CI/CD and push to the GitLab registry Rajesh KumarI’m Rajesh Kumar, a DevOps, SRE, DevSecOps,…
AWS CodeDeploy: Deploy apps using appspec.yml with IIS stop/start
Note – in this program file “before-iis-install-stop.bat” & “after-iis-install-start.bat” & index.html is in same directory. Step 1 – Write before-iis-install-stop.bat Step 2 -Write after-iis-install-start.bat Step 3 –…
Elastic Logstash: what is logstash.yml & pipelines.yml & configratuion file?
Logstash has two types of configuration files: pipeline configuration files, which define the Logstash processing pipeline, and settings files, which specify options that control Logstash startup and execution. Pipeline…
What is YAML and How it works? An Overview and Its Use Cases
What is YAML? YAML means another markup language. It is a data serialization language that works well with the modern programming language, and it is human-friendly. It…
Top 50 interview questions and answers for YAML
YAML is a knowledge publishing language that’s usually used for writing configuration files. Counting on whom you raise, YAML stands for yet one more nomenclature or YAML…
YAML: frequently asked questions
What is the difference between .yaml and .yml?
There is no functional difference; both extensions are used for YAML files. .yaml is the officially recommended extension, but most tools accept either.
Can I use tabs for indentation in YAML?
No. YAML does not allow tab characters for indentation, so use spaces and keep the count consistent within each block.
Is JSON valid YAML?
In YAML 1.2, JSON is effectively a subset of YAML, so most JSON documents parse as YAML. The reverse is not true, because YAML adds features such as comments, anchors and multi-line strings.
Why is YAML used so widely in DevOps tools?
It is easy for people to read and diff, supports comments, and maps cleanly to dictionaries and lists. That makes it a good fit for declarative configuration in tools like Kubernetes, Ansible and CI systems.
