YAML and JSON. Templating YAML with YAML Processors. Static Checking of Kubernetes YAML Files
Templating YAML Files
redhat.com: YAML for beginners YAML is an easy, expressive, data-oriented language that distinguishes itself from document markup languages.
thoughtworks.com: Templating in YAML As infrastructures grow in complexity, so do the configuration files that define them. Tools such as AWS CloudFormation, Kubernetes and Helm expect configuration files in JSON or YAML syntax, presumably in an attempt to make them easy to write and process. However, in most cases, teams quickly reach the point where they have some parts that are similar but not quite the same, for example, when the same service must be deployed in different regions with a slightly different setup. For such cases tools offer templating in YAML (or JSON), which has caused a huge amount of frustration with practitioners. The problem is that the syntax of JSON and YAML requires all sorts of awkward compromises to graft templating features such as conditionals and loops into the files. We recommend using an API from a programming language instead or, when this is not an option, a templating system in a programming language, either a general-purpose language such as Python or something specialized such as Jsonnet.
Steve Horsfield: DevOps tricks - Templating YAML files Basic text tools fall foul of YAML’s indentation sensitivity. On the other hand, YAML tools like In my case, I opted for a small ytt are pretty difficult to interpret. jq program executed via yq.
redhat.com: Understanding YAML for Ansible. Validating YAML files with YAMLlint 🌟 Ansible playbooks are written in YAML, YAML Ain’t Markup Language. Understanding YAML syntax is a key to success with Ansible.
linuxhandbook.com: YAML Basics Every DevOps Engineer Must Know 🌟
developers.redhat.com: How to configure YAML schema to make editing files easier
kubernetestutorials.com: Kubernetes : Introduction to YAML 🌟
betterprogramming.pub: YAML Tutorial: Get Started With YAML in 5 Minutes Syntax, salient features, and advanced features.
abhisheksaini.hashnode.dev: YAML For Data Representation? YAML is a better option than JSON when comes to representation of Data
boxunix.com: A Better Way of Organizing Your Kubernetes Manifest Files 🌟
opensource.com: Make YAML as easy as it looks YAML looks simple so why is it so hard to write? Learn the two secrets to YAML success.
w3schools.io: YAML - yaml vs yml file YAML anchors and aliases
ytt is a templating tool that understands YAML structure allowing you to focus on your data instead of how to properly escape it. You should use tools such as
yq and kustomize to template YAML resources instead of relying on tools that interpolate strings such as Helm.
yq 🌟 is a lightweight and portable command-line YAML processor. The aim of the project is to be the jq or sed of yaml files.
yq allows to query the yaml tree and highlights it:
Kapitan Generic templated configuration management for Kubernetes, Terraform and other things.
yaml.sh A YAML parser completely in bash. Yaml.sh — YAML Sans Helm
yh - YAML Highlighter is YAML syntax highlighter that works nicely with kubectl output
Kubectl output options 🌟 Kubernetes examples
Kubernetes examples 🌟 A series of YAML references with canonical and as-simple-as-possible demonstrations of kubernetes functionality and features. Helm and Kustomize
Templating JSON Files
JSON in Ansible
JSON formatting with jq
Kubernetes JSON Schemas
The ecosystem of static checking of Kubernetes YAML files can be grouped in the following categories:
API validators: Tools in this category validate a given YAML manifest against the Kubernetes API server.
Built-in checkers: Tools in this category bundle opinionated checks for security, best practices, etc.
Validating Kubernetes YAML for best practice and policies 🌟 In this article, you will learn and compare six different tools:
kubevious.io: Top Kubernetes YAML Validation Tools Alternatives
Back to top