crate.operator.upgrade module¶
- class crate.operator.upgrade.AfterUpgradeSubHandler(namespace, name, ref, context, depends_on=None, run_on_dep_failures=False, operation=None)¶
Bases:
StateBasedSubHandlerA handler which depends on
upgradeandrestarthaving finished successfully and sends a success notification of the upgrade process.
- class crate.operator.upgrade.BeforeUpgradeSubHandler(namespace, name, ref, context, depends_on=None, run_on_dep_failures=False, operation=None)¶
Bases:
StateBasedSubHandlerA handler which checks if there are any resources created with an old crateDB version.
- class crate.operator.upgrade.UpgradeSubHandler(namespace, name, ref, context, depends_on=None, run_on_dep_failures=False, operation=None)¶
Bases:
StateBasedSubHandler
- async crate.operator.upgrade.check_reindexing_tables(core, namespace, name, body, old, logger)¶
Check if there are any tables that need re-indexing before a major version upgrade.
- Parameters:
core (
CoreV1Api) – An instance of the Kubernetes Core V1 API.namespace (
str) – The Kubernetes namespace for the CrateDB cluster.name (
str) – The name for theCrateDBcustom resource.body (
Body) – The full body of theCrateDBcustom resource perkopf.Body.old (
Body) – The old resource body. Required to get the old version.logger (
Logger)
- async crate.operator.upgrade.check_unsafe_upgrade_paths(core, namespace, name, body, old, logger)¶
Block upgrades to CrateDB 6.0.0–6.0.5 if the cluster contains tables created before CrateDB 5.5, which are affected by a data-loss bug.
- Parameters:
core (
CoreV1Api) – An instance of the Kubernetes Core V1 API.namespace (
str) – The Kubernetes namespace for the CrateDB cluster.name (
str) – The name for theCrateDBcustom resource.body (
Body) – The full body of theCrateDBcustom resource perkopf.Body.old (
Body) – The old resource body. Required to get the old version.logger (
Logger)
- async crate.operator.upgrade.recreate_internal_tables(core, namespace, name, body, old, logger)¶
Re-create internal tables that may have been created with an old CrateDB major version.
- Parameters:
core (
CoreV1Api) – An instance of the Kubernetes Core V1 API.namespace (
str) – The Kubernetes namespace for the CrateDB cluster.name (
str) – The name for theCrateDBcustom resource.body (
Body) – The full body of theCrateDBcustom resource perkopf.Body.old (
Body) – The old resource body. Required to get the old version.logger (
Logger)
- async crate.operator.upgrade.update_statefulset(apps, namespace, sts_name, crate_image, old_version, new_version, data_nodes_count, name, cloud_settings, 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 theCrateDBcustom resource.body (
Body) – The full body of theCrateDBcustom resource perkopf.Body.old (
Body) – The old resource body. Required to get the old version.logger (
Logger)
- crate.operator.upgrade.upgrade_command_data_nodes(old_command, total_data_nodes)¶
Iterate through the
old_commanditems 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, thecratecommand 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.
- crate.operator.upgrade.upgrade_command_global_jwt_config(command, name, cloud_settings)¶
- crate.operator.upgrade.upgrade_command_hostname_and_zone(old_command)¶
Replace old patterns using
rev | cutwith new awk-based equivalents.Return the list making up the new CrateDB command.
- crate.operator.upgrade.upgrade_command_jwt_auth(command)¶
Add the settings required for JWT authentication if they are not present yet.
Return the list making up the new CrateDB command.
- Parameters:
- Return type:
- Returns:
The list forming the new CrateDB command.