Dagger
Search

kubeconform

Kubeconform can help avoid mistakes and keep Kubernetes setups smooth and trouble-free. It's designed for high performance,
and uses a self-updating fork of the schemas registry to ensure up-to-date schemas. It supports both YAML and JSON
manifest files. It can handle CRDs too.

Installation

dagger install github.com/purpleclay/daggerverse/kubeconform@723df11baa358c8ca700cd6f4636319f811b729c

Entrypoint

Return Type
Kubeconform !
Arguments
NameTypeDefault ValueDescription
baseContainer -a custom base image containing an installation of kubeconform
Example
dagger -m github.com/purpleclay/daggerverse/kubeconform@723df11baa358c8ca700cd6f4636319f811b729c 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 🔗

Kubeconform dagger module

withLocalCrds() 🔗

Generates OpenAPI JSON schemas from the provided local Kubernetes CRDs and adds them as a schema location to the kubeconform base image. Schemas are generated using the same directory structure as https://github.com/datreeio/CRDs-catalog

Return Type
Kubeconform !
Arguments
NameTypeDefault ValueDescription
crds[File ! ] !-a list of paths to local Kubernetes CRD files to transform
Example
dagger -m github.com/purpleclay/daggerverse/kubeconform@723df11baa358c8ca700cd6f4636319f811b729c call \
 with-local-crds
func (m *myModule) example(crds []*File) *Kubeconform  {
	return dag.
			Kubeconform().
			WithLocalCrds(crds)
}
@function
def example(crds: List[dagger.File]) -> dag.Kubeconform:
	return (
		dag.kubeconform()
		.with_local_crds(crds)
	)
@func()
example(crds: File[]): Kubeconform {
	return dag
		.kubeconform()
		.withLocalCrds(crds)
}

withRemoteCrds() 🔗

Generates OpenAPI JSON schemas from the provided remote Kubernetes CRDs and adds them as a schema location to the kubeconform base image. Schemas are generated using the same directory structure as https://github.com/datreeio/CRDs-catalog

Return Type
Kubeconform !
Arguments
NameTypeDefault ValueDescription
crds[String ! ] !-a list of URLs to remote Kubernetes CRD files to transform
Example
dagger -m github.com/purpleclay/daggerverse/kubeconform@723df11baa358c8ca700cd6f4636319f811b729c call \
 with-remote-crds --crds string1 --crds string2
func (m *myModule) example(crds []string) *Kubeconform  {
	return dag.
			Kubeconform().
			WithRemoteCrds(crds)
}
@function
def example(crds: List[str]) -> dag.Kubeconform:
	return (
		dag.kubeconform()
		.with_remote_crds(crds)
	)
@func()
example(crds: string[]): Kubeconform {
	return dag
		.kubeconform()
		.withRemoteCrds(crds)
}

validate() 🔗

Check and validate your Kubernertes manifests for conformity against the Kubernetes OpenAPI specification. This flexibility, allows your manifests to be easily validated against different Kubernetes versions. Includes support for validating against CRDs

Return Type
String !
Arguments
NameTypeDefault ValueDescription
dirs[Directory ! ] -a path to a directory containing Kubernetes manifests (YAML and JSON) for validation
ignoreMissingSchemasBoolean -skip files with missing schemas instead of failing
insecureSkipTlsVerifyBoolean -disable verification of the server's SSL certificate
kubernetesVersionString "master"the version of kubernertes to validate against, e.g. 1.31.0
goroutinesInteger 4the number of goroutines to run concurrently during validation
files[File ! ] -a path to a Kubernetes manifest file (YAML or JSON) for validation
reject[String ! ] -a comma-separated list of kinds or GVKs to reject
schemaLocation[String ! ] -override the schema search location path
showBoolean -print results for all resources (verbose)
skip[String ! ] -a comma-separated list of kinds or GVKs to ignore
strictBoolean -disallow additional properties not in schema or duplicated keys
summaryBoolean -print a summary at the end
Example
dagger -m github.com/purpleclay/daggerverse/kubeconform@723df11baa358c8ca700cd6f4636319f811b729c call \
 validate
func (m *myModule) example(ctx context.Context) string  {
	return dag.
			Kubeconform().
			Validate(ctx)
}
@function
async def example() -> str:
	return await (
		dag.kubeconform()
		.validate()
	)
@func()
async example(): Promise<string> {
	return dag
		.kubeconform()
		.validate()
}