Browser-based Kubernetes linter · manifests are read here, never applied

Kubernetes YAML Linter

Paste multi-document YAML and get findings per resource: missing requests and limits, probes, latest tags, privileged and root containers, hostPath volumes, selector mismatches, duplicate names and API versions your cluster no longer serves. Export a Markdown report or SARIF.

Manifests

Drop a .yaml file

Up to 2 MB, any number of documents

Removed API versions

What this linter treats as no longer served, and the release that dropped it.

apiVersionKindsRemoved inUse instead
extensions/v1beta1Deployment, DaemonSet, ReplicaSet, NetworkPolicy1.16apps/v1 (NetworkPolicy: networking.k8s.io/v1)
extensions/v1beta1Ingress1.22networking.k8s.io/v1
extensions/v1beta1PodSecurityPolicy1.16none; PodSecurityPolicy itself was removed in 1.25, use Pod Security Admission
apps/v1beta1Deployment, StatefulSet1.16apps/v1
apps/v1beta2Deployment, StatefulSet, DaemonSet, ReplicaSet1.16apps/v1
networking.k8s.io/v1beta1Ingress, IngressClass1.22networking.k8s.io/v1
rbac.authorization.k8s.io/v1beta1Role, RoleBinding, ClusterRole, ClusterRoleBinding1.22rbac.authorization.k8s.io/v1
rbac.authorization.k8s.io/v1alpha1Role, RoleBinding, ClusterRole, ClusterRoleBinding1.22rbac.authorization.k8s.io/v1
batch/v1beta1CronJob1.25batch/v1
policy/v1beta1PodDisruptionBudget1.25policy/v1
policy/v1beta1PodSecurityPolicy1.25none; use Pod Security Admission
autoscaling/v2beta1HorizontalPodAutoscaler1.25autoscaling/v2
autoscaling/v2beta2HorizontalPodAutoscaler1.26autoscaling/v2
discovery.k8s.io/v1beta1EndpointSlice1.25discovery.k8s.io/v1
events.k8s.io/v1beta1Event1.25events.k8s.io/v1
node.k8s.io/v1beta1RuntimeClass1.25node.k8s.io/v1
storage.k8s.io/v1beta1CSIDriver, CSINode, StorageClass, VolumeAttachment1.22storage.k8s.io/v1
storage.k8s.io/v1beta1CSIStorageCapacity1.27storage.k8s.io/v1
apiextensions.k8s.io/v1beta1CustomResourceDefinition1.22apiextensions.k8s.io/v1
admissionregistration.k8s.io/v1beta1MutatingWebhookConfiguration, ValidatingWebhookConfiguration1.22admissionregistration.k8s.io/v1
certificates.k8s.io/v1beta1CertificateSigningRequest1.22certificates.k8s.io/v1
coordination.k8s.io/v1beta1Lease1.22coordination.k8s.io/v1
scheduling.k8s.io/v1beta1PriorityClass1.22scheduling.k8s.io/v1
flowcontrol.apiserver.k8s.io/v1beta1FlowSchema, PriorityLevelConfiguration1.26flowcontrol.apiserver.k8s.io/v1
flowcontrol.apiserver.k8s.io/v1beta2FlowSchema, PriorityLevelConfiguration1.29flowcontrol.apiserver.k8s.io/v1
flowcontrol.apiserver.k8s.io/v1beta3FlowSchema, PriorityLevelConfiguration1.32flowcontrol.apiserver.k8s.io/v1

Kubernetes YAML Linter for Manifests and Removed API Versions

Operator: Abdulla Al Fahad. How tools are built and checked

A Deployment written for Kubernetes 1.15 still pastes cleanly into an editor, and a cluster at 1.16 or later answers it with "no matches for kind Deployment in version extensions/v1beta1". This page finds that and the quieter problems: a selector that matches none of the pod's own labels, a container on nginx:latest with no requests, limits or probes, a privileged container, a hostPath mount of the Docker socket, a password typed into env. In the built-in example, a 38-line manifest with one Deployment and one Service produces 16 findings: 3 errors, 9 warnings and 4 notes.

The rules read plain manifests or rendered output from helm template and kustomize build. They do not contact a cluster, so they cannot know which Kubernetes version you run; the removal table below lists the release that dropped each apiVersion and you compare it with yours.

