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@bd405d35e41180483a520e5a7f94d0e1069178c5
Entrypoint
Return Type
Kubeconform !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
base | Container | - | a custom base image containing an installation of kubeconform |
Example
dagger -m github.com/purpleclay/daggerverse/kubeconform@bd405d35e41180483a520e5a7f94d0e1069178c5 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
Name | Type | Default Value | Description |
---|---|---|---|
crds | [File ! ] ! | - | a list of paths to local Kubernetes CRD files to transform |
Example
dagger -m github.com/purpleclay/daggerverse/kubeconform@bd405d35e41180483a520e5a7f94d0e1069178c5 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
Name | Type | Default Value | Description |
---|---|---|---|
crds | [String ! ] ! | - | a list of URLs to remote Kubernetes CRD files to transform |
Example
dagger -m github.com/purpleclay/daggerverse/kubeconform@bd405d35e41180483a520e5a7f94d0e1069178c5 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
Name | Type | Default Value | Description |
---|---|---|---|
dirs | [Directory ! ] | - | a path to a directory containing Kubernetes manifests (YAML and JSON) for validation |
ignoreMissingSchemas | Boolean | - | skip files with missing schemas instead of failing |
insecureSkipTlsVerify | Boolean | - | disable verification of the server's SSL certificate |
kubernetesVersion | String | "master" | the version of kubernertes to validate against, e.g. 1.31.0 |
goroutines | Integer | 4 | the 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 |
show | Boolean | - | print results for all resources (verbose) |
skip | [String ! ] | - | a comma-separated list of kinds or GVKs to ignore |
strict | Boolean | - | disallow additional properties not in schema or duplicated keys |
summary | Boolean | - | print a summary at the end |
Example
dagger -m github.com/purpleclay/daggerverse/kubeconform@bd405d35e41180483a520e5a7f94d0e1069178c5 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()
}