Skip to content
>_ TrueFileSize.com

Sample YAML File Download — Free DevOps Config Examples

Download free YAML config file examples from 1KB to 500KB — Docker Compose, Kubernetes manifests, GitHub Actions CI/CD workflows, and deeply nested structures with anchors. Use these YAML test files for parser validation, DevOps pipeline testing, and config management tools.

Generate custom YAML fileCreate up to 1GB locally in your browser

sample-1kb.yaml

1 KB

30 lines

Verified file details
Filename
sample-1kb.yaml
Exact size
1,024 bytes
Displayed size
1 KB
MIME type
application/octet-stream
Lines
30
Note
simple-config
License
CC0 / Public Domain
Download URL
https://truefilesize.com/files/yaml/sample-1kb.yaml

See how TrueFileSize generates and measures sample files, or review the editorial policy.

sample-10kb.yaml

10 KB

300 lines

Verified file details
Filename
sample-10kb.yaml
Exact size
10,240 bytes
Displayed size
10 KB
MIME type
application/octet-stream
Lines
300
Note
docker-compose-style
License
CC0 / Public Domain
Download URL
https://truefilesize.com/files/yaml/sample-10kb.yaml

See how TrueFileSize generates and measures sample files, or review the editorial policy.

sample-50kb.yaml

50 KB

1,500 lines

Verified file details
Filename
sample-50kb.yaml
Exact size
51,200 bytes
Displayed size
50 KB
MIME type
application/octet-stream
Lines
1,500
Note
kubernetes-manifest-style
License
CC0 / Public Domain
Download URL
https://truefilesize.com/files/yaml/sample-50kb.yaml

See how TrueFileSize generates and measures sample files, or review the editorial policy.

sample-100kb.yaml

100 KB

3,000 lines

Verified file details
Filename
sample-100kb.yaml
Exact size
102,400 bytes
Displayed size
100 KB
MIME type
application/octet-stream
Lines
3,000
Note
nested-deep
License
CC0 / Public Domain
Download URL
https://truefilesize.com/files/yaml/sample-100kb.yaml

See how TrueFileSize generates and measures sample files, or review the editorial policy.

sample-500kb.yaml

500 KB

15,000 lines

Verified file details
Filename
sample-500kb.yaml
Exact size
512,000 bytes
Displayed size
500 KB
MIME type
application/octet-stream
Lines
15,000
Note
with-anchors
License
CC0 / Public Domain
Download URL
https://truefilesize.com/files/yaml/sample-500kb.yaml

See how TrueFileSize generates and measures sample files, or review the editorial policy.

sample-docker-compose.yaml

3 KB

90 lines

Verified file details
Filename
sample-docker-compose.yaml
Exact size
3,072 bytes
Displayed size
3 KB
MIME type
application/octet-stream
Lines
90
Note
docker-compose
License
CC0 / Public Domain
Download URL
https://truefilesize.com/files/yaml/sample-docker-compose.yaml

See how TrueFileSize generates and measures sample files, or review the editorial policy.

sample-k8s-deployment.yaml

2 KB

60 lines

Verified file details
Filename
sample-k8s-deployment.yaml
Exact size
2,048 bytes
Displayed size
2 KB
MIME type
application/octet-stream
Lines
60
Note
kubernetes-deployment
License
CC0 / Public Domain
Download URL
https://truefilesize.com/files/yaml/sample-k8s-deployment.yaml

See how TrueFileSize generates and measures sample files, or review the editorial policy.

sample-github-actions.yaml

2.5 KB

75 lines

Verified file details
Filename
sample-github-actions.yaml
Exact size
2,560 bytes
Displayed size
2.5 KB
MIME type
application/octet-stream
Lines
75
Note
ci-cd-pipeline
License
CC0 / Public Domain
Download URL
https://truefilesize.com/files/yaml/sample-github-actions.yaml

See how TrueFileSize generates and measures sample files, or review the editorial policy.

Use cases for sample YAML files

  • Testing YAML parsers (js-yaml, PyYAML, ruamel.yaml)
  • Validating Docker Compose and Kubernetes configs
  • Testing GitHub Actions / GitLab CI workflow parsing
  • Benchmarking YAML vs JSON vs TOML parsing performance
  • Testing YAML linters and schema validators
  • Verifying anchor/alias expansion in YAML processors

YAML vs JSON vs TOML for configuration

FeatureYAMLJSONTOML
CommentsYes (#)NoYes (#)
ReadabilityExcellentGoodExcellent
Anchors/aliasesYes (&/*)NoNo
Multi-documentYes (---)NoNo
Indentation-sensitiveYes (error-prone)No (braces)No (sections)
Used byK8s, Docker, GitHub ActionsAPIs, package.json, tsconfigCargo, pyproject, Hugo

Common YAML gotchas

# Norway problem: "NO" is parsed as boolean false
country: NO      # ❌ parsed as false
country: "NO"    # ✅ string "NO"

# Version numbers: 1.0 is parsed as float
version: 1.0     # ❌ parsed as 1 (number)
version: "1.0"   # ✅ string "1.0"

# Octal numbers: 0777 is NOT 777
mode: 0777       # ❌ parsed as 511 (octal)
mode: "0777"     # ✅ string "0777"

# Always quote strings that look like booleans/numbers

Technical specifications

Full nameYAML Ain't Markup Language
Extensions.yaml, .yml
MIME typetext/yaml (RFC pending)
Current versionYAML 1.2.2 (2021)
EncodingUTF-8 (recommended)
Superset ofJSON (valid JSON is valid YAML)

Frequently Asked Questions

YAML vs JSON — Which should I use for config files?
YAML is better for configuration files — it supports comments (#), is more human-readable (indentation-based), and has anchors/aliases for DRY configs. JSON is better for data interchange (APIs, package.json) — it's stricter, faster to parse, and has universal support. Since YAML 1.2, any valid JSON is also valid YAML. Use YAML for Docker Compose, Kubernetes, CI/CD. Use JSON for APIs and machine-to-machine data.
YAML syntax — How does indentation work?
YAML uses indentation (spaces only, never tabs) to define structure — similar to Python. Each nesting level adds 2 spaces (convention). A single misplaced space can change meaning or cause parse errors. Key gotchas: 'NO' is parsed as boolean false (quote it: "NO"), 1.0 becomes a float (quote it: "1.0"), 0777 is octal (quote it: "0777"). Use yamllint and an editor with YAML support to catch errors.
YAML anchors explained — How to avoid repetition?
YAML anchors (&name) and aliases (*name) let you define a value once and reuse it, avoiding copy-paste duplication. Example: define defaults with '&defaults' then merge with '<<: *defaults' in each environment. Our sample-500kb.yaml demonstrates anchors with development/staging/production configs that inherit shared settings. Anchors are particularly useful in Docker Compose and CI/CD pipelines.
What is YAML used for in DevOps?
YAML is the dominant configuration format for DevOps: Kubernetes manifests (Deployments, Services, Pods), Docker Compose files, GitHub Actions / GitLab CI workflows, Ansible playbooks, Helm charts, and CloudFormation templates. Our sample files include realistic examples of all these formats for testing parsers and validators.
Should I use .yaml or .yml extension?
Both work — they are interchangeable. The official YAML FAQ recommends .yaml (full word), but .yml is widely used due to historical 3-character extension conventions. Kubernetes and Docker Compose accept both. Pick one and be consistent across your project.

Other data formats

Related reading