instrumenta / instrumenta/kubeval

invalid service/deployment name passes kubeval

Open
#70 2 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Go
Stars
3.2k
Forks
227
PR merge metrics
No merged PRs in 30d

Description

I ran a yaml file through kubeval and didn't get any errors. Later when I tried to apply the config to Minikube I got the below

```

Error from server (Invalid): error when creating "kubernetes.yaml": Service "Foo" is invalid: metadata.name: Invalid value: "Foo": a DNS-1035 label must consist of lower case alphanumeric characters or '-', start with an alphabetic character, and end with an alphanumeric character (e.g. 'my-name', or 'abc-123', regex used for validation is '[a-z]([-a-z0-9]*[a-z0-9])?')

Error from server (Invalid): error when creating "kubernetes.yaml": Deployment.apps "Bar" is invalid: metadata.name: Invalid value: "Bar": a DNS-1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')

```

Changing the service/deployment `'metadata' > 'name'` per the errors allowed me to apply the yaml file to Minikube.

Kubeval should check service/deployment configurations against the regex listed in the above error.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.