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
- Reads a multi-document YAML file, split on
---, and holds every document separately with the line it began on. - Checks the shape of Pod, Deployment, StatefulSet, DaemonSet, ReplicaSet, Job, CronJob, Service, Ingress and ConfigMap, and the name and namespace of any other built-in kind.
- Applies 54 rules across structure, traffic, volumes, security and reliability, each with the line and the reason.
- Writes a fix into the text when a rule has one, then reads the whole file again to prove the edit parses.
- Adds up the CPU and memory the set requests and limits, per workload, per pod and across the cluster size you enter.
- Lists every document in the file, with its kind, name, namespace, images and finding count.
- Copies or downloads the rewritten manifest. Nothing is uploaded, stored or sent.
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
- It is not admission control, a schema validator or a scheduler. It reads the file, not the cluster.
- A custom resource is recognised as a custom resource. Its schema belongs to the operator that installed it.
- It cannot see what an image does at runtime, what a mutating webhook adds, or what an operator sets on a field the file never mentions.
- The runAsNonRoot rule reports what the file says. An image whose user is root and whose manifest never mentions the user still passes that rule.
- The calculator counts requests and limits, not sidecars injected later, not the kubelet's reservation, not the system pods. A node that reports 16 GiB has less than that to give.
- YAML it cannot follow is reported as a parse problem rather than guessed at. Multi-line plain scalars and unusual anchors are the places it gives up first.
- Nothing is fetched: no schema, no registry, no cluster, no font or script from another domain.
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.