Closed PabloCastellano closed 5 years ago
Ya, this seems like it would be useful.
[jodewey:~/git/konfig] % kubeval foo.yaml
The document foo.yaml contains a valid DaemonSet
[jodewey:~/git/konfig] % cat foo.yaml
apiVersion: invalid
kind: DaemonSet
metadata:
namespace: foo
labels:
foo: bar
Especially when kubectl barfs
[jodewey:~/git/konfig] % kubectl apply --dry-run --validate -f foo.yaml
error: unable to recognize "foo.yaml": no matches for kind "DaemonSet" in version "invalid"
I have a feeling this project has fallen by the wayside. :(
I've not had much time of late to work on the project but I'm hoping I should have a bunch more time now. Proper handling of APIVersion is definitely desirable.
This should now be correctly handled in the newly released 0.8.0 version.
Hello.
I'm interested on a new feature for kubeval to validate the
apiVersion
field given a specific Kubernetes version. Do you have any plans to add it? I am willing to contribute.This tool could be powerfully used together with
helm template
. This command generates the kubernetes manifest from the Helm chart, and allows specifying the--kube-version
parameter to generate a manifest compatible with a specific version of Kubernetes. This parameter is used by helpers like this one.Ideally
kubeval
should also be able to validate that the generated manifest is valid for 1.9 (usesapiVersion: rbac.authorization.k8s.io/v1
) and for 1.6 (requiresapiVersion: rbac.authorization.k8s.io/v1beta1
instead).