crate.operator.upgrade module¶
- class crate.operator.upgrade.AfterUpgradeSubHandler(namespace, name, ref, context, depends_on=None, run_on_dep_failures=False)¶
Bases:
StateBasedSubHandler
A handler which depends on
upgrade
andrestart
having finished successfully and sends a success notification of the upgrade process.
- class crate.operator.upgrade.UpgradeSubHandler(namespace, name, ref, context, depends_on=None, run_on_dep_failures=False)¶
Bases:
StateBasedSubHandler
- async crate.operator.upgrade.update_statefulset(apps, namespace, sts_name, crate_image, old_version, new_version, data_nodes_count, logger)¶
- async crate.operator.upgrade.upgrade_cluster(apps, namespace, name, body, old, logger)¶
Update the Docker image in all StatefulSets for the cluster.
For the changes to take affect, the cluster needs to be restarted.
- Parameters
apps (
AppsV1Api
) – An instance of the Kubernetes Apps V1 API.namespace (
str
) – The Kubernetes namespace for the CrateDB cluster.name (
str
) – The name for theCrateDB
custom resource.body (
Body
) – The full body of theCrateDB
custom resource perkopf.Body
.old (
Body
) – The old resource body. Required to get the old version.logger (
Logger
) –
- crate.operator.upgrade.upgrade_command(old_command, total_data_nodes)¶
Iterate through the
old_command
items and upgrade the setting’s names where required in versions >= 4.7.Return the list making up the new CrateDB command.
- Parameters
old_command (
List
[str
]) – The command used to start-up CrateDB inside a Kubernetes container. This consists of the path to the Docker entrypoint script, thecrate
command argument and any additional settings.total_data_nodes (
int
) – The number of data nodes that will be in the CrateDB cluster. From that, the quorum is derived as well.
- Return type
- Returns
The list forming the new CrateDB command.