ValidYML is a VS Code extension that validates Kubernetes manifests, Docker Compose files, and MCP (Model Context Protocol) client configs as you edit them, and can clean up Kubernetes YAML in one command.
- Required fields:
kind,apiVersion,metadata.name - Containers and init containers in Pods and in templated workloads (Deployment, StatefulSet, DaemonSet, ReplicaSet, Job, CronJob)
- Multi-document files (
----separated) - Checks:
- Untagged or
:latestimages (digest-pinned@sha256:images are accepted) - Missing
resources.limits privilegedcontainers (error)- Missing
readinessProbeon Deployments and StatefulSets
- Untagged or
- Detected by filename or by shape (a top-level
services:mapping), includingcompose.yaml/compose.yml - Checks:
- Services need
imageorbuild - Untagged or
:latestimages privilegedservices (error)- Hardcoded secrets in
environment(map and list forms) and malformed variable substitution - Docker socket mounts and host bind mounts (named volumes are not flagged)
- Obsolete top-level
versionfield - External networks that also set a driver
- Services need
- Validates
.mcp.json,mcp.json,claude_desktop_config.json, and any*.mcp.json - Checks:
- Transport shape: exactly one of
command(stdio) orurl(remote) - Deprecated
ssetransport (use Streamable HTTP) and unknown transport types - Hardcoded secrets in
env(${VAR}references are fine) - Unpinned
npx/uvx/pipxpackages - Remote servers over plain
http://
- Transport shape: exactly one of
- Removes null and empty values
- Removes common defaults:
namespace: default,protocol: TCPon Service ports,imagePullPolicy: IfNotPresent, and default termination message settings - Reformats consistently
- Open Visual Studio Code
- Go to Extensions (Ctrl+Shift+X)
- Search for "ValidYML"
- Click Install
Or install from the VS Code Marketplace.
Access these commands through the Command Palette (Ctrl+Shift+P):
ValidYML: Validate Current File- Manually trigger validationValidYML: Clean Current File- Clean and format the current Kubernetes YAML file
Results appear in the Problems panel and as inline diagnostics.
validyml.enableAutoValidation(defaulttrue): validate files as they are opened or edited. Reload the window after changing it.
apiVersion: v1
kind: Pod
metadata:
name: web
spec:
containers:
- name: web
image: nginx:latestValidation will show:
- Warning: Container 'web' uses an untagged or ':latest' image
- Warning: Container 'web' has no resources.limits
Before:
apiVersion: v1
kind: Service
metadata:
namespace: default
spec:
ports:
- port: 80
protocol: TCP
selector:
app: nullAfter:
apiVersion: v1
kind: Service
spec:
ports:
- port: 80- Visual Studio Code 1.96.0 or higher
- Cleaning is Kubernetes-oriented; don't run it on Compose or MCP files
- Some advanced Kubernetes CRDs are only checked for the basic required fields
See CHANGELOG.md.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the Apache-2.0 License - see the LICENSE file for details.
For support, please open an issue in the GitHub repository or contact the maintainers.
- Based on the ValidYML project
- Uses YAML parsing from yaml.js
- Inspired by Kubernetes best practices
Animesh Pathak - Sonichigo
Active development - Contributions welcome!