Open davidxia opened 6 years ago
This is a bug in the Kubernetes OpenAPI schemas on which kubeval relies unfortunately. It's likely worth filing upstream too.
@garethr, thanks for responding. I guess the validation should've been generated here? Do you mind creating an issue upstream? I'm afraid I'm not familiar enough with how things should be setup in a way that'll work.
@garethr Any idea how to fix that ? Create an issue on the main kubernetes repository ?
The error is saying that the namespace name "example.com/dxia-test" is invalid because it contains the slash '/' which is not allowed. The namespace name must follow the DNS naming rules, this means that it can only contain lowercase letters, numbers and hyphens and cannot begin or end with hyphens.
The solution would be to change the namespace name to something like "example-com-dxia-test". In fact, this needs to be added to kubeval for better code checking.
Thanks for this useful tool.
I noticed Namespace names aren't validated. Here's my Namespace manifest.
Expected behavior
The validator gives me the same error as kubectl
Actual behavior
But when I run the validator on that file I get an OK.
More info
I think these are the k8s validation rules. So I think it's lower case alphanumeric characters or '-', and must start and end with an alphanumeric character (e.g. 'my-name', or '123-abc', regex used for validation is
[a-z0-9]([-a-z0-9]*[a-z0-9])?
).