Skip to content
This repository has been archived by the owner on Jun 8, 2022. It is now read-only.

Standards of what makes a workload to be OAM workload #201

Open
wonderflow opened this issue Sep 7, 2020 · 1 comment
Open

Standards of what makes a workload to be OAM workload #201

wonderflow opened this issue Sep 7, 2020 · 1 comment

Comments

@wonderflow
Copy link
Member

wonderflow commented Sep 7, 2020

As we have used OAM in more use cases now, traits can hardly doing anything if we don't have any consensus. So I propose we should setup a base line for OAM standard workload, so that OAM traits will be able to work more smoothly with standard workload.

Note that, this doesn't mean non-standard workload can not work, any extended workload can still run under the control of OAM runtime, but have to do extra traits‘ implementation for these non-standard workload.

Characteristics of the standard workload

labels

Standard workload instance should have at least these three labels, it will be automatically added by OAM runtime:

app.oam.dev/name: <OAM AppConfigName>
app.oam.dev/component: <OAM ComponentName>
app.oam.dev/revision: <OAM ComponentRevisionName>
app.oam.dev/resourceType: WORKLOAD

Replica

Standard workload should have replica as a K8s sub resource

And make replica as part of status including replicas, unavailableReplicas and updatedReplicas.

spec:
  replica: 3
status:
    replicas: 2
    unavailableReplicas: 2
    updatedReplicas: 2 

ObservedGeneration

observedGeneration field of status in K8s object is widely used in K8s built-in resource. It reflects the generation of the most recently observed Object.

LastTransactionTime

A time field indicating when was the workload object was reconciled, mostly used for judging if it's timeout.

Config Hash

indicating whether it's configuration(something out of the spec, for example Configmap or Secret)is dynamically changed.

Ports (PodSpec?)

A standard workload should expose it's ports.

TODO..

@Ghostbaby
Copy link
Contributor

Maybe it should expose the Resource configuration

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants