Feature Request: JSON Schema to validate k0s config
Is your feature request related to a problem? Please describe.
Hey k0 maintainers,
Right now, if I create or edit a k0s.yaml file there isn't a way for my IDE to give me hints about the what each key/value expects and I have to refer back to the config file reference https://docs.k0sproject.io/stable/configuration/#configuration-file-reference each time.
Ideally, I'd like my IDE to be able to validate the schema as I'm typing it and give me hints like field descriptions and type warnings.
Describe the solution you would like
I was wondering if you'd be interested in having a jsonschema (https://json-schema.org/) generated and checked into the repo for the k0s.yaml config file.
It has integrations with a lot of tools to validate the structure of the config file and can be used by IDE's for code-completion.
There's a couple of golang libraries / build tools that could generate this for you using the go structs within the codebase: https://json-schema.org/tools?query=&sortBy=name&sortOrder=ascending&groupBy=languages&licenses=&languages=&drafts=&toolingTypes=&environments=&showObsolete=false#go
Describe alternatives you've considered
I've looked for VS Code extensions to support the k0s config file syntax for code completion / validation but it doesn't exist in the marketplace as of today.
Alternatively, I tried the k0s validate command via the CLI. Which works for a high-level validation, but it doesn't assist with actually writing or editing the file moving forward. Just checks if it's a valid config.
Additional context
This might be a pre-requisite for this issue to be completed: https://github.com/k0sproject/k0sctl/issues/860
Source: k0sproject/k0s