About

Tool No. 71 of Pikkola

A Kubernetes manifest is a short file that a cluster takes literally. Every field it omits gets a default nobody chose, and the ones it sets wrong are found by a pod that will not start or a node that runs out of memory. This page reads the file before that happens, and says what it would say if it were a reviewer with the file open.

What it does

The reader comes first

A general YAML library hands back values. A linter needs locations, because "no runAsNonRoot" without a line is a lecture. So the reader here is written for this page: it keeps the line each key and each list item came from, the indentation the author used, and the order the keys appeared in. Every finding carries the line of the node it is about, which is also what makes a fix able to insert a key beside the right sibling.

It reads the subset a manifest actually uses: block mappings and sequences, flow collections across one line or several, quoted and block scalars, comments, anchors and aliases, numbers, booleans and null. A tab used for indentation, an unterminated flow collection or a duplicated key is reported as a parse problem with the line it is on, and the audit continues on what it could read.

The three benches

The audit bench is the linter. The rules are written as functions over the parse tree, so a rule about a container reads the container, not a regular expression over the text. Cross-document rules run last, when every name in the file is known: a Service selector against the pod templates, an Ingress backend against the Services, a reference against the ConfigMaps and Secrets the file defines.

The document bench is the same parse, shown as an inventory. It answers the question a large file raises first: what is actually in here, and on which line.

The resource bench is arithmetic. Per-container requests and limits are multiplied by the pod count the kind implies, the larger of the app container sum and the biggest init container is taken for each resource, and the total is shown against a node size you enter. DaemonSets use the node count, Jobs use parallelism, a Pod counts once.

What a fix is, and is not

A fix is an edit, not a regeneration. The keys that are missing are inserted at the end of the map that should hold them, with the indentation that map already uses. Every other line, comment and blank line stays where it was. Two fixes that both want a securityContext on the same container write one block between them, not two.

Then the result is parsed again. If the edit would produce a file that does not parse, the edit is refused and the page says so instead of handing you broken YAML. What the fix cannot do is know your application: a probe path, a request size, a namespace and a pinned image version are starting points. The reasoning is on the page for each rule; applying it is still a review.

Where the limits are

Why it is free

Pikkola builds small tools with one job each and keeps them free, with no account and no lock on the result. A static page that works in the browser costs almost nothing to serve, so there is no reason to charge for it or to watch who uses it.

Contact

A rule that is wrong for your cluster, a manifest the reader could not follow, a Korean or Japanese sentence that reads badly: hello@pikkola.com. The manifest itself, with anything secret removed, and the line you disagree with are the most useful things to send.

Back to the studio