datreeio / datree

Prevent Kubernetes misconfigurations from reaching production (again 😤 )! From code to cloud, Datree provides an E2E policy enforcement solution to run automatic checks for rule violations. See our docs: https://hub.datree.io
https://datree.io
Apache License 2.0
6.4k stars 359 forks source link

Add optional rule to lint kubernetes resource names #945

Closed netanel-haber-deci closed 1 year ago

netanel-haber-deci commented 1 year ago

Problem Kubernetes enforces restrictions on some resource names. For instance, this error was raised in production for a volume name containing underscores: "a lowercase RFC 1123 label must consist of lower case alphanumeric characters or '-', and must start and end with an alphanumeric character." These were not enforced in a later dry run - late-stage enforcement on an example like volume names is error-prone and risky.

Solution A cli linting rule to validate some or all of the naming constraints.

Alternatives