coryodaniel / bonny

The Elixir based Kubernetes Development Framework
MIT License
385 stars 27 forks source link

Application CRD integration #76

Open coryodaniel opened 4 years ago

coryodaniel commented 4 years ago

App Sig

For controllers that are creating multiple resources on behalf of a CRD.

Not exactly sure of the best way to integrate this, and not positive that all operators would benefit from it. So it may be best to implement as a module that could be used from a lifecycle function or possible as an additional library that can be included if needed.

I was thinking of implementing it as a struct that mimics the Application CRD's OpenAPI spec, but would accept a set of resource maps as well.

app = %Application{
  name: "wordpress-01",
  version: 3,
  components: [],
  assembly_phase: "Pending",
  descriptor: %{
    # version: 
    # description:
    # icons:
    # type:
    # maintainers:
    # owners:
    # keywords:
    # links:
  }
}

deployment = %{
  kind: "Deployment",
  # ...
}

service = %{
  kind: "Service",
  # ...
}

app
|> Application.add_component(deployment)
|> Application.add_component(service)
|> Application.apply

Application.apply/1 would apply each component resource w/ proper labels to integrate w/ the Application CRD and finally create the Application resource

mruoss commented 2 years ago

I'd like to close this as won't do. I don't see value in it. Taking it out of 1.0 milestone for now.