Kubernetes labels

How Kubernetes labels are used on K8ssandra objects.

The operator places the following labels on the objects it creates:

Standard Kubernetes labels

From recommended labels:

Label Value
app.kubernetes.io/name k8ssandra-operator
app.kubernetes.io/part-of k8ssandra
app.kubernetes.io/component One of: cassandra, stargate, reaper or telemetry

These labels are purely informational.

The keys and values are defined in constants.go.

Labels specific to the operator

Objects associated with a K8ssandraCluster are labelled with k8ssandra.io/cluster-namespace and k8ssandra.io/cluster-name. This is used:

  • to establish watches. See the SetupWithManager() function in k8ssandracluster_controller.go.
  • in conjunction with k8ssandra.io/cleaned-up-by, to mark objects that should get cleaned up when the K8ssandraCluster is deleted, see cleanup.go. Note that we only use this mechanism for relationships that cross Kubernetes contexts; when the objects are in the same Kubernetes cluster, we rely on standard owner references instead.

labels.go provides functions to manipulate those sets of labels.


Last modified April 18, 2024: Release v1.15.0 (9071e39)