Skip to content

Simple .NET libraries for various Kubernetes client-side and runtime validators.

License

Notifications You must be signed in to change notification settings

devantler/dotnet-kubernetes-validator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

75 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

✅ .NET Kubernetes Validator

License Test codecov

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

Prerequisites

🚀 Getting Started

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

📝 Usage

Client-side validation

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();

Server-side validation

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();

About

Simple .NET libraries for various Kubernetes client-side and runtime validators.

Resources

License

Security policy

Stars

Watchers

Forks

Sponsor this project

 

Packages

 
 
 

Contributors 4

  •  
  •  
  •  
  •  

Languages