kubeconform
kubeconform is a tool that validates Kubernetes resources against the Kubernetes OpenAPI specification. It checks if Kubernetes manifests (YAML or JSON files containing Kubernetes resources) conform to the specification.- Validates standalone YAML files and kustomization files.
- Excludes specific directories from validation.
- Converts CRDs into JSONSchemas.
- Supports additional schemas from the Datree Catalog
- Support Flux variables substitution.
Refer to the Readme for more information on how to use this module: https://github.com/Smana/daggerverse/tree/main/kubeconform
Installation
dagger install github.com/Smana/daggerverse/kubeconform@v0.0.3
Entrypoint
Return Type
Kubeconform
Example
dagger -m github.com/Smana/daggerverse/kubeconform@c08dafe5305257d421eadb2e235819408aa76755 call \
func (m *myModule) example() *Kubeconform {
return dag.
Kubeconform()
}
@function
def example() -> dag.Kubeconform:
return (
dag.kubeconform()
)
@func()
example(): Kubeconform {
return dag
.kubeconform()
}
Types
Kubeconform 🔗
version() 🔗
Kubeconform version to use for validation.
Return Type
String !
Example
dagger -m github.com/Smana/daggerverse/kubeconform@c08dafe5305257d421eadb2e235819408aa76755 call \
version
func (m *myModule) example(ctx context.Context) string {
return dag.
Kubeconform().
Version(ctx)
}
@function
async def example() -> str:
return await (
dag.kubeconform()
.version()
)
@func()
async example(): Promise<string> {
return dag
.kubeconform()
.version()
}
validate() 🔗
Validate the Kubernetes manifests in the provided directory and optional source CRDs directories
Return Type
String !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
version | String | "v0.6.6" | Kubeconform version to use for validation. |
manifests | Directory ! | - | Base directory to walk through in order to validate Kubernetes manifests. |
kustomize | Boolean | - | kustomize if set to true it will look for kustomization.yaml files and validate them otherwise it will validate all the YAML files in the directory. |
exclude | String | - | exclude is string listing directories or files to exclude from the validation separated by commas (example: "./terraform,.gitignore"). |
catalog | Boolean | false | catalog is a boolean that if set to true it will use the Datree catalog to validate the manifests. (ref: https://github.com/datreeio/CRDs-catalog) |
flux | Boolean | false | flux is a boolean that if set to true it will download the flux binary. |
fluxVersion | String | "2.3.0" | fluxVersion is the version of the flux binary to download. |
crds | [String ! ] | - | crds is a list of URLs containing the CRDs to validate against. |
env | [String ! ] | - | a list of environment variables, expected in (key:value) format |
Example
dagger -m github.com/Smana/daggerverse/kubeconform@c08dafe5305257d421eadb2e235819408aa76755 call \
validate --manifests DIR_PATH
func (m *myModule) example(ctx context.Context, manifests *Directory) string {
return dag.
Kubeconform().
Validate(ctxmanifests)
}
@function
async def example(manifests: dagger.Directory) -> str:
return await (
dag.kubeconform()
.validate(manifests)
)
@func()
async example(manifests: Directory): Promise<string> {
return dag
.kubeconform()
.validate(manifests)
}