cybozu-go / accurate

Kubernetes controller for multi-tenancy. It propagates resources between namespaces accurately and allows tenant users to create/delete sub-namespaces.
https://cybozu-go.github.io/accurate/
Apache License 2.0
38 stars 5 forks source link

Naming policy #6

Closed ymmt2005 closed 2 years ago

ymmt2005 commented 3 years ago

What

Currently, Accurate does not impose any naming policy on SubNamespaces. This means that tenant users can name their sub-namespaces freely, which would cause chaos.

So, implement a naming policy and impose it with a validating webhook for SubNamespace.

How

This is just a thought. Add the following field to the configuration file.

namingPolicies:
- root: "tenant1"
  match: "tenant1-.*"
- root: ".*"
  match: "dev-.*"

root and match are both regular expressions. When a SubNamespace is created in a tree starting from a root namespace and the root namespace's name matches root expression, the SubNamespace name is validated with match expression.

Checklist