Closed Nalum closed 8 months ago
Or should it be like this?
#App: string & strings.MaxRunes(63)
// Standard Kubernetes labels: part of, instance name, version and managed-by.
labels: {
"\(#StdLabelPartOf)": #App
"\(#StdLabelInstance)": name
"\(#StdLabelVersion)": #Version
"\(#StdLabelManagedBy)": "timoni"
}
And then in each object the module maintainer would set:
metadata: labels: "\(timoniv1.#StdLabelName)": "controller"
metadata: labels: "\(timoniv1.#StdLabelName)": "webhook"
metadata: labels: "\(timoniv1.#StdLabelName)": "controller-config"
metadata: labels: "\(timoniv1.#StdLabelName)": "webhook-config"
The instance name and namespace are set automatically by Timoni's server-side apply engine to track ownership, every object has these labels in cluster:
instance.timoni.sh/name: <NAME>
instance.timoni.sh/namespace: <NAMESPACE>
Given this, I didn't want to add the Kubernetes instance label as it would be confusing.
I suggest you add the app.kubernetes.io/part-of
label to your modules, this can be done in the #Config
with:
#Config: {
metadata: labels: (timoniv1.#StdLabelPartOf): "cert-manager"
}
(moved this comment to a new issue https://github.com/stefanprodan/timoni/issues/338)
Should the Timoni schema be updated so that the name provided to
timoni build
is set in the labelapp.kubernetes.io/instance
and then the labelapp.kubernetes.io/name
is set in the config as part of the metadata setup?https://github.com/stefanprodan/timoni/blob/f44c6a8f11d915998616ae0394e73b760bd70439/schemas/timoni.sh/core/v1alpha1/metadata.cue#L44-L49