# Labels

> Understand resource labeling by Stackable operators and tools like stackablectl and Helm for better management and organization.

Labels are key/value pairs in the metadata of Kubernetes objects that add identifying information to the object. They do not have direct semantic implications but can be used to organize and manage resources. The [`stackablectl`](https://docs.stackable.tech/management/stable/stackablectl/index.md) tool and the Helm Charts both add labels to the resources that are part of a [Stacklet](https://docs.stackable.tech/home/stable/concepts/stacklet/index.md). The operators add labels to the resources they create.

## Resource labels added by the operators

Every resource created by a Stackable operator has a common set of labels applied. Some of these labels are [recommended](https://kubernetes.io/docs/concepts/overview/working-with-objects/common-labels/) to use by the Kubernetes documentation. The following labels are added to resources created by our operators:

-   `app.kubernetes.io/name` - The name of the product, i.e. `druid` or `zookeeper`.

-   `app.kubernetes.io/version` - The version of the product and Stackable version, i.e. `3.3.4-stackable24.3.0`

-   `app.kubernetes.io/instance` - The name of the Stacklet.

-   `app.kubernetes.io/component` - This is the [role](https://docs.stackable.tech/home/stable/concepts/stacklet/index.md) that this resource belongs to.

-   `app.kubernetes.io/role-group` - The name of the [role group](https://docs.stackable.tech/home/stable/concepts/stacklet/index.md) that a resource belongs to.

-   `app.kubernetes.io/managed-by` - Which software manages this resource? This will be the operator, i.e. `kafka-operator`.


also this:

-   `stackable.tech/vendor` with value `Stackable`.


## Labels added by tools

The resources associated with an operator installation are also labeled (or can be).

### stackablectl

#### Installing operators and releases

When installing operators and releases, `stackablectl` will always label the Deployment, ConfigMap, ClusterRole etc. with

-   `stackable.tech/vendor=Stackable`


#### Stacks and demos

When installing a stack or a demo, `stackablectl` adds additional labels to identify the parts of the stack or demo:

-   `stackable.tech/stack` with the value being the Stack name.

-   `stackable.tech/demo` with the value being the Demo name.

-   `stackable.tech/managed-by=stackablectl`


These labels are attached to the demo and stack manifests, which include Secret, ConfigMap or ClusterRole.

> **Note:** The Stacklets themselves and external dependencies are not yet labeled with the Stack or Demo that they belong to.

### Helm

The Helm Charts for the Stackable operators support specifying labels in the `values.yaml` file. All resources deployed by the Helm Chart (Deployment, ClusterRole, Configmap, etc.) will have the labels attached when the operator is deployed. The default set of labels includes:

-   `stackable.tech/vendor=Stackable`


## Further reading

Take a look at [ADR031: Resource Labels and Namespacing](https://docs.stackable.tech/home/stable/contributor/adr/ADR031-resource-labels/index.md) if you want to find out about the design decisions for our labels.
