keikoproj / manager

Multi K8s cluster Namespace Management
Apache License 2.0
9 stars 3 forks source link

namespace management #22

Closed mnkg561 closed 4 years ago

mnkg561 commented 4 years ago

close https://github.com/keikoproj/manager/issues/21 close https://github.com/keikoproj/manager/issues/20 close https://github.com/keikoproj/manager/issues/25 close https://github.com/keikoproj/manager/issues/19 close https://github.com/keikoproj/manager/issues/23 Could you share the solution in high level? There are 2 CRDs included in the namespace management now.

  1. NamespaceTemplate (nt)

  2. ManagedNamespace(mns)

  3. NamespaceTemplate provides following in high level exportedParams NamespaceResources Namespace Resources

    • Name Type DependsOn: CreateOnly OneOf{ ServiceAccount Role RoleBinding ResourceQuota }
    • Name Type DependsOn: CreateOnly OneOf{ ServiceAccount Role RoleBinding ResourceQuota }

ExportedParams: Params which can to be replaced runtime and should use ${param} in the manifests

DependsOn: By default, Namespace will be created first and any resources under Resources section will be created in parallel. To control the dependency structure one can use DependsOn parameter to force the execution only once its dependent resource has been created.

CreateOnly: If any resource needs to be created only once and should not be overwritten can use CreateOnly parameter to enforce it.

Resource: Type should dictate what Resource being included in the resource section and any other resource manifests included in that resource section will be ignored. For ex: To create a service account, Type should be ServiceAccount and should include serviceAccount: section

  1. ManagedNamespace provides following in high level clusterName params: templateName: NamespaceResources Namespace Resources
    • Name Type DependsOn: CreateOnly OneOf{ ServiceAccount Role RoleBinding ResourceQuota }
    • Name Type DependsOn: CreateOnly OneOf{ ServiceAccount Role RoleBinding ResourceQuota }.

clusterName: Name of the cluster in which this namespace needs to be created

params: map[string]string - this should be used to provide the runtime values for the exportedParams for the namespace template

templateName: Name of the namespace template to be used for this and namespace template must exists. Optional

NamespaceResources: Additional resources to be created in addition to the template provided and can also be used to create namespace directly without using template.

Could you share the test results?

codecov[bot] commented 4 years ago

Codecov Report

Merging #22 into master will decrease coverage by 0.19%. The diff coverage is 26.58%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #22      +/-   ##
==========================================
- Coverage   31.41%   31.21%   -0.20%     
==========================================
  Files           8       13       +5     
  Lines         468     1009     +541     
==========================================
+ Hits          147      315     +168     
- Misses        311      676     +365     
- Partials       10       18       +8     
Impacted Files Coverage Δ
controllers/application_controller.go 0.00% <0.00%> (ø)
controllers/cluster_controller.go 0.00% <0.00%> (ø)
pkg/k8s/client.go 0.00% <0.00%> (ø)
controllers/managednamespace_controller.go 14.21% <14.21%> (ø)
pkg/k8s/custom.go 31.57% <34.28%> (+31.57%) :arrow_up:
pkg/k8s/rbac.go 61.26% <34.61%> (-10.33%) :arrow_down:
pkg/k8s/resources.go 38.18% <42.85%> (+6.93%) :arrow_up:
internal/utils/utils.go 47.50% <66.66%> (ø)
pkg/template/template.go 71.05% <71.05%> (ø)
pkg/validation/namespace.go 100.00% <100.00%> (ø)
... and 6 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 0419d6f...59cc1dc. Read the comment docs.