Open resouer opened 4 years ago
A related issue: whether we need to make k8s built-in capabilities work for ContainerizedWorkload?
There are two scenarios actually:
targetRef
, so we could probably auto-inject childResource to it (it's a common pattern for any other higher level abstraction).As catalog is the recommended repo for OAM components/traits/applications, how about we moving proper Apps from oam-dev/samples
to application
folder?
@zzxwill I agree catalog/applications
could be categories as "user stories", similar to https://github.com/tektoncd/catalog . Though we don't need to touch oam-dev/samples
- this is where official demo apps live.
One example is:
catagory
├── applications
│ ├── knative
│ ├── kubernetes # show off how to generate definitions and 4-5 examples of popular k8s apps
│ ├── openfaas
│ └── ...
├── workloads
│ ├── terraform # 1000+ workloads generated from Terraform modules
│ └── ...
├── traits
├── scopes
/cc @wonderflow
In general, there're two main features of OAM as a model:
kubectl get traits
kubectl tree
)workloadRef
(orownerRef
)As K8s standard app definition:
We need to make sure ANY existing k8s resource can be defined as trait/workload/scope with zero effort. /cc @zzxwill I'd suggest modeling every application you can find in cloud native community, for example: https://github.com/istio/istio/tree/master/samples/bookinfo by OAM and put the example YAML in
catalog/applications
or somewhere else. Please work with @szihai on this.Open question: how to handle xxxDefinition in this case? Let's create a tool (e.g. cli)?
As an abstraction framework:
Traits in OAM should be mostly external capabilities or higher level abstractions for built-in capabilities, not "translation" of k8s built-in api resources. I've raised similar concern in https://github.com/oam-dev/catalog/issues/26#issuecomment-645595071.
Similarly, workloads should come from wider community like Terraform/Crossplane, not StatefulSet, Deployment etc.
For instance, it's less valuable to create a ServiceExpose trait which simply removed label selectors - user should define k8s service as trait freely.
workloadRef
is an internal helper for building abstractions yet itself is not "better user experience".A perfect example of how a trait is defined is Ingress API v2: https://containo.us/blog/kubernetes-ingress-service-api-demystified. Though there are still opportunities like
Route
,Blue-green/Canary
, monitoring, logging and many. What's still missing in Kubernetes today?Building abstractions with zero effort is important, decomposition/composition is great and we also need to improve its UX. /cc @wonderflow