oam-dev / spec

Open Application Model (OAM).

Home Page:https://oam.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Generic Traits (or standard traits) proposal

resouer opened this issue · comments

Consider "built-in" a set of essential patch traits in OAM Kubernetes platform (and hopefully works in all OAM platforms), regardless of what kind of encapsulation the component is using (Helm, CUE, ARM, raw CRD etc).

These trait should be essential in majority real world cases and eagerly required by users in app delivery workflow, we will not re-create kustomize or cue, e.g. for generic patch, please use CUE based components/traits instead.

Here is the first list I have by hand for day 1:

  • Sidecar Trait
    • inject given sidecar to workload instance, the implementation could to be configmap + webhook
  • Dapr Trait
    • enable Dapr for the workload instance, the implementation is similar to (1), just add label to pod instead

For day 2, we could build a path to promote mostly widely used patch traits in CUE based component as essential traits.

This type of standard trait might be sufficient for things that can be handled via static configuration. However we have found that many traits need to introspect the system to collect the information required. Of course in most cases the user could be expected to collect and provide this information but that places undue burden on the user. More importantly the user may not have the privileges required to obtain that information but trail controller may.