Key features

  • 24 rules over Pods and every kind that embeds a pod template: Deployment, StatefulSet, DaemonSet, ReplicaSet, ReplicationController, Job and CronJob
  • Multi-document YAML and kind: List, up to 500 documents or 2 MB, with the document and nearest line shown for each finding
  • A 26-row table of removed apiVersions with the release that dropped each and its replacement; rows that your file used are highlighted
  • Resource requests and limits, liveness and readiness probes, latest tags, privileged mode, root users, read-only root filesystem, privilege escalation, capabilities, seccomp and host namespaces
  • Selector and label checks, duplicate resources, duplicate container names and secret-looking env values
  • Findings grouped by resource, as a Markdown report and as SARIF 2.1.0
  • A clear refusal for Helm templates, with the line of the first {{

Which workloads are inspected and what each rule needs

Containers and init containers are both read. Requests, limits and probes are expected only on regular containers of long-running kinds (Pod, Deployment, StatefulSet, DaemonSet, ReplicaSet, ReplicationController); Jobs and CronJobs are not asked for probes. A container counts as non-root when runAsNonRoot is true or runAsUser is set to something other than 0 on the container or the pod, and a pod-level securityContext applies to every container that does not override it.

Missing memory limits are a warning but missing CPU limits are only a note, because many teams leave CPU unlimited on purpose to avoid throttling. hostPath is a warning for any path and the message calls out the root directory, /etc, /proc, /sys and the Docker, containerd and CRI-O sockets as the ones that expose the node. Duplicate detection ignores the API group, so an extensions/v1beta1 Deployment and an apps/v1 Deployment with the same name and namespace count as one object.

How it works

The YAML is parsed with the same multi-document reader as the YAML to JSON converter on this site, so anchors, merge keys and block scalars behave there as here. The parser does not keep source positions, so each finding's line is found by searching the document for the matching key, and for containers by counting list items under containers: and initContainers:. When two lines look alike, the first in that container wins, so treat the line as a pointer.

When to run it

  • A team upgrades a cluster from 1.24 to 1.26 and pastes every manifest in the repository to find the ones still using batch/v1beta1 CronJob or autoscaling/v2beta2, which the table shows were removed in 1.25 and 1.26.
  • Rendered Helm output for a chart is checked before release: the lint finds a Deployment whose spec.selector.matchLabels says app: web while the template labels say app: webapp.
  • A security review asks which workloads run privileged or mount host paths, and the SARIF export is filtered to rules K007 and K013.
  • A new service's manifest is checked for the first time and shows that none of its three containers has a readiness probe, so rolling updates would send traffic to pods that are still starting.

Running a check

  1. Paste the manifests or drop a .yaml file, with documents separated by ---, and press Lint manifests.
  2. Read errors first. Show notes if you want the full picture, since they are hidden by default.
  3. Open Why and how to fix on a finding, change the manifest, and lint again.

Example

A hardened Pod with an unpinned image

apiVersion: v1
kind: Pod
metadata:
  name: p
  labels:
    app: p
spec:
  containers:
    - name: c
      image: nginx:latest
      resources: {requests: {cpu: 100m, memory: 64Mi}, limits: {cpu: 200m, memory: 128Mi}}
      securityContext: {runAsNonRoot: true, readOnlyRootFilesystem: true, allowPrivilegeEscalation: false, capabilities: {drop: [ALL]}, seccompProfile: {type: RuntimeDefault}}

Findings

line 9 K004 warning: no livenessProbe
line 9 K005 warning: no readinessProbe
line 10 K006 warning: nginx:latest uses the latest tag
Requests, limits, non-root, read-only filesystem, no privilege escalation, dropped capabilities and a seccomp profile are all set, so those rules stay quiet.

Tips for best results

  • Put a label such as app.kubernetes.io/name on both metadata and the pod template: the label rule checks the workload's own metadata, and the selector rule checks the template.
  • For a quick scan of a large repository, concatenate the files with --- between them; findings name each resource, so they stay attributable.
  • Lint the output of helm template -f values-prod.yaml for each environment: replica counts, limits and image tags usually differ per values file, and so do the findings.
  • A finding names the namespace when the manifest sets one, so two copies of one Deployment in different namespaces are not reported as duplicates.

Limits

This is not a schema validator. A misspelled field such as resource: or an indentation slip that moves a key to the wrong level is not detected unless it changes something a rule reads; use kubectl apply --dry-run=server, or a schema validator such as kubeconform, for that.

Policy engines, admission controllers and Pod Security Admission levels can reject a pod this tool passes, and their defaults differ between clusters.

Custom resources are listed as resources and checked for duplicates and removed apiVersions only; their own fields are not inspected.

Probes defined on the container are checked for presence, not for sensible timings, ports or paths that exist.

Common errors and how to fix them

"Line 14 contains {{ ... }}, which looks like Helm template syntax"
Raw chart templates are not YAML. Run helm template ./chart (or kustomize build) and paste that output instead.
A parse error that ends with a line and column number
The YAML is invalid at that position. The usual causes are tab characters in the indentation, which YAML forbids, and a value that needs quotes because it contains a colon or a hash.
"Document 2 has no apiVersion"
The document is a mapping without apiVersion or kind, often a stray block after a --- separator. Add both fields or remove the document.

Frequently asked questions

Why are notes hidden by default?

Notes such as a missing CPU limit or seccomp profile describe choices that many clusters make deliberately. Warnings and errors are things that usually need action, so the list starts there; switch Notes on to see everything.

Which Kubernetes version does the apiVersion check assume?

None. Any apiVersion that appears in the table of removed versions is reported with the release that dropped it, so a cluster older than that release can still serve it. Compare the listed release with the version you run.