Selectors are an array of criteria that match resources which belong to the database application. For example, if the action is associated with a
StatefulSet, then the selectors describe how to match the pods within the
StatefulSet.
Selectors can have multiple logical terms, which are logically combined with AND statements to match resources. Logical terms can match on the
Labels,
Annotations, or
Name fields, and provide filter expressions.
Labels and annotations support key-value pair matching. Names support regular-expression matching.
The selector order serializes the actions on each resource. For pods, the selector order controls the order in which each pod is backed up.
Before deploying the application template, verify that your key-value pairs and regular expressions correctly match all pods and select the pods in the correct order.
Example
An application template applies to a MySQL cluster with one
StatefulSet. The application label is a key-value pair that is named
app with the value
mysql. The following selectors match:
A primary pod with a name that contains the suffix "-0".
Secondary pods with names that contain suffixes that start at "-1" and increment.
Remember that secondary pods are backed up before the primary pod.