#19340 Validate Helm deployments using Kubeconform
Issue created by
alonsodomin
Is your feature request related to a problem? Please describe.
While the Helm backend supports good validation techniques that help spot errors early (linting and unit testing), still leaves the door open to the possibility of errors during deployment when the final Kubernetes manifests are rejected due to invalid configuration choices. Having support for a definitive validation of the final rendered manifests would be of great help to prevent that possibility.
There are a few tools that could be used to do it, so to not force end users to pick one, these could be opted-in as extension backends to the Helm one.
Describe the solution you'd like
Kubecoform is one of those tools. It's pretty fast and can perform validation of standard resources as well of CRDs.
The implementation needs to perform the validation at the final rendering stage, after applying post-renderers, so it's suggested to be bound to the
check
goal on the
helm_deployment
target. That way, if any other target in the dependency graph also needs to the built (i.e. sources of compiled languages being packaged into Docker images) it won't cost extra time or come up as a surprise to the end user.
To activate Kubeconform, the users would need to add the
pants.backend.experimental.helm.check.kubeconform
backend to their list of active backends in
pants.toml
.
Describe alternatives you've considered
Kubeval was considered but it has been superseded by Kubeconform and is no longer maintained.
Additional context
N/A
pantsbuild/pants