Simple validators for client-side validation and server-side validation of Kubernetes resources.
To get started, you can install the packages from NuGet.
dotnet add package DevantlerTech.KubernetesValidator.ClientSide.YamlSyntax
dotnet add package DevantlerTech.KubernetesValidator.ClientSide.Schemas
dotnet add package DevantlerTech.KubernetesValidator.ClientSide.Polaris
dotnet add package DevantlerTech.KubernetesValidator.ServerSide.Polaris
To use the client-side validators, all you need to do is to create an instance of the validator and call the Validate
method with the directory path to the resources you want to validate.
using DevantlerTech.KubernetesValidator.ClientSide.YamlSyntax;
var validator = new YamlSyntaxValidator("path/to/resources");
var isValid = validator.Validate();
To use the server-side validators, all you need to do is to create an instance of the validator and call the Validate
method with the kubeconfig file path and the context name.
using DevantlerTech.KubernetesValidator.ServerSide.Polaris;
var validator = new PolarisValidator("path/to/kubeconfig", "context-name");
var isValid = validator.Validate();