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

Set labels/annotations of sub-namespaces #7

Closed ymmt2005 closed 2 years ago

ymmt2005 commented 3 years ago

What

Currently, Accurate does not allow tenant users to set new labels/annotations to sub-namespaces created from SubNamespace objects.

It is handy to allow tenant users to set new labels/annotations only when:

  1. the label/annotation key is included in the configuration file, and
  2. the label/annotation is not set for the parent namespace.

How

  1. Add new fields to SubNamespace, for example, spec.labels and spec.annotations
  2. Enhance accurate-controller to create a sub-namespace with the specified labels/annotations.

accurate-controller has to ignore labels/annotations whose key is not listed in the configuration file.

It also should not set labels/annotations if the same labels/annotations are set for the parent namespace. Nevertheless, the value would be overwritten by the existing Namespace controller to the value of the parent labels/annotations.

Describe how to address the issue.

Checklist

ymmt2005 commented 2 years ago

implemented in #19.