Urgent.News

What's breaking now, across thousands of outlets.

Tech

Kubernetes Demystified: YAML Tutorial for DevOps

What is YAML? YAML is a data serialization language, like XML and JSON. What is a serialization language? Applications written with different technologies and languages, which have different data structures, can transfer data to each other on a common grid or standard format. Ex: JSON, YAML, XML. YAML is not — yet another markup language. "Human friendly" data serialization standard for all…

YAML, short for YAML Ain't Markup Language, is a data serialization format similar to XML and JSON. Serialization languages enable applications using diverse technologies and data structures to exchange information through a shared format. Alongside YAML, JSON and XML serve this purpose.

YAML distinguishes itself from markup languages like HTML, prioritizing human-friendly data serialization suitable for any programming language. Developers often store YAML configuration files alongside their codebase or in a separate Git repository. The file extension for YAML is .yaml or .yml.

Compared to other serialization formats, YAML is known for its readability and intuitiveness. Line separation and indentation play crucial roles in structuring YAML data. The language finds utility in various DevOps tools, including Docker Compose files, Docker, Kubernetes, Ansible, and Prometheus.

In YAML, line separation and indentation serve as key identification markers. The language is a superset of JSON, meaning that any valid JSON file can also be considered a valid YAML file. This compatibility facilitates easy data interchange between YAML and JSON-based systems.

In terms of basic syntax, YAML employs key-value pairs to represent data. For instance, an example might look like this:

app: user-authentication

port: 9000

version: 1.7

Objects in YAML are defined by indenting key-value pairs and further indentation for nested objects. Here's an example:

microservice:

app: user-authentication

port: 9000

version: 1.7

Lists are another essential concept in YAML. They are expressed using hyphens (-) for list items. For example:

microservice:

- app: user-authentication

port: 9000

version: 1.7

Boolean values in YAML can be represented using specific keywords:

deploy:

yes

no

on

off

false

true

Additionally, YAML supports nested lists. For instance:

microservice:

- app: user-authentication

version:

- 1.7

- 2.1

- 8.1

port: 9000

When it comes to Kubernetes, YAML files play a vital role in defining and managing resources within the cluster. A Kubernetes YAML file typically includes the following elements:

- apiVersion: Specifies the Kubernetes API version used.

- kind: Indicates the type of Kubernetes resource (e.g., Pod, Service).

- metadata: Contains metadata about the resource, such as its name.

- labels: Allows for the assignment of key-value pairs to categorize and organize resources.

- spec: Defines the resource's desired state, including container specifications and other settings.

A Kubernetes YAML file can include lists of objects, such as containers and volume mounts. For example, the following snippet demonstrates a container specification:

containers:

- name: nginx-container

image: nginx

ports:

- containerPort: 80

volumeMounts:

- name: nginx-vol

mountPath: /usr/nginx/html

This example showcases the key-value pair structure, object indentation, list representation, and Boolean values commonly found in YAML syntax. By utilizing YAML in Kubernetes configuration files, DevOps engineers can effectively manage their containerized applications and infrastructure.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

FieldOS, Part 3: The App People Open, and What 10 Hours Taught Me About Pricing

Everything in this series so far — the jobs, the parts, the dispatch board, the nine add-ons — runs quietly in the background. None of it matters if the people actually doing the work can't get to it.

  • One app with 13 distinct views for technicians, dispatchers, and customers
  • Time tracking linked to jobs for automatic invoice integration
  • Demo login resets system, creating 83 unnecessary invoices fixed

How HookProbe Detects CVE-2026-18556 (N-able N-central Authentication Bypass)

Introduction: The Danger of Alternate Paths In the complex ecosystem of Remote Monitoring and Management (RMM) tools, N-able N-central stands as a pillar for MSPs and internal IT departments to manage…

  • HookProbe detects CVE-2026-18556 in N-able N-central.
  • HYDRA engine identifies suspicious URI patterns and headers.
  • NAPSE engine validates authentication state transitions.

Cómo solucionar \"Enable JavaScript and cookies to continue\"

Cómo solucionar "Enable JavaScript and cookies to continue" Este mensaje aparece cuando Cloudflare (u otro proxy de seguridad similar) bloquea la solicitud porque detecta que el navegador no cumple…

  • JavaScript disabled or cookies rejected due to security requirements
  • Cloudflare's challenge requires JavaScript execution and cookie storage
  • Solutions include enabling JavaScript, allowing cookies, and using tools like cloudscraper

What is post-quantum cryptography, and why migrate now?

The cryptography protecting your data today — keys, HTTPS, signatures — rests on mathematical problems that current computers cannot solve in any reasonable time.

  • Post-quantum cryptography resists attacks from classical and quantum computers
  • NIST finalized first set of post-quantum algorithms in 2024
  • Hybrid encryption recommended to mitigate quantum risk

More from Saturday 29 August →