crate.operator.config module

class crate.operator.config.Config(*, prefix)

Bases: object

The central configuration hub for the operator.

To access the config from another module, import crate.operator.config.config and access its attributes.

Parameters

prefix (str) –

AFTER_UPDATE_TIMEOUT = 3600
BEFORE_UPDATE_TIMEOUT = 86400

Time in seconds for which the operator will continue and wait to perform checks before and after a cluster update. Once the threshold has passed, an update is considered failed.

BOOTSTRAP_RETRY_DELAY: Optional[int] = 60

Time in seconds between the retries when bootstrapping the cluster. This can be safely lowered if the k8s environment is quick to act and the pods are quick to start up.

BOOTSTRAP_TIMEOUT: int = 1800

Time in seconds for which the operator will continue and wait to bootstrap a cluster. Once this threshold has passed, a bootstrapping is considered failed

CLOUD_PROVIDER: Optional[CloudProvider] = None

When set, enable special handling for the defind cloud provider, e.g. on AWS pass the availability zone as a CrateDB node attribute.

CLUSTER_BACKUP_IMAGE: Optional[str] = None

The Docker image that contains scripts to run cluster backups.

CLUSTER_UPDATE_TIMEOUT = 7200

Time in seconds for which the operator will continue and wait to perform an update of a cluster, either scaling a cluster up or down or upgrading a cluster. Once this threshold has passed, an update is considered failed.

CRATEDB_STATUS_CHECK_INTERVAL: Optional[int] = 60

Interval in seconds for which the operator will ping CrateDBs for their current health.

DEBUG_VOLUME_SIZE: Byte = GiB(64.0)

The volume size for the PersistentVolume that is used as a storage location for Java heap dumps.

DEBUG_VOLUME_STORAGE_CLASS: str = 'crate-standard'

The Kubernetes storage class name for the PersistentVolume that is used as a storage location for Java heap dumps.

EXPAND_VOLUME_TIMEOUT = 1800

Time in seconds for which the operator will continue and wait to perform a check if volume expansion has finished successfully. Once this threshold has passed, volume expansion is considered failed or not supported by the StorageClass.

GATEWAY_SETTINGS_DATA_NODES_VERSION: str = '4.7.0'

From which version onwards CrateDB gateway settings expected_data_nodes and recover_after_data_nodes must be used instead of expected_nodes and recover_after_nodes

GC_SENTRY_DSN: Optional[str] = None

Grand Central Sentry DSN

HEALTH_CHECK_RETRY_DELAY: Optional[int] = 30

Delay between health checks when waiting for a cluster to become ready. This can be safely lowered if the k8s environment is quick to act and the pods are quick to start up.

IMAGE_PULL_SECRETS: Optional[List[str]] = None

A list of image pull secrets. Separate names by ,.

JMX_EXPORTER_VERSION: str

JMX exporter version

JOBS_TABLE: str = 'sys.jobs'

Which table are the running jobs stored in. This is only changed in tests.

KUBECONFIG: Optional[str] = None

The path the Kubernetes configuration to use.

LOG_LEVEL: str = 'INFO'

The log level to use for all CrateDB operator related log messages. WARNING: Settings this to DEBUG or lower may print sensitive information (i.e. Kubernetes secrets) into the logs. DEBUG or below should not be used in production environments.

NO_DOWNTIME_STORAGE_EXPANSION: bool = False

Do not scale down cluster when performing storage expansion. The underlying infrastructure must support this - i.e. Azure or AWS CSI volumes.

PARALLEL_TESTING: bool = False

Allows running tests in parallel. If enabled, filters the CrateDB resources by the PID in which they were created, allowing multiple operators to run in parallel.

PROMETHEUS_PORT: int = 8080

The port on which prometheus exposes metrics

RESTORE_BACKUP_SECRET_NAME = 'restore-from-backup-{name}'

Name of the secret containing credentials to access the source backup when restoring a snapshot.

RESTORE_BACKUP_TIMEOUT = 86400

Time in seconds for which the operator will continue and wait to restore a snapshot. Once the threshold has passed, a restore operation is considered failed.

RE_ENABLING_CRONJOB_DELAY = 3600

Delay before re-enabling cronjobs

ROLLING_RESTART_TIMEOUT = 3600

Time in seconds for which the operator will continue and wait to perform a rolling restart of a cluster. Once this threshold has passed, a restart is considered failed.

SCALING_TIMEOUT = 3600

Time in seconds for which the operator will continue and wait to scale a cluster up or down, including deallocating nodes before turning them off. Once the threshold has passed, a scaling operation is considered failed.

SQL_EXPORTER_IMAGE: str = 'burningalchemist/sql_exporter:0.11.1'

The sql_exporter image to use

TESTING: bool = False

Enable several testing behaviors, such as relaxed pod anti-affinity to allow for easier testing in smaller Kubernetes clusters.

WEBHOOK_PASSWORD: Optional[str] = None

HTTP Basic Auth password for web requests made to WEBHOOK_URL.

WEBHOOK_URL: Optional[str] = None

Full URL where the operator will send HTTP POST requests to when certain events occured.

WEBHOOK_USERNAME: Optional[str] = None

HTTP Basic Auth username for web requests made to WEBHOOK_URL.

env(name, *, default=<object object>)

Retrieve the environment variable name or fall-back to its default if provided. If no default is provided, a ConfigurationError is raised.

Parameters

name (str) –

Return type

str

load()
crate.operator.config.config = <crate.operator.config.Config object>

The global instance of the CrateDB operator config