# consts package

labels, annotations and tags are metadata attached to resources
* tags.go: used to tag cloud resources
* labels.go: used to label k8s resources
* annotations.go: used to annotate k8s resources

For the difference between labels and annotations, use labels if you need to select k8s resources by labels. Otherwise it's suggested to use annotations for internal logic. Annotations are string typed fields, if the logic needs to be expanded to several annotations, then consider defining them in the spec.

## metadata guideline

Regional CR resources should contain following labels:
* `cloud.pingcap.com/tenant`
* `cloud.pingcap.com/project`
* `cloud.pingcap.com/cluster` (if resource belongs to a specific cluster)
* `cloud.pingcap.com/provider-type` (optional)
* `cloud.pingcap.com/region` (optional)

Cloud resources should contain following tags for billing & cost analysis:
* `tenant`
* `project`
* `cluster` (if resource belongs to a specific cluster)
* `environment`
* `servicetype`
* `usedby`
* `component`

Dataplane k8s node should contain following labels for scheduling:
* `tidbcloud.com/node-pool-k8s-version`
* `kubernetes.io/arch` (system managed)
* `node.kubernetes.io/instance-type` (system managed)
* `topology.kubernetes.io/zone` (system managed)

Dataplane kernel component pods should contain following labels:
* `app.kubernetes.io/instance`: the parent CR name
* `app.kubernetes.io/component`
