keikoproj / manager

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

Namespace Management #4

Closed mnkg561 closed 4 years ago

mnkg561 commented 4 years ago

Is this a BUG REPORT or FEATURE REQUEST?: FEATURE REQUEST

What happened: We need to support the following functionality as part of Namespace Management

  1. Allow users to configure steps involved in Namespace Creation.
  2. Must allow options to choose applicable clusters

What you expected to happen:

  1. Users should be able to design namespace creation template based on environment, cluster and cloud.
  2. New namespace creation should create the namespace based on the template it is referenced to.

How to reproduce it (as minimally and precisely as possible):

Anything else we need to know?:

Environment:

Other debugging information (if applicable):

- controller logs:

$ kubectl logs

wanghong230 commented 4 years ago

Should we keep using the argo workflow? The template should be extensible to add some extra things than just the manifests. What could be the options?

mnkg561 commented 4 years ago

ManagedNamespace provides following in high level clusterName params: templateName: NamespaceResources Namespace Resources

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. For more info on NamespaceResources please refer NamespaceTemplate issue https://github.com/keikoproj/manager/issues/20

mnkg561 commented 4 years ago

Sample Template:

apiVersion: manager.keikoproj.io/v1alpha1
kind: ManagedNamespace
metadata:
  name: second-namespace
  namespace: docker-desktop
spec:
  clusterName: docker-desktop
  params:
    env: "preprod"
    registry: "docker.io"
    name: "second-namespace"
  templateName: namespacetemplate-sample