crate.operator.change_compute module¶
- class crate.operator.change_compute.AfterChangeComputeSubHandler(namespace, name, ref, context, depends_on=None, run_on_dep_failures=False)¶
Bases:
StateBasedSubHandler
A handler which depends on``restart`` having finished successfully and sends a success notification of the change compute process.
- class crate.operator.change_compute.ChangeComputeSubHandler(namespace, name, ref, context, depends_on=None, run_on_dep_failures=False)¶
Bases:
StateBasedSubHandler
- async crate.operator.change_compute.change_cluster_compute(apps, namespace, name, compute_change_data, logger)¶
Patches the statefulset with the new cpu and memory requests and limits.
- Parameters
apps (
AppsV1Api
) –namespace (
str
) –name (
str
) –compute_change_data (
WebhookChangeComputePayload
) –logger (
Logger
) –
- crate.operator.change_compute.generate_body_patch(name, compute_change_data, logger)¶
Generates a dict representing the patch that will be applied to the statefulset. That patch modifies cpu/memory requests/limits based on compute_change_data. It also patches affinity as needed based on the existence or not of requests data.
- Parameters
name (
str
) –compute_change_data (
WebhookChangeComputePayload
) –logger (
Logger
) –
- Return type
- crate.operator.change_compute.generate_change_compute_payload(old, body)¶