Closed bartoszmajsak closed 2 months ago
To start out, it is important to start with the motivation of why labels matter and when they are useful:
oc get all -l "app.kubernetes.io/name=my-app"
)app.kubernetes.io/version: 1.2.3
)The next consideration after why you might label something is what kinds of things you want to label. Within the ODH ecosystem there are a few different types of objects that jump out to me:
This group has the ability to dictate what labels are added to all of the objects mentioned above, except for the objects that users create.
Any labels on objects that users create (including those that are created through the dashboard) should be a recommendation and not a requirement. If a label is required on a user managed object, that label should be automatically added to the object as part of a webhook.
Labels such as the following:
opendatahub.io/created-by: dashboard
Make sense for objects such as a dashboardConfig
CR that the dashboard has automatically created when it was installed.
However, opendatahub.io/created-by: dashboard
should not be required on a user managed object such as a Project, PVC, Notebook, DSPA, etc. We can default to setting this label on objects created by the Dashboard, but that label should not be required to interact with that object on the dashboard. I know that the Dashboard does use labels to filter what objects appear in the Dashboard today, but I know they have mentioned they want to re-evaluate some of those requirements.
I think that the manifests deployed by the DSC is one of the easiest areas to start with. I see a couple of labels that I think would be useful for every component. Below is an example of some labels that I would expect to be
opendatahub.io/ds-component: dataSciencePipelines <1>
opendatahub.io/version: 1.6.1 <2>
opendatahub.io/name: default <3>
opendatahub.io/managed-by: odh-operator <4>
odh-operator
.Another example use case that is fairly easy to standardize would be the objects owned by individual components CRs. For example, on a database created by a DSPA, I might expect to see the following:
opendatahub.io/component: database <1>
opendatahub.io/version: 1.6.1 <2>
opendatahub.io/name: my-ds-pipeline <3>
opendatahub.io/managed-by: data-science-pipelines-operator <4>
Some additional resources to take a look at....
Upstream k8s has a list of common labels they recommend on applications here: https://kubernetes.io/docs/concepts/overview/working-with-objects/common-labels/
Additionally, there is a list of "well known" labels here: https://kubernetes.io/docs/reference/labels-annotations-taints/#app-kubernetes-io-managed-by
A great blog on some label best practices and more info on how users use labels: https://blog.kubecost.com/blog/kubernetes-labels/
Thanks for all the thoughts you shared @strangiato. I wouldn't put it better, but it's exactly what I have in mind with this ADR. I will expand on the ideas based on your feedback and provide more concrete examples in the doc.
One additional aspect to consider here is that with standardized labeling we can define the topology of RHOAI and so make it easier for the users to define e.g. traffic control rules.
create https://issues.redhat.com/browse/RHOAIENG-8386 to capture this PR
This PR is stale because it has been open 21 days with no activity. Remove stale label or comment or this will be closed in 7 days.
This PR was closed because it has been stale for 21+7 days with no activity.
This document is intended to kick-off an initiative to standardize labeling strategy in Open Data Hub.
This is RFC - request for comments at this point, as there is a lot of unknown unknows for me here :)
This is more a work-in-progress doc than an actual decision record, so I am keeping it in
DRAFT