Editor schemas for Kubernetes-style manifests ΒΆ
These schemas cover Kubernetes-style Nais manifests such as Application, Naisjob, and Topic. The SchemaStore schema validates supported resources in the Nais manifest format instead. For those resources, see Schema validation and auto-completion.
Available schemas:
Nais resources and Kubernetes resources:
https://storage.googleapis.com/nais-json-schema-2c91/nais-k8s-all.jsonNais resources only (Application, Naisjob, and Topic):
https://storage.googleapis.com/nais-json-schema-2c91/nais-all.jsonAssociate one of these schemas with your files in the editor. The SchemaStore file association alone does not validate these Kubernetes-style resources.
VSCode, VSCodium and other VSCode flavours ΒΆ
Install the YAML extension from Visual Studio Marketplace.
Install for non-offical distributions
Visit the marketplace and find "Download Extension" in the right-hand menu, under "Resources".
Then in your editor, open the Extensions page and click the ... in the top right of the sidebar, then "Install from VSIX".
Alternatively, CTRL/CMD+Shift+P and search for VSIX.
Configure ΒΆ
Open settings.json by pressing CTRL/CMD+, and search for Preferences: Open Settings(JSON).
Add this to the root object:
{
"yaml.schemas": {
"https://storage.googleapis.com/nais-json-schema-2c91/nais-k8s-all.json": [".nais/app.yaml", ".nais/job.yaml", ".nais/topic.yaml"]
}
}This associates the Kubernetes-style schema with the listed files. Add nais.yaml if you use that name for a Kubernetes-style manifest. Avoid matching every file in .nais/: that would also select this schema for other Nais manifests.
See the extension documentations for more ways to associate schemas.
IntelliJ ΒΆ
See the documentation at Jetbrains.
Unfortunately, you will have to set this up individually per project.
Known limitations ΒΆ
Templating ΒΆ
One of the limitations is that the templating language used by e.g. nais-deploy isn't valid YAML.
In documents with limited templating, e.g. just having and {{image}}, wrapping it in quotes is usually enough when the value is a string.
For other types, there's currently no workaround.
So instead of having:
spec:
image: {{image}}Try:
spec:
image: "{{image}}"