mayadata-io / d-operators

Declarative patterns to write kubernetes controllers
Apache License 2.0
10 stars 7 forks source link

feat: proposal to implement a declarative kubernetes controller #95

Open AmitKumarDas opened 4 years ago

AmitKumarDas commented 4 years ago

ProblemStatement: As a K8s engineer

AmitKumarDas commented 4 years ago

High Level Design Draft 0

NOTE: kind: UberLoop will be the name of this new resource NOTE: UberLoop will depend on existing Kubernetes custom & native resources to implement new use cases NOTE: Jsonnet will be used to achieve the desired state NOTE: Jsonnet will be used since the main assumption is to manipulate one or more Kubernetes resources that adhere to json schema NOTE: Jsonnet will be used since Golang can make use of this lib NOTE: UberLoop will use metac as a library NOTE: UberLoop may not use any of the metac's meta controllers NOTE: UberLoop might design its own meta controllers that is tightly coupled with Jsonnet NOTE: UberLoop might need to adopt CRDs that are not yet in the system yet but will be eventually

AmitKumarDas commented 4 years ago

Specifications Draft 0

Minimal specs

kind: UberLoop
spec:
  parent:
  children:
  attachments:
  sync:

Detailed specs

kind: UberLoop
spec:
  parent: # resource under watch; [optional]
    apiVersion:
    resource:
    selector:
  children: # resources related to parent; [optional]
  - apiVersion:
    resource:
    selector:
  attachments: # resources that may or may not be related to parent; [optional]
  - apiVersion:
    resource:
    selector:
  sync:
    jsonnet: 
      labelSelector: # use 'kind: ConfigMap' resources
      inline:
      - # inline jsonnet doc
      - # can be used if jsonnet doc is very small
    command: 
      labelSelector: # use 'kind: Command' resources