Simple validators for client-side validation and server-side validation of Kubernetes resources.
Show/hide folder structure
.
├── .github
│ └── workflows
├── Devantler.KubernetesValidator.ClientSide.Core
├── Devantler.KubernetesValidator.ClientSide.Polaris
├── Devantler.KubernetesValidator.ClientSide.Polaris.Tests
├── Devantler.KubernetesValidator.ClientSide.Schemas
├── Devantler.KubernetesValidator.ClientSide.Schemas.Tests
│ ├── SchemaValidatorTests
│ └── assets
│ ├── k8s-invalid
│ │ ├── apps
│ │ ├── clusters
│ │ │ └── ksail-default
│ │ │ └── flux-system
│ │ └── infrastructure
│ │ └── controllers
│ └── k8s-valid
│ ├── apps
│ ├── clusters
│ │ └── ksail-default
│ │ └── flux-system
│ └── infrastructure
│ └── controllers
├── Devantler.KubernetesValidator.ClientSide.YamlSyntax
├── Devantler.KubernetesValidator.ClientSide.YamlSyntax.Tests
│ ├── YamlSyntaxValidatorTests
│ └── assets
│ ├── k8s-invalid
│ │ ├── apps
│ │ ├── clusters
│ │ │ └── ksail-default
│ │ │ └── flux-system
│ │ └── infrastructure
│ │ └── controllers
│ └── k8s-valid
│ ├── apps
│ ├── clusters
│ │ └── ksail-default
│ │ └── flux-system
│ └── infrastructure
│ └── controllers
├── Devantler.KubernetesValidator.ServerSide.Core
├── Devantler.KubernetesValidator.ServerSide.Polaris
└── Devantler.KubernetesValidator.ServerSide.Polaris.Tests
45 directories
To get started, you can install the packages from NuGet.
dotnet add package Devantler.KubernetesValidator.ClientSide.YamlSyntax
dotnet add package Devantler.KubernetesValidator.ClientSide.Schemas
dotnet add package Devantler.KubernetesValidator.ClientSide.Polaris
dotnet add package Devantler.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 Devantler.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 Devantler.KubernetesValidator.ServerSide.Polaris;
var validator = new PolarisValidator("path/to/kubeconfig", "context-name");
var isValid = validator.Validate();