Cassandra operations task CassandraTask
The CassandraTask is a custom resource definition (CRD) that enables you to perform operational tasks on your database clusters.
You create and manage these tasks using kubectl.
To create a task, you apply a YAML manifest file that specifies the operation you want to perform. For example, to restart a cluster:
kubectl apply -f restart-task.yaml
The manifest filename indicates the type of operation, such as restart-task.yaml, and the spec.jobs.command: field contains the specific task value, such as restart.
|
DataStax Mission Control provides several release-specific CRDs for use with the UI, |
CassandraTask manifest
The following example shows a CassandraTask manifest for a restart operation:
apiVersion: control.k8ssandra.io/v1alpha1
kind: CassandraTask
metadata:
name: TASK_NAME
namespace: NAMESPACE
spec:
concurrencyPolicy: Forbid
datacenter:
name: DATACENTER_NAME
namespace: NAMESPACE
jobs:
- args: {}
command: restart
name: JOB_NAME
restartPolicy: Never
ttlSecondsAfterFinished: 0
Replace the following:
-
TASK_NAME: A unique name for this task operation -
NAMESPACE: The Kubernetes namespace where you deploy your database cluster -
DATACENTER_NAME: The name of your datacenter -
JOB_NAME: The specific job within the task
Task retry behavior
In Mission Control version 1.18.0 and later, the retry_count parameter in the jobs.args section controls how many times Mission Control retries a failed task before Mission Control marks it as failed.
See Configure task retry behavior for configuration details.
Parallel operations
Mission Control version 1.18.0 and later supports parallel pod operations in CassandraTask resources to improve operational efficiency for tasks such as restart, rebuild, and node replacement.
Refer to the specific operation documentation for configuration details: