Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>KYAML - Kubernetes YAML ValidatorNew to Visual Studio Code? Get it now.
KYAML - Kubernetes YAML Validator

KYAML - Kubernetes YAML Validator

BSJ LLC

|
5 installs
| (0) | Free
Schema validation and syntax highlighting for KYAML (Kubernetes safer YAML subset)
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

KYAML - Kubernetes YAML Validator

A Visual Studio Code extension that provides schema validation and syntax highlighting for KYAML (Kubernetes safer YAML subset).

What is KYAML?

KYAML is a safer, less ambiguous subset of YAML designed specifically for Kubernetes configurations. It addresses common YAML pitfalls:

  • No implicit type coercion - Values like yes, no, on, off won't be silently converted to booleans
  • Flow-style syntax - Uses {} and [] instead of indentation, eliminating whitespace-related errors
  • Explicit strings - All string values must be double-quoted, preventing ambiguity

KYAML Example

---
{
  apiVersion: "v1",
  kind: "Pod",
  metadata: {
    name: "my-pod",
    labels: {
      app: "demo"
    }
  },
  spec: {
    containers: [{
      name: "nginx",
      image: "nginx:1.20"
    }]
  }
}

Features

  • Real-time validation - Validates KYAML files as you type
  • Syntax highlighting - Full syntax highlighting for .kyaml and .kyml files
  • Quick fixes - Automatic fixes for common issues (e.g., quoting strings)
  • YAML to KYAML conversion - Convert existing YAML files to KYAML format
  • Kubernetes manifest detection - Optionally validates YAML files containing Kubernetes manifests

Validation Rules

The extension checks for:

  1. Flow-style syntax - Documents must use {} and [] for structure
  2. Quoted strings - All string values must be double-quoted
  3. Document markers - Documents should start with ---
  4. Ambiguous values - Warns about values that might cause type coercion issues
  5. Indentation structure - Flags traditional YAML indentation-based syntax

Commands

  • KYAML: Validate Current File - Manually trigger validation
  • KYAML: Convert YAML to KYAML - Convert the current YAML document to KYAML format

Configuration

Setting Default Description
kyaml.validate true Enable/disable KYAML validation
kyaml.validateOnSave true Validate files on save
kyaml.validateOnType true Validate files while typing
kyaml.strictMode true Enforce strict KYAML rules

File Extensions

The extension automatically activates for:

  • .kyaml files
  • .kyml files
  • YAML files containing Kubernetes manifests (when strict mode allows)

Installation

From Source

  1. Clone this repository
  2. Run bun install
  3. Run bun run compile
  4. Press F5 to launch the extension in debug mode

Package VSIX

vsce package

From VSIX

  1. Download the .vsix file
  2. Run code --install-extension vscode-kyaml-x.x.x.vsix

Development

# Install dependencies
bun install

# Compile TypeScript
bun run compile

# Watch for changes
bun run watch

# Run linting
bun run lint

License

MIT

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft