Cluster API Reference
Packages:
- apps.kubeblocks.io/v1
- apps.kubeblocks.io/v1alpha1
- apps.kubeblocks.io/v1beta1
- workloads.kubeblocks.io/v1
- workloads.kubeblocks.io/v1alpha1
apps.kubeblocks.io/v1
Resource Types:
- Cluster
- ClusterDefinition
- Component
- ComponentDefinition
- ComponentVersion
- ServiceDescriptor
- ShardingDefinition
- SidecarDefinition
Cluster
Cluster offers a unified management interface for a wide variety of database and storage systems:
Relational databases: MySQL, PostgreSQL, MariaDB
NoSQL databases: Redis, MongoDB
KV stores: ZooKeeper, etcd
Analytics systems: ElasticSearch, OpenSearch, ClickHouse, Doris, StarRocks, Solr
Message queues: Kafka, Pulsar
Distributed SQL: TiDB, OceanBase
Vector databases: Qdrant, Milvus, Weaviate
Object storage: Minio
KubeBlocks utilizes an abstraction layer to encapsulate the characteristics of these diverse systems. A Cluster is composed of multiple Components, each defined by vendors or KubeBlocks Addon developers via ComponentDefinition, arranged in Directed Acyclic Graph (DAG) topologies. The topologies, defined in a ClusterDefinition, coordinate reconciliation across Cluster’s lifecycle phases: Creating, Running, Updating, Stopping, Stopped, Deleting. Lifecycle management ensures that each Component operates in harmony, executing appropriate actions at each lifecycle stage.
For sharded-nothing architecture, the Cluster supports managing multiple shards, each shard managed by a separate Component, supporting dynamic resharding.
The Cluster object is aimed to maintain the overall integrity and availability of a database cluster, serves as the central control point, abstracting the complexity of multiple-component management, and providing a unified interface for cluster-wide operations.
Field | Description | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
| ||||||||||||||||||
|
| ||||||||||||||||||
Kubernetes meta/v1.ObjectMeta | Refer to the Kubernetes API documentation for the fields of the
| ||||||||||||||||||
ClusterSpec |
| ||||||||||||||||||
ClusterStatus |
ClusterDefinition
ClusterDefinition defines the topology for databases or storage systems, offering a variety of topological configurations to meet diverse deployment needs and scenarios.
It includes a list of Components and/or Shardings, each linked to a ComponentDefinition or a ShardingDefinition, which enhances reusability and reduce redundancy. For example, widely used components such as etcd and Zookeeper can be defined once and reused across multiple ClusterDefinitions, simplifying the setup of new systems.
Additionally, ClusterDefinition also specifies the sequence of startup, upgrade, and shutdown between Components and/or Shardings, ensuring a controlled and predictable management of cluster lifecycles.
Field | Description | ||
---|---|---|---|
|
| ||
|
| ||
Kubernetes meta/v1.ObjectMeta | Refer to the Kubernetes API documentation for the fields of the
| ||
ClusterDefinitionSpec |
| ||
ClusterDefinitionStatus |
Component
Component is a fundamental building block of a Cluster object. For example, a Redis Cluster can include Components like ‘redis’, ‘sentinel’, and potentially a proxy like ‘twemproxy’.
The Component object is responsible for managing the lifecycle of all replicas within a Cluster component, It supports a wide range of operations including provisioning, stopping, restarting, termination, upgrading, configuration changes, vertical and horizontal scaling, failover, switchover, cross-node migration, scheduling configuration, exposing Services, managing system accounts, enabling/disabling exporter, and configuring log collection.
Component is an internal sub-object derived from the user-submitted Cluster object. It is designed primarily to be used by the KubeBlocks controllers, users are discouraged from modifying Component objects directly and should use them only for monitoring Component statuses.
Field | Description | ||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
| ||||||||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||||||||||
Kubernetes meta/v1.ObjectMeta | Refer to the Kubernetes API documentation for the fields of the
| ||||||||||||||||||||||||||||||||||||||||||||||||
ComponentSpec |
| ||||||||||||||||||||||||||||||||||||||||||||||||
ComponentStatus |
ComponentDefinition
ComponentDefinition serves as a reusable blueprint for creating Components, encapsulating essential static settings such as Component description, Pod templates, configuration file templates, scripts, parameter lists, injected environment variables and their sources, and event handlers. ComponentDefinition works in conjunction with dynamic settings from the ClusterComponentSpec, to instantiate Components during Cluster creation.
Key aspects that can be defined in a ComponentDefinition include:
PodSpec template: Specifies the PodSpec template used by the Component.
Configuration templates: Specify the configuration file templates required by the Component.
Scripts: Provide the necessary scripts for Component management and operations.
Storage volumes: Specify the storage volumes and their configurations for the Component.
Pod roles: Outlines various roles of Pods within the Component along with their capabilities.
Exposed Kubernetes Services: Specify the Services that need to be exposed by the Component.
System accounts: Define the system accounts required for the Component.
Monitoring and logging: Configure the exporter and logging settings for the Component.
ComponentDefinitions also enable defining reactive behaviors of the Component in response to events, such as member join/leave, Component addition/deletion, role changes, switch over, and more. This allows for automatic event handling, thus encapsulating complex behaviors within the Component.
Referencing a ComponentDefinition when creating individual Components ensures inheritance of predefined configurations, promoting reusability and consistency across different deployments and cluster topologies.
Field | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
Kubernetes meta/v1.ObjectMeta | Refer to the Kubernetes API documentation for the fields of the
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
ComponentDefinitionSpec |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
ComponentDefinitionStatus |
ComponentVersion
ComponentVersion is the Schema for the componentversions API
Field | Description | ||||
---|---|---|---|---|---|
|
| ||||
|
| ||||
Kubernetes meta/v1.ObjectMeta | Refer to the Kubernetes API documentation for the fields of the
| ||||
ComponentVersionSpec |
| ||||
ComponentVersionStatus |
ServiceDescriptor
ServiceDescriptor describes a service provided by external sources.
It contains the necessary details such as the service’s address and connection credentials.
To enable a Cluster to access this service, the ServiceDescriptor’s name should be specified
in the Cluster configuration under clusterComponent.serviceRefs[*].serviceDescriptor
.
Field | Description | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
| ||||||||||||||
|
| ||||||||||||||
Kubernetes meta/v1.ObjectMeta | Refer to the Kubernetes API documentation for the fields of the
| ||||||||||||||
ServiceDescriptorSpec |
| ||||||||||||||
ServiceDescriptorStatus |
ShardingDefinition
ShardingDefinition is the Schema for the shardingdefinitions API
Field | Description | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
| ||||||||||||||
|
| ||||||||||||||
Kubernetes meta/v1.ObjectMeta | Refer to the Kubernetes API documentation for the fields of the
| ||||||||||||||
ShardingDefinitionSpec |
| ||||||||||||||
ShardingDefinitionStatus |
SidecarDefinition
SidecarDefinition is the Schema for the sidecardefinitions API
Field | Description | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
| ||||||||||||||
|
| ||||||||||||||
Kubernetes meta/v1.ObjectMeta | Refer to the Kubernetes API documentation for the fields of the
| ||||||||||||||
SidecarDefinitionSpec |
| ||||||||||||||
SidecarDefinitionStatus |
Action
(Appears on:ComponentLifecycleActions, Probe, ShardingLifecycleActions, MembershipReconfiguration)
Action defines a customizable hook or procedure tailored for different database engines, designed to be invoked at predetermined points within the lifecycle of a Component instance. It provides a modular and extensible way to customize a Component’s behavior through the execution of defined actions.
Available Action triggers include:
postProvision
: Defines the hook to be executed after the creation of a Component, withpreCondition
specifying when the action should be fired relative to the Component’s lifecycle stages:Immediately
,RuntimeReady
,ComponentReady
, andClusterReady
.preTerminate
: Defines the hook to be executed before terminating a Component.roleProbe
: Defines the procedure which is invoked regularly to assess the role of replicas.switchover
: Defines the procedure for a controlled transition of a role to a new replica.memberJoin
: Defines the procedure to add a new replica to the replication group.memberLeave
: Defines the method to remove a replica from the replication group.readOnly
: Defines the procedure to switch a replica into the read-only state.readWrite
: Defines the procedure to transition a replica from the read-only state back to the read-write state.dataDump
: Defines the procedure to export the data from a replica.dataLoad
: Defines the procedure to import data into a replica.reconfigure
: Defines the procedure that update a replica with new configuration.accountProvision
: Defines the procedure to generate a new database account.
Actions can be executed in different ways:
ExecAction: Executes a command inside a container. A set of predefined environment variables are available and can be leveraged within the
exec.command
to access context information such as details about pods, components, the overall cluster state, or database connection credentials. These variables provide a dynamic and context-aware mechanism for script execution.HTTPAction: Performs an HTTP request. HTTPAction is to be implemented in future version.
GRPCAction: In future version, Actions will support initiating gRPC calls. This allows developers to implement Actions using plugins written in programming language like Go, providing greater flexibility and extensibility.
An action is considered successful on returning 0, or HTTP 200 for status HTTP(s) Actions. Any other return value or HTTP status codes indicate failure, and the action may be retried based on the configured retry policy.
If an action exceeds the specified timeout duration, it will be terminated, and the action is considered failed.
If an action produces any data as output, it should be written to stdout, or included in the HTTP response payload for HTTP(s) actions.
If an action encounters any errors, error messages should be written to stderr, or detailed in the HTTP response with the appropriate non-200 status code.
Field | Description |
---|---|
ExecAction | (Optional) Defines the command to run. This field cannot be updated. |
int32 | (Optional) Specifies the maximum duration in seconds that the Action is allowed to run. If the Action does not complete within this time frame, it will be terminated. This field cannot be updated. |
RetryPolicy | (Optional) Defines the strategy to be taken when retrying the Action after a failure. It specifies the conditions under which the Action should be retried and the limits to apply, such as the maximum number of retries and backoff strategy. This field cannot be updated. |
PreConditionType | (Optional) Specifies the state that the cluster must reach before the Action is executed.
Currently, this is only applicable to the The conditions are as follows:
This field cannot be updated. |
ActionAssertion
(Appears on:ComponentAvailableProbeAssertion)
ActionAssertion defines the custom assertions for evaluating the success or failure of an action.
Field | Description |
---|---|
bool | (Optional) Whether the action should succeed or fail. This field is immutable once set. |
ActionOutputMatcher | (Optional) Specifies the stdout matcher for the action. This field is immutable once set. |
ActionOutputMatcher | (Optional) Specifies the stderr matcher for the action. This field is immutable once set. |
ActionOutputMatcher
(Appears on:ActionAssertion)
ActionOutputMatcher defines the matcher for the output of an action.
Field | Description |
---|---|
string | (Optional) The output of the action should be equal to the specified value. This field is immutable once set. |
string | (Optional) The output of the action should contain the specified value. This field is immutable once set. |
ClusterBackup
(Appears on:ClusterSpec)
Field | Description |
---|---|
bool | (Optional) Specifies whether automated backup is enabled for the Cluster. |
github.com/apecloud/kubeblocks/apis/dataprotection/v1alpha1.RetentionPeriod | (Optional) Determines the duration to retain backups. Backups older than this period are automatically removed. For example, RetentionPeriod of
You can also combine the above durations. For example: 30d12h30m. Default value is 7d. |
string | Specifies the backup method to use, as defined in backupPolicy. |
string | (Optional) The cron expression for the schedule. The timezone is in UTC. See https://en.wikipedia.org/wiki/Cron. |
int64 | (Optional) Specifies the maximum time in minutes that the system will wait to start a missed backup job. If the scheduled backup time is missed for any reason, the backup job must start within this deadline. Values must be between 0 (immediate execution) and 1440 (one day). |
string | (Optional) Specifies the name of the backupRepo. If not set, the default backupRepo will be used. |
bool | (Optional) Specifies whether to enable point-in-time recovery. |
bool | (Optional) Specifies whether to enable incremental backup. |
string | (Optional) The cron expression for the incremental backup schedule. The timezone is in UTC. See https://en.wikipedia.org/wiki/Cron. |
ClusterComponentConfig
(Appears on:ClusterComponentSpec, ComponentSpec)
ClusterComponentConfig represents a config with its source bound.
Field | Description |
---|---|
string | (Optional) The name of the config. |
ClusterComponentConfigSource | (Members of The source of the config. |
ClusterComponentConfigSource
(Appears on:ClusterComponentConfig)
ClusterComponentConfigSource represents the source of a config.
Field | Description |
---|---|
Kubernetes core/v1.ConfigMapVolumeSource | (Optional) ConfigMap source for the config. |
ClusterComponentService
(Appears on:ClusterComponentSpec)
Field | Description |
---|---|
string | References the ComponentService name defined in the |
Kubernetes core/v1.ServiceType | (Optional) Determines how the Service is exposed. Valid options are
Note: although K8s Service type allows the ‘ExternalName’ type, it is not a valid option for ClusterComponentService. For more info, see: https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types. |
map[string]string | (Optional) If ServiceType is LoadBalancer, cloud provider related parameters can be put here. More info: https://kubernetes.io/docs/concepts/services-networking/service/#loadbalancer. |
bool | (Optional) Indicates whether to generate individual Services for each Pod. If set to true, a separate Service will be created for each Pod in the Cluster. |
ClusterComponentSpec
(Appears on:ClusterSharding, ClusterSpec)
ClusterComponentSpec defines the specification of a Component within a Cluster.
Field | Description |
---|---|
string | (Optional) Specifies the Component’s name.
It’s part of the Service DNS name and must comply with the IANA service naming rule.
The name is optional when ClusterComponentSpec is used as a template (e.g., in |
string | (Optional) Specifies the ComponentDefinition custom resource (CR) that defines the Component’s characteristics and behavior. Supports three different ways to specify the ComponentDefinition:
|
string | (Optional) ServiceVersion specifies the version of the Service expected to be provisioned by this Component. The version should follow the syntax and semantics of the “Semantic Versioning” specification (http://semver.org/). If no version is specified, the latest available version will be used. |
[]ServiceRef | (Optional) Defines a list of ServiceRef for a Component, enabling access to both external services and Services provided by other Clusters. Types of services:
ServiceRefs with identical Example:
The example above includes ServiceRefs to an external Redis Sentinel service and a PostgreSQL Cluster. |
map[string]string | (Optional) Specifies Labels to override or add for underlying Pods, PVCs, Account & TLS Secrets, Services Owned by Component. |
map[string]string | (Optional) Specifies Annotations to override or add for underlying Pods, PVCs, Account & TLS Secrets, Services Owned by Component. |
[]Kubernetes core/v1.EnvVar | (Optional) List of environment variables to add. These environment variables will be placed after the environment variables declared in the Pod. |
int32 | Specifies the desired number of replicas in the Component for enhancing availability and durability, or load balancing. |
SchedulingPolicy | (Optional) Specifies the scheduling policy for the Component. |
Kubernetes core/v1.ResourceRequirements | (Optional) Specifies the resources required by the Component. It allows defining the CPU, memory requirements and limits for the Component’s containers. |
[]ClusterComponentVolumeClaimTemplate | (Optional) Specifies a list of PersistentVolumeClaim templates that represent the storage requirements for the Component. Each template specifies the desired characteristics of a persistent volume, such as storage class, size, and access modes. These templates are used to dynamically provision persistent volumes for the Component. |
[]Kubernetes core/v1.Volume | (Optional) List of volumes to override. |
[]ClusterComponentService | (Optional) Overrides services defined in referenced ComponentDefinition. |
[]ComponentSystemAccount | (Optional) Overrides system accounts defined in referenced ComponentDefinition. |
[]ClusterComponentConfig | (Optional) Specifies the configuration content of a config template. |
bool | (Optional) A boolean flag that indicates whether the Component should use Transport Layer Security (TLS) for secure communication. When set to true, the Component will be configured to use TLS encryption for its network connections. This ensures that the data transmitted between the Component and its clients or other Components is encrypted and protected from unauthorized access. If TLS is enabled, the Component may require additional configuration, such as specifying TLS certificates and keys, to properly set up the secure communication channel. |
Issuer | (Optional) Specifies the configuration for the TLS certificates issuer. It allows defining the issuer name and the reference to the secret containing the TLS certificates and key. The secret should contain the CA certificate, TLS certificate, and private key in the specified keys. Required when TLS is enabled. |
string | (Optional) Specifies the name of the ServiceAccount required by the running Component. This ServiceAccount is used to grant necessary permissions for the Component’s Pods to interact with other Kubernetes resources, such as modifying Pod labels or sending events. If not specified, KubeBlocks automatically creates a default ServiceAccount named
“kb-{componentdefinition.name}”, bound to a role with rules defined in ComponentDefinition’s
If the field is not empty, the specified ServiceAccount will be used, and KubeBlocks will not create a ServiceAccount. But KubeBlocks does create RoleBindings for the specified ServiceAccount. |
Kubernetes api utils intstr.IntOrString | (Optional) Controls the concurrency of pods during initial scale up, when replacing pods on nodes,
or when scaling down. It only used when |
PodUpdatePolicyType | (Optional) PodUpdatePolicy indicates how pods should be updated
|
[]InstanceTemplate | (Optional) Allows for the customization of configuration values for each instance within a Component. An instance represent a single replica (Pod and associated K8s resources like PVCs, Services, and ConfigMaps). While instances typically share a common configuration as defined in the ClusterComponentSpec, they can require unique settings in various scenarios: For example:
InstanceTemplate allows for specifying these unique configurations per instance. Each instance’s name is constructed using the pattern: $(component.name)-$(template.name)-$(ordinal), starting with an ordinal of 0. It is crucial to maintain unique names for each InstanceTemplate to avoid conflicts. The sum of replicas across all InstanceTemplates should not exceed the total number of replicas specified for the Component. Any remaining replicas will be generated using the default template and will follow the default naming rules. |
[]string | (Optional) Specifies the names of instances to be transitioned to offline status. Marking an instance as offline results in the following:
Setting instances to offline allows for a controlled scale-in process, preserving their data and maintaining ordinal consistency within the Cluster. Note that offline instances and their associated resources, such as PVCs, are not automatically deleted. The administrator must manually manage the cleanup and removal of these resources when they are no longer needed. |
bool | (Optional) Determines whether metrics exporter information is annotated on the Component’s headless Service. If set to true, the following annotations will not be patched into the Service:
These annotations allow the Prometheus installed by KubeBlocks to discover and scrape metrics from the exporter. |
bool | (Optional) Stop the Component. If set, all the computing resources will be released. |
ClusterComponentStatus
(Appears on:ClusterStatus)
ClusterComponentStatus records Component status.
Field | Description |
---|---|
ComponentPhase | Specifies the current state of the Component. |
map[string]string | (Optional) Records detailed information about the Component in its current phase. The keys are either podName, deployName, or statefulSetName, formatted as ‘ObjectKind/Name’. |
ClusterComponentVolumeClaimTemplate
(Appears on:ClusterComponentSpec, ComponentSpec, InstanceTemplate)
Field | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
string | Refers to the name of a volumeMount defined in either:
The value of | ||||||||||
PersistentVolumeClaimSpec | (Optional) Defines the desired characteristics of a PersistentVolumeClaim that will be created for the volume
with the mount name specified in the When a Pod is created for this ClusterComponent, a new PVC will be created based on the specification
defined in the
|
ClusterDefinitionSpec
(Appears on:ClusterDefinition)
ClusterDefinitionSpec defines the desired state of ClusterDefinition.
Field | Description |
---|---|
[]ClusterTopology | (Optional) Topologies defines all possible topologies within the cluster. |
ClusterDefinitionStatus
(Appears on:ClusterDefinition)
ClusterDefinitionStatus defines the observed state of ClusterDefinition
Field | Description |
---|---|
int64 | (Optional) Represents the most recent generation observed for this ClusterDefinition. |
Phase | Specifies the current phase of the ClusterDefinition. Valid values are |
string | (Optional) Provides additional information about the current phase. |
string | (Optional) Topologies this ClusterDefinition supported. |
ClusterObjectReference
(Appears on:ComponentVarSelector, CredentialVarSelector, HostNetworkVarSelector, ServiceRefVarSelector, ServiceVarSelector, TLSVarSelector)
ClusterObjectReference defines information to let you locate the referenced object inside the same Cluster.
Field | Description |
---|---|
string | (Optional) Specifies the exact name, name prefix, or regular expression pattern for matching the name of the ComponentDefinition custom resource (CR) used by the component that the referent object resident in. If not specified, the component itself will be used. |
string | (Optional) Name of the referent object. |
bool | (Optional) Specify whether the object must be defined. |
MultipleClusterObjectOption | (Optional) This option defines the behavior when multiple component objects match the specified @CompDef. If not provided, an error will be raised when handling multiple matches. |
ClusterPhase
(string
alias)
(Appears on:ClusterStatus)
ClusterPhase defines the phase of the Cluster within the .status.phase field.
Value | Description |
---|---|
"Abnormal" | AbnormalClusterPhase represents some components are in |
"Creating" | CreatingClusterPhase represents all components are in |
"Deleting" | DeletingClusterPhase indicates the cluster is being deleted. |
"Failed" | FailedClusterPhase represents all components are in |
"Running" | RunningClusterPhase represents all components are in |
"Stopped" | StoppedClusterPhase represents all components are in |
"Stopping" | StoppingClusterPhase represents at least one component is in |
"Updating" | UpdatingClusterPhase represents all components are in |
ClusterService
(Appears on:ClusterSpec)
ClusterService defines a service that is exposed externally, allowing entities outside the cluster to access it.
For example, external applications, or other Clusters.
And another Cluster managed by the same KubeBlocks operator can resolve the address exposed by a ClusterService
using the serviceRef
field.
When a Component needs to access another Cluster’s ClusterService using the serviceRef
field,
it must also define the service type and version information in the componentDefinition.spec.serviceRefDeclarations
section.
Field | Description |
---|---|
Service | (Members of |
string | (Optional) Extends the ServiceSpec.Selector by allowing the specification of components, to be used as a selector for the service. If the |
ClusterSharding
(Appears on:ClusterSpec)
ClusterSharding defines how KubeBlocks manage dynamic provisioned shards. A typical design pattern for distributed databases is to distribute data across multiple shards, with each shard consisting of multiple replicas. Therefore, KubeBlocks supports representing a shard with a Component and dynamically instantiating Components using a template when shards are added. When shards are removed, the corresponding Components are also deleted.
Field | Description |
---|---|
string | Represents the common parent part of all shard names. This identifier is included as part of the Service DNS name and must comply with IANA service naming rules.
It is used to generate the names of underlying Components following the pattern Note that the name defined in Component template( |
string | (Optional) Specifies the ShardingDefinition custom resource (CR) that defines the sharding’s characteristics and behavior. The full name or regular expression is supported to match the ShardingDefinition. |
ClusterComponentSpec | The template for generating Components for shards, where each shard consists of one Component. This field is of type ClusterComponentSpec, which encapsulates all the required details and
definitions for creating and managing the Components.
KubeBlocks uses this template to generate a set of identical Components of shards.
All the generated Components will have the same specifications and definitions as specified in the This allows for the creation of multiple Components with consistent configurations, enabling sharding and distribution of workloads across Components. |
int32 | Specifies the desired number of shards. Users can declare the desired number of shards through this field. KubeBlocks dynamically creates and deletes Components based on the difference between the desired and actual number of shards. KubeBlocks provides lifecycle management for sharding, including:
|
ClusterSpec
(Appears on:Cluster)
ClusterSpec defines the desired state of Cluster.
Field | Description |
---|---|
string | (Optional) Specifies the name of the ClusterDefinition to use when creating a Cluster. This field enables users to create a Cluster based on a specific ClusterDefinition.
Which, in conjunction with the
This facilitates multiple-components management with predefined ClusterDefinition. Users with advanced requirements can bypass this general setting and specify more precise control over
the composition of the Cluster by directly referencing specific ComponentDefinitions for each component
within If this field is not provided, each component must be explicitly defined in Note: Once set, this field cannot be modified; it is immutable. |
string | (Optional) Specifies the name of the ClusterTopology to be used when creating the Cluster. This field defines which set of Components, as outlined in the ClusterDefinition, will be used to
construct the Cluster based on the named topology.
The ClusterDefinition may list multiple topologies under If Note: Once set during the Cluster creation, the |
TerminationPolicyType | Specifies the behavior when a Cluster is deleted. It defines how resources, data, and backups associated with a Cluster are managed during termination. Choose a policy based on the desired level of resource cleanup and data preservation:
Warning: Choosing an inappropriate termination policy can result in data loss.
The |
[]ClusterComponentSpec | (Optional) Specifies a list of ClusterComponentSpec objects used to define the individual Components that make up a Cluster. This field allows for detailed configuration of each Component within the Cluster. Note: |
[]ClusterSharding | (Optional) Specifies a list of ClusterSharding objects that manage the sharding topology for Cluster Components. Each ClusterSharding organizes components into shards, with each shard corresponding to a Component. Components within a shard are all based on a common ClusterComponentSpec template, ensuring uniform configurations. This field supports dynamic resharding by facilitating the addition or removal of shards
through the Note: |
string | (Optional) Specifies runtimeClassName for all Pods managed by this Cluster. |
SchedulingPolicy | (Optional) Specifies the scheduling policy for the Cluster. |
[]ClusterService | (Optional) Defines a list of additional Services that are exposed by a Cluster.
This field allows Services of selected Components, either from Services defined here can be referenced by other clusters using the ServiceRefClusterSelector. |
ClusterBackup | (Optional) Specifies the backup configuration of the Cluster. |
ClusterStatus
(Appears on:Cluster)
ClusterStatus defines the observed state of the Cluster.
Field | Description |
---|---|
int64 | (Optional) The most recent generation number of the Cluster object that has been observed by the controller. |
ClusterPhase | (Optional) The current phase of the Cluster includes:
|
string | (Optional) Provides additional information about the current phase. |
map[string]github.com/apecloud/kubeblocks/apis/apps/v1.ClusterComponentStatus | (Optional) Records the current status information of all Components within the Cluster. |
map[string]github.com/apecloud/kubeblocks/apis/apps/v1.ClusterComponentStatus | (Optional) Records the current status information of all shardings within the Cluster. |
[]Kubernetes meta/v1.Condition | (Optional) Represents a list of detailed status of the Cluster object. Each condition in the list provides real-time information about certain aspect of the Cluster object. This field is crucial for administrators and developers to monitor and respond to changes within the Cluster. It provides a history of state transitions and a snapshot of the current state that can be used for automated logic or direct inspection. |
ClusterTopology
(Appears on:ClusterDefinitionSpec)
ClusterTopology represents the definition for a specific cluster topology.
Field | Description |
---|---|
string | Name is the unique identifier for the cluster topology. Cannot be updated. |
[]ClusterTopologyComponent | (Optional) Components specifies the components in the topology. |
[]ClusterTopologySharding | (Optional) Shardings specifies the shardings in the topology. |
ClusterTopologyOrders | (Optional) Specifies the sequence in which components within a cluster topology are started, stopped, and upgraded. This ordering is crucial for maintaining the correct dependencies and operational flow across components. |
bool | (Optional) Default indicates whether this topology serves as the default configuration. When set to true, this topology is automatically used unless another is explicitly specified. |
ClusterTopologyComponent
(Appears on:ClusterTopology)
ClusterTopologyComponent defines a Component within a ClusterTopology.
Field | Description |
---|---|
string | Defines the unique identifier of the component within the cluster topology. It follows IANA Service naming rules and is used as part of the Service’s DNS name. The name must start with a lowercase letter, can contain lowercase letters, numbers, and hyphens, and must end with a lowercase letter or number. If the @template field is set to true, the name will be used as a prefix to match the specific components dynamically created. Cannot be updated once set. |
string | Specifies the exact name, name prefix, or regular expression pattern for matching the name of the ComponentDefinition custom resource (CR) that defines the Component’s characteristics and behavior. The system selects the ComponentDefinition CR with the latest version that matches the pattern. This approach allows:
Cannot be updated once set. |
bool | (Optional) Specifies whether the topology component will be considered as a template for instantiating components upon user requests dynamically. Cannot be updated once set. |
ClusterTopologyOrders
(Appears on:ClusterTopology)
ClusterTopologyOrders manages the lifecycle of components within a cluster by defining their provisioning, terminating, and updating sequences. It organizes components into stages or groups, where each group indicates a set of components that can be managed concurrently. These groups are processed sequentially, allowing precise control based on component dependencies and requirements.
Field | Description |
---|---|
[]string | (Optional) Specifies the order for creating and initializing entities. This is designed for entities that depend on one another. Entities without dependencies can be grouped together. Entities that can be provisioned independently or have no dependencies can be listed together in the same stage, separated by commas. |
[]string | (Optional) Outlines the order for stopping and deleting entities. This sequence is designed for entities that require a graceful shutdown or have interdependencies. Entities that can be terminated independently or have no dependencies can be listed together in the same stage, separated by commas. |
[]string | (Optional) Update determines the order for updating entities’ specifications, such as image upgrades or resource scaling. This sequence is designed for entities that have dependencies or require specific update procedures. Entities that can be updated independently or have no dependencies can be listed together in the same stage, separated by commas. |
ClusterTopologySharding
(Appears on:ClusterTopology)
ClusterTopologySharding defines a sharding within a ClusterTopology.
Field | Description |
---|---|
string | Defines the unique identifier of the sharding within the cluster topology. It follows IANA Service naming rules and is used as part of the Service’s DNS name. The name must start with a lowercase letter, can contain lowercase letters, numbers, and hyphens, and must end with a lowercase letter or number. Cannot be updated once set. |
string | Specifies the sharding definition that defines the characteristics and behavior of the sharding. The system selects the ShardingDefinition CR with the latest version that matches the pattern. This approach allows:
Once set, this field cannot be updated. |
ClusterVarSelector
(Appears on:VarSource)
ClusterVarSelector selects a var from a Cluster.
Field | Description |
---|---|
ClusterVars | (Members of |
ClusterVars
(Appears on:ClusterVarSelector)
Field | Description |
---|---|
VarOption | (Optional) Reference to the namespace of the Cluster object. |
VarOption | (Optional) Reference to the name of the Cluster object. |
VarOption | (Optional) Reference to the UID of the Cluster object. |
ComponentAvailable
(Appears on:ComponentDefinitionSpec)
ComponentAvailable defines the strategies for determining whether the component is available.
Field | Description |
---|---|
string | (Optional) Specifies the phases that the component will go through to be considered available. This field is immutable once set. |
ComponentAvailableWithProbe | (Optional) Specifies the strategies for determining whether the component is available based on the available probe. This field is immutable once set. |
ComponentAvailableCondition
(Appears on:ComponentAvailableWithProbe)
Field | Description |
---|---|
ComponentAvailableExpression | (Members of |
[]ComponentAvailableExpression | (Optional) Logical And to combine multiple expressions. This field is immutable once set. |
[]ComponentAvailableExpression | (Optional) Logical Or to combine multiple expressions. This field is immutable once set. |
ComponentAvailableExpression | (Optional) Logical Not to negate the expression. This field is immutable once set. |
ComponentAvailableExpression
(Appears on:ComponentAvailableCondition)
Field | Description |
---|---|
ComponentAvailableProbeAssertion | (Optional) All replicas must satisfy the assertion. This field is immutable once set. |
ComponentAvailableProbeAssertion | (Optional) At least one replica must satisfy the assertion. This field is immutable once set. |
ComponentAvailableProbeAssertion | (Optional) None of the replicas must satisfy the assertion. This field is immutable once set. |
ComponentAvailableProbeAssertion | (Optional) Majority replicas must satisfy the assertion. This field is immutable once set. |
ComponentAvailableProbeAssertion
(Appears on:ComponentAvailableExpression)
Field | Description |
---|---|
ActionAssertion | (Members of |
[]ActionAssertion | (Optional) Logical And to combine multiple assertions. This field is immutable once set. |
[]ActionAssertion | (Optional) Logical Or to combine multiple assertions. This field is immutable once set. |
ActionAssertion | (Optional) Logical Not to negate the assertions. This field is immutable once set. |
bool | (Optional) Specifies whether apply the assertions strictly to all replicas. This field is immutable once set. |
ComponentAvailableWithProbe
(Appears on:ComponentAvailable)
Field | Description |
---|---|
int32 | (Optional) This field is immutable once set. |
ComponentAvailableCondition | (Optional) Specifies the conditions that the component will go through to be considered available. This field is immutable once set. |
string | (Optional) A brief description for the condition when the component is available. |
ComponentConfigSpec
(Appears on:ComponentDefinitionSpec)
Field | Description |
---|---|
ComponentTemplateSpec | (Members of |
[]string | (Optional) Specifies the configuration files within the ConfigMap that support dynamic updates. A configuration template (provided in the form of a ConfigMap) may contain templates for multiple configuration files. Each configuration file corresponds to a key in the ConfigMap. Some of these configuration files may support dynamic modification and reloading without requiring a pod restart. If empty or omitted, all configuration files in the ConfigMap are assumed to support dynamic updates, and ConfigConstraint applies to all keys. |
string | (Optional) Specifies the name of the referenced configuration constraints object. |
[]string | (Optional) Specifies the containers to inject the ConfigMap parameters as environment variables. This is useful when application images accept parameters through environment variables and generate the final configuration file in the startup script based on these variables. This field allows users to specify a list of container names, and KubeBlocks will inject the environment variables converted from the ConfigMap into these designated containers. This provides a flexible way to pass the configuration items from the ConfigMap to the container without modifying the image. Deprecated: |
[]string | (Optional) Specifies the containers to inject the ConfigMap parameters as environment variables. This is useful when application images accept parameters through environment variables and generate the final configuration file in the startup script based on these variables. This field allows users to specify a list of container names, and KubeBlocks will inject the environment variables converted from the ConfigMap into these designated containers. This provides a flexible way to pass the configuration items from the ConfigMap to the container without modifying the image. |
[]RerenderResourceType | (Optional) Specifies whether the configuration needs to be re-rendered after v-scale or h-scale operations to reflect changes. In some scenarios, the configuration may need to be updated to reflect the changes in resource allocation or cluster topology. Examples:
|
bool | (Optional) Whether to store the final rendered parameters as a secret. |
ComponentDefinitionSpec
(Appears on:ComponentDefinition)
Field | Description |
---|---|
string | (Optional) Specifies the name of the Component provider, typically the vendor or developer name. It identifies the entity responsible for creating and maintaining the Component. When specifying the provider name, consider the following guidelines:
|
string | (Optional) Provides a brief and concise explanation of the Component’s purpose, functionality, and any relevant details. It serves as a quick reference for users to understand the Component’s role and characteristics. |
string | (Optional) Defines the type of well-known service protocol that the Component provides. It specifies the standard or widely recognized protocol used by the Component to offer its Services. The Some examples of well-known service protocols include:
The When specifying the
Note: The The |
string | (Optional) Specifies the version of the Service provided by the Component. It follows the syntax and semantics of the “Semantic Versioning” specification (http://semver.org/). The Semantic Versioning specification defines a version number format of X.Y.Z (MAJOR.MINOR.PATCH), where:
Additional labels for pre-release and build metadata are available as extensions to the X.Y.Z format:
Examples of valid ServiceVersion values:
The |
map[string]string | (Optional) Specifies static labels that will be patched to all Kubernetes resources created for the Component. Note: If a label key in the This field is immutable. |
map[string]string | (Optional) Specifies static annotations that will be patched to all Kubernetes resources created for the Component. Note: If an annotation key in the This field is immutable. |
Kubernetes core/v1.PodSpec | Specifies the PodSpec template used in the Component. It includes the following elements:
This field is intended to define static settings that remain consistent across all instantiated Components.
Dynamic settings such as CPU and memory resource limits, as well as scheduling settings (affinity,
toleration, priority), may vary among different instantiated Components.
They should be specified in the Specific instances of a Component may override settings defined here, such as using a different container image
or modifying environment variable values.
These instance-specific overrides can be specified in This field is immutable and cannot be updated once set. |
[]EnvVar | (Optional) Defines variables which are determined after Cluster instantiation and reflect dynamic or runtime attributes of instantiated Clusters. These variables serve as placeholders for setting environment variables in Pods and Actions, or for rendering configuration and script templates before actual values are finalized. These variables are placed in front of the environment variables declared in the Pod if used as environment variables. Variable values can be sourced from:
This field is immutable. |
[]ComponentVolume | (Optional) Defines the volumes used by the Component and some static attributes of the volumes.
After defining the volumes here, user can reference them in the
This field allows you to specify the following:
By configuring these volume behaviors, you can control how the volumes are managed and monitored within the Component. This field is immutable. |
HostNetwork | (Optional) Specifies the host network configuration for the Component. When The DNSPolicy field in the Pod spec determines how containers within the Pod perform DNS resolution. When using hostNetwork, the operator will set the DNSPolicy to ‘ClusterFirstWithHostNet’. With this policy, DNS queries will first go through the K8s cluster’s DNS service. If the query fails, it will fall back to the host’s DNS settings. If set, the DNS policy will be automatically set to “ClusterFirstWithHostNet”. This field is immutable. |
[]ComponentService | (Optional) Defines additional Services to expose the Component’s endpoints. A default headless Service, named This field enables customization of additional Services to expose the Component’s endpoints to other Components within the same or different Clusters, and to external applications. Each Service entry in this list can include properties such as ports, type, and selectors.
This field is immutable. |
[]ComponentConfigSpec | (Optional) Specifies the configuration file templates and volume mount parameters used by the Component. It also includes descriptions of the parameters in the ConfigMaps, such as value range limitations. This field specifies a list of templates that will be rendered into Component containers’ configuration files. Each template is represented as a ConfigMap and may contain multiple configuration files, with each file being a key in the ConfigMap. The rendered configuration files will be mounted into the Component’s containers according to the specified volume mount parameters. This field is immutable. |
[]LogConfig | (Optional) Defines the types of logs generated by instances of the Component and their corresponding file paths. These logs can be collected for further analysis and monitoring. The Examples:
This field is immutable. |
[]ComponentTemplateSpec | (Optional) Specifies groups of scripts, each provided via a ConfigMap, to be mounted as volumes in the container. These scripts can be executed during container startup or via specific actions. Each script group is encapsulated in a ComponentTemplateSpec that includes:
This field is immutable. |
[]SystemAccount | (Optional) An array of Each
Use cases for system accounts typically involve tasks like system initialization, backups, monitoring, health checks, replication, and other system-level operations. System accounts are distinct from user accounts, although both are database accounts.
This field is immutable. |
TLS | (Optional) Specifies the TLS configuration for the Component. This field is immutable. |
ReplicasLimit | (Optional) Defines the upper limit of the number of replicas supported by the Component. It defines the maximum number of replicas that can be created for the Component. This field allows you to set a limit on the scalability of the Component, preventing it from exceeding a certain number of replicas. This field is immutable. |
ComponentAvailable | (Optional) Specifies the strategies for determining the available status of the Component. This field is immutable. |
[]ReplicaRole | (Optional) Enumerate all possible roles assigned to each replica of the Component, influencing its behavior. A replica can have zero or one role.
KubeBlocks operator determines the role of each replica by invoking the The roles assigned to a replica can influence various aspects of the Component’s behavior, such as:
This field is immutable. |
int32 | (Optional)
A default value of 0 seconds means the Pod is considered available as soon as it enters the ready state. |
UpdateStrategy | (Optional) Specifies the concurrency strategy for updating multiple instances of the Component. Available strategies:
This field is immutable and defaults to ‘Serial’. |
Kubernetes apps/v1.PodManagementPolicyType | (Optional) InstanceSet controls the creation of pods during initial scale up, replacement of pods on nodes, and scaling down.
|
[]Kubernetes rbac/v1.PolicyRule | (Optional) Defines the namespaced policy rules required by the Component. The The purpose of this field is to automatically generate the necessary RBAC roles for the Component based on the specified policy rules. This ensures that the Pods in the Component has appropriate permissions to function. This field is immutable. |
ComponentLifecycleActions | (Optional) Defines a set of hooks and procedures that customize the behavior of a Component throughout its lifecycle. Actions are triggered at specific lifecycle stages:
This field is immutable. |
[]ServiceRefDeclaration | (Optional) Lists external service dependencies of the Component, including services from other Clusters or outside the K8s environment. This field is immutable. |
Exporter | (Optional) Defines the built-in metrics exporter container. |
ComponentDefinitionStatus
(Appears on:ComponentDefinition)
ComponentDefinitionStatus defines the observed state of ComponentDefinition.
Field | Description |
---|---|
int64 | (Optional) Refers to the most recent generation that has been observed for the ComponentDefinition. |
Phase | (Optional) Represents the current status of the ComponentDefinition. Valid values include ``, |
string | (Optional) Provides additional information about the current phase. |
ComponentLifecycleActions
(Appears on:ComponentDefinitionSpec)
ComponentLifecycleActions defines a collection of Actions for customizing the behavior of a Component.
Field | Description |
---|---|
Action | (Optional) Specifies the hook to be executed after a component’s creation. By setting The PostProvision Action is intended to run only once. Note: This field is immutable once it has been set. |
Action | (Optional) Specifies the hook to be executed prior to terminating a component. The PreTerminate Action is intended to run only once. This action is executed immediately when a scale-down operation for the Component is initiated. The actual termination and cleanup of the Component and its associated resources will not proceed until the PreTerminate action has completed successfully. Note: This field is immutable once it has been set. |
Probe | (Optional) Defines the procedure which is invoked regularly to assess the role of replicas. This action is periodically triggered at the specified interval to determine the role of each replica.
Upon successful execution, the action’s output designates the role of the replica,
which should match one of the predefined role names within Defining a RoleProbe Action for a Component is required if roles are defined for the Component. It ensures replicas are correctly labeled with their respective roles. Without this, services that rely on roleSelectors might improperly direct traffic to wrong replicas. The container executing this action has access to following variables:
Expected output of this action:
Note: This field is immutable once it has been set. |
Probe | (Optional) Defines the procedure which is invoked regularly to assess the availability of the component. Note: This field is immutable once it has been set. |
Action | (Optional) Defines the procedure for a controlled transition of a role to a new replica. This approach aims to minimize downtime and maintain availability during events such as planned maintenance or when performing stop, shutdown, restart, or upgrade operations. In a typical consensus system, this action is used to transfer leader role to another replica. The container executing this action has access to following variables:
Note: This field is immutable once it has been set. |
Action | (Optional) Defines the procedure to add a new replica to the replication group. This action is initiated after a replica pod becomes ready. The role of the replica (e.g., primary, secondary) will be determined and assigned as part of the action command implementation, or automatically by the database kernel or a sidecar utility like Patroni that implements a consensus algorithm. The container executing this action has access to following variables:
Expected action output:
For example, to add a new OBServer to an OceanBase Cluster in ‘zone1’, the following command may be used:
Note: This field is immutable once it has been set. |
Action | (Optional) Defines the procedure to remove a replica from the replication group. This action is initiated before remove a replica from the group. The operator will wait for MemberLeave to complete successfully before releasing the replica and cleaning up related Kubernetes resources. The process typically includes updating configurations and informing other group members about the removal. Data migration is generally not part of this action and should be handled separately if needed. The container executing this action has access to following variables:
Expected action output:
For example, to remove an OBServer from an OceanBase Cluster in ‘zone1’, the following command can be executed:
Note: This field is immutable once it has been set. |
Action | (Optional) Defines the procedure to switch a replica into the read-only state. Use Case: This action is invoked when the database’s volume capacity nears its upper limit and space is about to be exhausted. The container executing this action has access to following environment variables:
Expected action output:
Note: This field is immutable once it has been set. |
Action | (Optional) Defines the procedure to transition a replica from the read-only state back to the read-write state. Use Case: This action is used to bring back a replica that was previously in a read-only state, which restricted write operations, to its normal operational state where it can handle both read and write operations. The container executing this action has access to following environment variables:
Expected action output:
Note: This field is immutable once it has been set. |
Action | (Optional) Defines the procedure for exporting the data from a replica. Use Case: This action is intended for initializing a newly created replica with data. It involves exporting data from an existing replica and importing it into the new, empty replica. This is essential for synchronizing the state of replicas across the system. Applicability: Some database engines or associated sidecar applications (e.g., Patroni) may already provide this functionality. In such cases, this action may not be required. The output should be a valid data dump streamed to stdout. It must exclude any irrelevant information to ensure that only the necessary data is exported for import into the new replica. The container executing this action has access to following environment variables:
Note: This field is immutable once it has been set. |
Action | (Optional) Defines the procedure for importing data into a replica. Use Case: This action is intended for initializing a newly created replica with data. It involves exporting data from an existing replica and importing it into the new, empty replica. This is essential for synchronizing the state of replicas across the system. Some database engines or associated sidecar applications (e.g., Patroni) may already provide this functionality. In such cases, this action may not be required. Data should be received through stdin. If any error occurs during the process, the action must be able to guarantee idempotence to allow for retries from the beginning. Note: This field is immutable once it has been set. |
Action | (Optional) Defines the procedure that update a replica with new configuration. Note: This field is immutable once it has been set. This Action is reserved for future versions. |
Action | (Optional) Defines the procedure to generate a new database account. Use Case: This action is designed to create system accounts that are utilized for replication, monitoring, backup, and other administrative tasks. The container executing this action has access to following variables:
Note: This field is immutable once it has been set. |
ComponentPhase
(string
alias)
(Appears on:ClusterComponentStatus, ComponentStatus)
ComponentPhase defines the phase of the Component within the .status.phase field.
Value | Description |
---|---|
"Creating" | CreatingComponentPhase indicates the component is currently being created. |
"Deleting" | DeletingComponentPhase indicates the component is currently being deleted. |
"Failed" | FailedComponentPhase indicates that there are some pods of the component not in a ‘Running’ state. |
"Running" | RunningComponentPhase indicates that all pods of the component are up-to-date and in a ‘Running’ state. |
"Starting" | StartingComponentPhase indicates the component is currently being started. |
"Stopped" | StoppedComponentPhase indicates the component is stopped. |
"Stopping" | StoppingComponentPhase indicates the component is currently being stopped. |
"Updating" | UpdatingComponentPhase indicates the component is currently being updated. |
ComponentService
(Appears on:ComponentDefinitionSpec, ComponentSpec)
ComponentService defines a service that would be exposed as an inter-component service within a Cluster. A Service defined in the ComponentService is expected to be accessed by other Components within the same Cluster.
When a Component needs to use a ComponentService provided by another Component within the same Cluster,
it can declare a variable in the componentDefinition.spec.vars
section and bind it to the specific exposed address
of the ComponentService using the serviceVarRef
field.
Field | Description |
---|---|
Service | (Members of |
bool | (Optional) Indicates whether to create a corresponding Service for each Pod of the selected Component.
When set to true, a set of Services will be automatically generated for each Pod,
and the The names of the generated Services will follow the same suffix naming pattern: Example usage:
In this example, if the Component has 3 replicas, three Services will be generated:
Each generated Service will have the specified spec configuration and will target its respective Pod. This feature is useful when you need to expose each Pod of a Component individually, allowing external access to specific instances of the Component. |
bool | (Optional) Indicates whether the automatic provisioning of the service should be disabled. If set to true, the service will not be automatically created at the component provisioning. Instead, you can enable the creation of this service by specifying it explicitly in the cluster API. |
ComponentSpec
(Appears on:Component)
ComponentSpec defines the desired state of Component
Field | Description |
---|---|
string | Specifies the name of the referenced ComponentDefinition. |
string | (Optional) ServiceVersion specifies the version of the Service expected to be provisioned by this Component. The version should follow the syntax and semantics of the “Semantic Versioning” specification (http://semver.org/). |
[]ServiceRef | (Optional) Defines a list of ServiceRef for a Component, enabling access to both external services and Services provided by other Clusters. Types of services:
ServiceRefs with identical Example:
The example above includes ServiceRefs to an external Redis Sentinel service and a PostgreSQL Cluster. |
map[string]string | (Optional) Specifies Labels to override or add for underlying Pods, PVCs, Account & TLS Secrets, Services Owned by Component. |
map[string]string | (Optional) Specifies Annotations to override or add for underlying Pods, PVCs, Account & TLS Secrets, Services Owned by Component. |
[]Kubernetes core/v1.EnvVar | (Optional) List of environment variables to add. |
Kubernetes core/v1.ResourceRequirements | (Optional) Specifies the resources required by the Component. It allows defining the CPU, memory requirements and limits for the Component’s containers. |
[]ClusterComponentVolumeClaimTemplate | (Optional) Specifies a list of PersistentVolumeClaim templates that define the storage requirements for the Component. Each template specifies the desired characteristics of a persistent volume, such as storage class, size, and access modes. These templates are used to dynamically provision persistent volumes for the Component. |
[]Kubernetes core/v1.Volume | (Optional) List of volumes to override. |
[]ComponentService | (Optional) Overrides Services defined in referenced ComponentDefinition. |
[]ComponentSystemAccount | (Optional) Overrides system accounts defined in referenced ComponentDefinition. |
int32 | Specifies the desired number of replicas in the Component for enhancing availability and durability, or load balancing. |
[]ClusterComponentConfig | (Optional) Specifies the configuration content of a config template. |
string | (Optional) Specifies the name of the ServiceAccount required by the running Component. This ServiceAccount is used to grant necessary permissions for the Component’s Pods to interact with other Kubernetes resources, such as modifying Pod labels or sending events. If not specified, KubeBlocks automatically creates a default ServiceAccount named
“kb-{componentdefinition.name}”, bound to a role with rules defined in ComponentDefinition’s
If the field is not empty, the specified ServiceAccount will be used, and KubeBlocks will not create a ServiceAccount. But KubeBlocks does create RoleBindings for the specified ServiceAccount. |
Kubernetes api utils intstr.IntOrString | (Optional) Controls the concurrency of pods during initial scale up, when replacing pods on nodes,
or when scaling down. It only used when |
PodUpdatePolicyType | (Optional) PodUpdatePolicy indicates how pods should be updated
|
SchedulingPolicy | (Optional) Specifies the scheduling policy for the Component. |
TLSConfig | (Optional) Specifies the TLS configuration for the Component, including:
|
[]InstanceTemplate | (Optional) Allows for the customization of configuration values for each instance within a Component. An Instance represent a single replica (Pod and associated K8s resources like PVCs, Services, and ConfigMaps). While instances typically share a common configuration as defined in the ClusterComponentSpec, they can require unique settings in various scenarios: For example:
InstanceTemplate allows for specifying these unique configurations per instance. Each instance’s name is constructed using the pattern: $(component.name)-$(template.name)-$(ordinal), starting with an ordinal of 0. It is crucial to maintain unique names for each InstanceTemplate to avoid conflicts. The sum of replicas across all InstanceTemplates should not exceed the total number of Replicas specified for the Component. Any remaining replicas will be generated using the default template and will follow the default naming rules. |
[]string | (Optional) Specifies the names of instances to be transitioned to offline status. Marking an instance as offline results in the following:
Setting instances to offline allows for a controlled scale-in process, preserving their data and maintaining ordinal consistency within the Cluster. Note that offline instances and their associated resources, such as PVCs, are not automatically deleted. The administrator must manually manage the cleanup and removal of these resources when they are no longer needed. |
string | (Optional) Defines runtimeClassName for all Pods managed by this Component. |
bool | (Optional) Determines whether metrics exporter information is annotated on the Component’s headless Service. If set to true, the following annotations will not be patched into the Service:
These annotations allow the Prometheus installed by KubeBlocks to discover and scrape metrics from the exporter. |
bool | (Optional) Stop the Component. If set, all the computing resources will be released. |
[]Sidecar | (Optional) Specifies the sidecars to be injected into the Component. |
ComponentStatus
(Appears on:Component)
ComponentStatus represents the observed state of a Component within the Cluster.
Field | Description |
---|---|
int64 | (Optional) Specifies the most recent generation observed for this Component object. |
[]Kubernetes meta/v1.Condition | (Optional) Represents a list of detailed status of the Component object. Each condition in the list provides real-time information about certain aspect of the Component object. This field is crucial for administrators and developers to monitor and respond to changes within the Component. It provides a history of state transitions and a snapshot of the current state that can be used for automated logic or direct inspection. |
ComponentPhase | Indicates the current phase of the Component, with each phase indicating specific conditions:
|
map[string]string | (Optional) A map that stores detailed message about the Component. Each entry in the map provides insights into specific elements of the Component, such as Pods or workloads. Keys in this map are formatted as |
ComponentSystemAccount
(Appears on:ClusterComponentSpec, ComponentSpec)
Field | Description |
---|---|
string | The name of the system account. |
PasswordConfig | (Optional) Specifies the policy for generating the account’s password. This field is immutable once set. |
ProvisionSecretRef | (Optional) Refers to the secret from which data will be copied to create the new account. This field is immutable once set. |
ComponentTemplateSpec
(Appears on:ComponentConfigSpec, ComponentDefinitionSpec, SidecarDefinitionSpec)
Field | Description |
---|---|
string | Specifies the name of the configuration template. |
string | (Optional) Specifies the name of the referenced configuration template ConfigMap object. |
string | (Optional) Specifies the namespace of the referenced configuration template ConfigMap object. An empty namespace is equivalent to the “default” namespace. |
string | (Optional) Refers to the volume name of PodTemplate. The configuration file produced through the configuration template will be mounted to the corresponding volume. Must be a DNS_LABEL name. The volume name must be defined in podSpec.containers[*].volumeMounts. |
int32 | (Optional) The operator attempts to set default file permissions for scripts (0555) and configurations (0444). However, certain database engines may require different file permissions. You can specify the desired file permissions here. Must be specified as an octal value between 0000 and 0777 (inclusive), or as a decimal value between 0 and 511 (inclusive). YAML supports both octal and decimal values for file permissions. Please note that this setting only affects the permissions of the files themselves. Directories within the specified path are not impacted by this setting. It’s important to be aware that this setting might conflict with other options that influence the file mode, such as fsGroup. In such cases, the resulting file mode may have additional bits set. Refers to documents of k8s.ConfigMapVolumeSource.defaultMode for more information. |
ComponentVarSelector
(Appears on:VarSource)
ComponentVarSelector selects a var from a Component.
Field | Description |
---|---|
ClusterObjectReference | (Members of The Component to select from. |
ComponentVars | (Members of |
ComponentVars
(Appears on:ComponentVarSelector)
Field | Description |
---|---|
VarOption | (Optional) Reference to the name of the Component object. |
VarOption | (Optional) Reference to the short name of the Component object. |
VarOption | (Optional) Reference to the replicas of the component. |
VarOption | (Optional) Reference to the pod name list of the component. and the value will be presented in the following format: name1,name2,… |
VarOption | (Optional) Reference to the pod FQDN list of the component. The value will be presented in the following format: FQDN1,FQDN2,… |
RoledVar | (Optional) Reference to the pod name list of the component that have a specific role. The value will be presented in the following format: name1,name2,… |
RoledVar | (Optional) Reference to the pod FQDN list of the component that have a specific role. The value will be presented in the following format: FQDN1,FQDN2,… |
ComponentVersionCompatibilityRule
(Appears on:ComponentVersionSpec)
ComponentVersionCompatibilityRule defines the compatibility between a set of component definitions and a set of releases.
Field | Description |
---|---|
[]string | CompDefs specifies names for the component definitions associated with this ComponentVersion. Each name in the list can represent an exact name, a name prefix, or a regular expression pattern. For example:
|
[]string | Releases is a list of identifiers for the releases. |
ComponentVersionRelease
(Appears on:ComponentVersionSpec)
ComponentVersionRelease represents a release of component instances within a ComponentVersion.
Field | Description |
---|---|
string | Name is a unique identifier for this release. Cannot be updated. |
string | (Optional) Changes provides information about the changes made in this release. |
string | ServiceVersion defines the version of the well-known service that the component provides. The version should follow the syntax and semantics of the “Semantic Versioning” specification (http://semver.org/). If the release is used, it will serve as the service version for component instances, overriding the one defined in the component definition. Cannot be updated. |
map[string]string | Images define the new images for containers, actions or external applications within the release. If an image is specified for a lifecycle action, the key should be the field name (case-insensitive) of the action in the LifecycleActions struct. |
ComponentVersionSpec
(Appears on:ComponentVersion)
ComponentVersionSpec defines the desired state of ComponentVersion
Field | Description |
---|---|
[]ComponentVersionCompatibilityRule | CompatibilityRules defines compatibility rules between sets of component definitions and releases. |
[]ComponentVersionRelease | Releases represents different releases of component instances within this ComponentVersion. |
ComponentVersionStatus
(Appears on:ComponentVersion)
ComponentVersionStatus defines the observed state of ComponentVersion
Field | Description |
---|---|
int64 | (Optional) ObservedGeneration is the most recent generation observed for this ComponentVersion. |
Phase | (Optional) Phase valid values are ``, |
string | (Optional) Extra message for current phase. |
string | (Optional) ServiceVersions represent the supported service versions of this ComponentVersion. |
ComponentVolume
(Appears on:ComponentDefinitionSpec)
Field | Description |
---|---|
string | Specifies the name of the volume. It must be a DNS_LABEL and unique within the pod. More info can be found at: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names Note: This field cannot be updated. |
bool | (Optional) Specifies whether the creation of a snapshot of this volume is necessary when performing a backup of the Component. Note: This field cannot be updated. |
int | (Optional) Sets the critical threshold for volume space utilization as a percentage (0-100). Exceeding this percentage triggers the system to switch the volume to read-only mode as specified in
Note: This field cannot be updated. |
ConfigTemplateExtension
Field | Description |
---|---|
string | Specifies the name of the referenced configuration template ConfigMap object. |
string | (Optional) Specifies the namespace of the referenced configuration template ConfigMap object. An empty namespace is equivalent to the “default” namespace. |
MergedPolicy | (Optional) Defines the strategy for merging externally imported templates into component templates. |
ConnectionCredentialAuth
(Appears on:ServiceDescriptorSpec)
ConnectionCredentialAuth specifies the authentication credentials required for accessing an external service.
Field | Description |
---|---|
CredentialVar | (Optional) Specifies the username for the external service. |
CredentialVar | (Optional) Specifies the password for the external service. |
ContainerVars
(Appears on:HostNetworkVars)
ContainerVars defines the vars that can be referenced from a Container.
Field | Description |
---|---|
string | The name of the container. |
NamedVar | (Optional) Container port to reference. |
CredentialVar
(Appears on:ConnectionCredentialAuth, ServiceDescriptorSpec)
CredentialVar represents a variable that retrieves its value either directly from a specified expression
or from a source defined in valueFrom
.
Only one of these options may be used at a time.
Field | Description |
---|---|
string | (Optional) Holds a direct string or an expression that can be evaluated to a string. It can include variables denoted by $(VAR_NAME). These variables are expanded to the value of the environment variables defined in the container. If a variable cannot be resolved, it remains unchanged in the output. To escape variable expansion and retain the literal value, use double $ characters. For example:
Default value is an empty string. |
Kubernetes core/v1.EnvVarSource | (Optional) Specifies the source for the variable’s value. |
CredentialVarSelector
(Appears on:VarSource)
CredentialVarSelector selects a var from a Credential (SystemAccount).
Field | Description |
---|---|
ClusterObjectReference | (Members of The Credential (SystemAccount) to select from. |
CredentialVars | (Members of |
CredentialVars
(Appears on:CredentialVarSelector, ServiceRefVars)
CredentialVars defines the vars that can be referenced from a Credential (SystemAccount). !!!!! CredentialVars will only be used as environment variables for Pods & Actions, and will not be used to render the templates.
Field | Description |
---|---|
VarOption | (Optional) |
VarOption | (Optional) |
EnvVar
(Appears on:ComponentDefinitionSpec, SidecarDefinitionSpec)
EnvVar represents a variable present in the env of Pod/Action or the template of config/script.
Field | Description |
---|---|
string | Name of the variable. Must be a C_IDENTIFIER. |
string | (Optional) Variable references If a variable cannot be resolved, the reference in the input string will be unchanged.
Double
Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to “”. |
VarSource | (Optional) Source for the variable’s value. Cannot be used if value is not empty. |
string | (Optional) A Go template expression that will be applied to the resolved value of the var. The expression will only be evaluated if the var is successfully resolved to a non-credential value. The resolved value can be accessed by its name within the expression, system vars and other user-defined non-credential vars can be used within the expression in the same way. Notice that, when accessing vars by its name, you should replace all the “-” in the name with “_”, because of that “-” is not a valid identifier in Go. All expressions are evaluated in the order the vars are defined. If a var depends on any vars that also have expressions defined, be careful about the evaluation order as it may use intermediate values. The result of evaluation will be used as the final value of the var. If the expression fails to evaluate, the resolving of var will also be considered failed. |
ExecAction
(Appears on:Action)
ExecAction describes an Action that executes a command inside a container.
Field | Description |
---|---|
string | (Optional) Specifies the container image to be used for running the Action. When specified, a dedicated container will be created using this image to execute the Action. All actions with same image will share the same container. This field cannot be updated. |
[]Kubernetes core/v1.EnvVar | (Optional) Represents a list of environment variables that will be injected into the container. These variables enable the container to adapt its behavior based on the environment it’s running in. This field cannot be updated. |
[]string | (Optional) Specifies the command to be executed inside the container. The working directory for this command is the container’s root directory(‘/’). Commands are executed directly without a shell environment, meaning shell-specific syntax (‘|’, etc.) is not supported. If the shell is required, it must be explicitly invoked in the command. A successful execution is indicated by an exit status of 0; any non-zero status signifies a failure. |
[]string | (Optional) Args represents the arguments that are passed to the |
TargetPodSelector | (Optional) Defines the criteria used to select the target Pod(s) for executing the Action. This is useful when there is no default target replica identified. It allows for precise control over which Pod(s) the Action should run in. If not specified, the Action will be executed in the pod where the Action is triggered, such as the pod to be removed or added; or a random pod if the Action is triggered at the component level, such as post-provision or pre-terminate of the component. This field cannot be updated. |
string | (Optional) Used in conjunction with the
This field cannot be updated. |
string | (Optional) Specifies the name of the container within the same pod whose resources will be shared with the action. This allows the action to utilize the specified container’s resources without executing within it. The name must match one of the containers defined in The resources that can be shared are included:
This field cannot be updated. |
Exporter
(Appears on:ComponentDefinitionSpec)
Field | Description |
---|---|
string | (Optional) Specifies the name of the built-in metrics exporter container. |
string | (Optional) Specifies the http/https url path to scrape for metrics.
If empty, Prometheus uses the default value (e.g. |
string | (Optional) Specifies the port name to scrape for metrics. |
PrometheusScheme | (Optional) Specifies the schema to use for scraping.
|
HostNetwork
(Appears on:ComponentDefinitionSpec)
Field | Description |
---|---|
[]HostNetworkContainerPort | (Optional) The list of container ports that are required by the component. |
HostNetworkContainerPort
(Appears on:HostNetwork)
Field | Description |
---|---|
string | Container specifies the target container within the Pod. |
[]string | Ports are named container ports within the specified container. These container ports must be defined in the container for proper port allocation. |
HostNetworkVarSelector
(Appears on:VarSource)
HostNetworkVarSelector selects a var from host-network resources.
Field | Description |
---|---|
ClusterObjectReference | (Members of The component to select from. |
HostNetworkVars | (Members of |
HostNetworkVars
(Appears on:HostNetworkVarSelector)
HostNetworkVars defines the vars that can be referenced from host-network resources.
Field | Description |
---|---|
ContainerVars | (Optional) |
InstanceTemplate
(Appears on:ClusterComponentSpec, ComponentSpec, InstanceSetSpec)
InstanceTemplate allows customization of individual replica configurations in a Component.
Field | Description |
---|---|
string | Name specifies the unique name of the instance Pod created using this InstanceTemplate. This name is constructed by concatenating the Component’s name, the template’s name, and the instance’s ordinal using the pattern: $(cluster.name)-$(component.name)-$(template.name)-$(ordinal). Ordinals start from 0. The specified name overrides any default naming conventions or patterns. |
int32 | (Optional) Specifies the number of instances (Pods) to create from this InstanceTemplate. This field allows setting how many replicated instances of the Component, with the specific overrides in the InstanceTemplate, are created. The default value is 1. A value of 0 disables instance creation. |
Ordinals | Specifies the desired Ordinals of this InstanceTemplate. The Ordinals used to specify the ordinal of the instance (pod) names to be generated under this InstanceTemplate. For example, if Ordinals is {ranges: [{start: 0, end: 1}], discrete: [7]}, then the instance names generated under this InstanceTemplate would be $(cluster.name)-$(component.name)-$(template.name)-0、$(cluster.name)-$(component.name)-$(template.name)-1 and $(cluster.name)-$(component.name)-$(template.name)-7 |
map[string]string | (Optional) Specifies a map of key-value pairs to be merged into the Pod’s existing annotations. Existing keys will have their values overwritten, while new keys will be added to the annotations. |
map[string]string | (Optional) Specifies a map of key-value pairs that will be merged into the Pod’s existing labels. Values for existing keys will be overwritten, and new keys will be added. |
string | (Optional) Specifies an override for the first container’s image in the Pod. |
SchedulingPolicy | (Optional) Specifies the scheduling policy for the Component. |
Kubernetes core/v1.ResourceRequirements | (Optional) Specifies an override for the resource requirements of the first container in the Pod. This field allows for customizing resource allocation (CPU, memory, etc.) for the container. |
[]Kubernetes core/v1.EnvVar | (Optional) Defines Env to override. Add new or override existing envs. |
[]Kubernetes core/v1.Volume | (Optional) Defines Volumes to override. Add new or override existing volumes. |
[]Kubernetes core/v1.VolumeMount | (Optional) Defines VolumeMounts to override. Add new or override existing volume mounts of the first container in the Pod. |
[]ClusterComponentVolumeClaimTemplate | (Optional) Defines VolumeClaimTemplates to override. Add new or override existing volume claim templates. |
Issuer
(Appears on:ClusterComponentSpec, TLSConfig)
Issuer defines the TLS certificates issuer for the Cluster.
Field | Description |
---|---|
IssuerName | The issuer for TLS certificates.
It only allows two enum values:
|
TLSSecretRef | (Optional) SecretRef is the reference to the secret that contains user-provided certificates.
It is required when the issuer is set to |
IssuerName
(string
alias)
(Appears on:Issuer)
IssuerName defines the name of the TLS certificates issuer.
Value | Description |
---|---|
"KubeBlocks" | IssuerKubeBlocks represents certificates that are signed by the KubeBlocks Operator. |
"UserProvided" | IssuerUserProvided indicates that the user has provided their own CA-signed certificates. |
LetterCase
(string
alias)
(Appears on:PasswordConfig)
LetterCase defines the available cases to be used in password generation.
Value | Description |
---|---|
"LowerCases" | LowerCases represents the use of lower case letters only. |
"MixedCases" | MixedCases represents the use of a mix of both lower and upper case letters. |
"UpperCases" | UpperCases represents the use of upper case letters only. |
LogConfig
(Appears on:ComponentDefinitionSpec)
Field | Description |
---|---|
string | Specifies a descriptive label for the log type, such as ‘slow’ for a MySQL slow log file. It provides a clear identification of the log’s purpose and content. |
string | Specifies the paths or patterns identifying where the log files are stored. This field allows the system to locate and manage log files effectively. Examples:
|
MergedPolicy
(string
alias)
(Appears on:ConfigTemplateExtension)
MergedPolicy defines how to merge external imported templates into component templates.
Value | Description |
---|---|
"none" | |
"add" | |
"patch" | |
"replace" |
MultipleClusterObjectCombinedOption
(Appears on:MultipleClusterObjectOption)
MultipleClusterObjectCombinedOption defines options for handling combined variables.
Field | Description |
---|---|
string | (Optional) If set, the existing variable will be kept, and a new variable will be defined with the specified suffix in pattern: $(var.name)_$(suffix). The new variable will be auto-created and placed behind the existing one. If not set, the existing variable will be reused with the value format defined below. |
MultipleClusterObjectValueFormat | (Optional) The format of the value that the operator will use to compose values from multiple components. |
MultipleClusterObjectValueFormatFlatten | (Optional) The flatten format, default is: $(comp-name-1):value,$(comp-name-2):value. |
MultipleClusterObjectOption
(Appears on:ClusterObjectReference)
MultipleClusterObjectOption defines the options for handling multiple cluster objects matched.
Field | Description |
---|---|
MultipleClusterObjectStrategy | Define the strategy for handling multiple cluster objects. |
MultipleClusterObjectCombinedOption | (Optional) Define the options for handling combined variables. Valid only when the strategy is set to “combined”. |
MultipleClusterObjectStrategy
(string
alias)
(Appears on:MultipleClusterObjectOption)
MultipleClusterObjectStrategy defines the strategy for handling multiple cluster objects.
Value | Description |
---|---|
"combined" | MultipleClusterObjectStrategyCombined - the values from all matched components will be combined into a single variable using the specified option. |
"individual" | MultipleClusterObjectStrategyIndividual - each matched component will have its individual variable with its name as the suffix. This is required when referencing credential variables that cannot be passed by values. |
MultipleClusterObjectValueFormat
(string
alias)
(Appears on:MultipleClusterObjectCombinedOption)
MultipleClusterObjectValueFormat defines the format details for the value.
Value | Description |
---|---|
"Flatten" |
MultipleClusterObjectValueFormatFlatten
(Appears on:MultipleClusterObjectCombinedOption)
MultipleClusterObjectValueFormatFlatten defines the flatten format for the value.
Field | Description |
---|---|
string | Pair delimiter. |
string | Key-value delimiter. |
NamedVar
(Appears on:ContainerVars, ServiceVars)
Field | Description |
---|---|
string | (Optional) |
VarOption | (Optional) |
Ordinals
(Appears on:InstanceTemplate, InstanceSetSpec)
Ordinals represents a combination of continuous segments and individual values.
Field | Description |
---|---|
[]Range | |
[]int32 |
PasswordConfig
(Appears on:ComponentSystemAccount, SystemAccount)
PasswordConfig helps provide to customize complexity of password generation pattern.
Field | Description |
---|---|
int32 | (Optional) The length of the password. |
int32 | (Optional) The number of digits in the password. |
int32 | (Optional) The number of symbols in the password. |
LetterCase | (Optional) The case of the letters in the password. |
string | (Optional) Seed to generate the account’s password. Cannot be updated. |
PersistentVolumeClaimSpec
(Appears on:ClusterComponentVolumeClaimTemplate)
Field | Description |
---|---|
[]Kubernetes core/v1.PersistentVolumeAccessMode | (Optional) Contains the desired access modes the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1. |
Kubernetes core/v1.VolumeResourceRequirements | (Optional) Represents the minimum resources the volume should have. If the RecoverVolumeExpansionFailure feature is enabled, users are allowed to specify resource requirements that are lower than the previous value but must still be higher than the capacity recorded in the status field of the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources. |
string | (Optional) The name of the StorageClass required by the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1. |
Kubernetes core/v1.PersistentVolumeMode | (Optional) Defines what type of volume is required by the claim, either Block or Filesystem. |
string | (Optional) volumeAttributesClassName may be used to set the VolumeAttributesClass used by this claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#volumeattributesclass |
Phase
(string
alias)
(Appears on:ClusterDefinitionStatus, ComponentDefinitionStatus, ComponentVersionStatus, ServiceDescriptorStatus, ShardingDefinitionStatus, SidecarDefinitionStatus)
Phase represents the status of a CR.
Value | Description |
---|---|
"Available" | AvailablePhase indicates that a CR is in an available state. |
"Unavailable" | UnavailablePhase indicates that a CR is in an unavailable state. |
PodUpdatePolicyType
(string
alias)
(Appears on:ClusterComponentSpec, ComponentSpec)
Value | Description |
---|---|
"PreferInPlace" | PreferInPlacePodUpdatePolicyType indicates that we will first attempt an in-place upgrade of the Pod. If that fails, it will fall back to the ReCreate, where pod will be recreated. |
"StrictInPlace" | StrictInPlacePodUpdatePolicyType indicates that only allows in-place upgrades. Any attempt to modify other fields will be rejected. |
PreConditionType
(string
alias)
(Appears on:Action)
PreConditionType defines the preCondition type of the action execution.
Value | Description |
---|---|
"ClusterReady" | |
"ComponentReady" | |
"Immediately" | |
"RuntimeReady" |
Probe
(Appears on:ComponentLifecycleActions)
Field | Description |
---|---|
Action | (Members of |
int32 | (Optional) Specifies the number of seconds to wait after the container has started before the RoleProbe begins to detect the container’s role. |
int32 | (Optional) Specifies the frequency at which the probe is conducted. This value is expressed in seconds. Default to 10 seconds. Minimum value is 1. |
int32 | (Optional) Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to 1. Minimum value is 1. |
int32 | (Optional) Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1. |
PrometheusScheme
(string
alias)
(Appears on:Exporter)
PrometheusScheme defines the protocol of prometheus scrape metrics.
Value | Description |
---|---|
"http" | |
"https" |
ProvisionSecretRef
(Appears on:ComponentSystemAccount, SystemAccount)
ProvisionSecretRef represents the reference to a secret.
Field | Description |
---|---|
string | The unique identifier of the secret. |
string | The namespace where the secret is located. |
Range
(Appears on:Ordinals)
Range represents a range with a start and an end value. It is used to define a continuous segment.
Field | Description |
---|---|
int32 | |
int32 |
ReplicaRole
(Appears on:ComponentDefinitionSpec, InstanceSetSpec, MemberStatus)
ReplicaRole represents a role that can be assigned to a component instance, defining its behavior and responsibilities.
Field | Description |
---|---|
string | Name defines the role’s unique identifier. This value is used to set the “apps.kubeblocks.io/role” label on the corresponding object to identify its role. For example, common role names include:
This field is immutable once set. |
int | (Optional) UpdatePriority determines the order in which pods with different roles are updated. Pods are sorted by this priority (higher numbers = higher priority) and updated accordingly. Roles with the highest priority will be updated last. The default priority is 0. For example:
This field is immutable once set. |
bool | (Optional) ParticipatesInQuorum indicates if pods with this role are counted when determining quorum. This affects update strategies that need to maintain quorum for availability. Roles participate in quorum should have higher update priority than roles do not participate in quorum. The default value is false. For example, in a 5-pod component where:
This field is immutable once set. |
ReplicasLimit
(Appears on:ComponentDefinitionSpec)
ReplicasLimit defines the valid range of number of replicas supported.
Field | Description |
---|---|
int32 | The minimum limit of replicas. |
int32 | The maximum limit of replicas. |
RerenderResourceType
(string
alias)
(Appears on:ComponentConfigSpec)
RerenderResourceType defines the resource requirements for a component.
Value | Description |
---|---|
"hscale" | |
"vscale" |
RetryPolicy
(Appears on:Action)
Field | Description |
---|---|
int | (Optional) Defines the maximum number of retry attempts that should be made for a given Action. This value is set to 0 by default, indicating that no retries will be made. |
time.Duration | (Optional) Indicates the duration of time to wait between each retry attempt. This value is set to 0 by default, indicating that there will be no delay between retry attempts. |
RoledVar
(Appears on:ComponentVars)
Field | Description |
---|---|
string | (Optional) |
VarOption | (Optional) |
SchedulingPolicy
(Appears on:ClusterComponentSpec, ClusterSpec, ComponentSpec, InstanceTemplate)
Field | Description |
---|---|
string | (Optional) If specified, the Pod will be dispatched by specified scheduler. If not specified, the Pod will be dispatched by default scheduler. |
map[string]string | (Optional) NodeSelector is a selector which must be true for the Pod to fit on a node. Selector which must match a node’s labels for the Pod to be scheduled on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/ |
string | (Optional) NodeName is a request to schedule this Pod onto a specific node. If it is non-empty, the scheduler simply schedules this Pod onto that node, assuming that it fits resource requirements. |
Kubernetes core/v1.Affinity | (Optional) Specifies a group of affinity scheduling rules of the Cluster, including NodeAffinity, PodAffinity, and PodAntiAffinity. |
[]Kubernetes core/v1.Toleration | (Optional) Allows Pods to be scheduled onto nodes with matching taints.
Each toleration in the array allows the Pod to tolerate node taints based on
specified
Pods with matching tolerations are allowed to be scheduled on tainted nodes, typically reserved for specific purposes. |
[]Kubernetes core/v1.TopologySpreadConstraint | (Optional) TopologySpreadConstraints describes how a group of Pods ought to spread across topology domains. Scheduler will schedule Pods in a way which abides by the constraints. All topologySpreadConstraints are ANDed. |
Service
(Appears on:ClusterService, ComponentService)
Field | Description | ||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
string | Name defines the name of the service. otherwise, it indicates the name of the service. Others can refer to this service by its name. (e.g., connection credential) Cannot be updated. | ||||||||||||||||||||||||||||||||||||||
string | (Optional) ServiceName defines the name of the underlying service object. If not specified, the default service name with different patterns will be used:
Only one default service name is allowed. Cannot be updated. | ||||||||||||||||||||||||||||||||||||||
map[string]string | (Optional) If ServiceType is LoadBalancer, cloud provider related parameters can be put here More info: https://kubernetes.io/docs/concepts/services-networking/service/#loadbalancer. | ||||||||||||||||||||||||||||||||||||||
Kubernetes core/v1.ServiceSpec | (Optional) Spec defines the behavior of a service. https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
| ||||||||||||||||||||||||||||||||||||||
string | (Optional) Extends the above
In this example, setting Note that if |
ServiceDescriptorSpec
(Appears on:ServiceDescriptor)
ServiceDescriptorSpec defines the desired state of ServiceDescriptor
Field | Description |
---|---|
string | Describes the type of database service provided by the external service. For example, “mysql”, “redis”, “mongodb”. This field categorizes databases by their functionality, protocol and compatibility, facilitating appropriate service integration based on their unique capabilities. This field is case-insensitive. It also supports abbreviations for some well-known databases:
|
string | Describes the version of the service provided by the external service. This is crucial for ensuring compatibility between different components of the system, as different versions of a service may have varying features. |
CredentialVar | (Optional) Specifies the endpoint of the external service. If the service is exposed via a cluster, the endpoint will be provided in the format of |
CredentialVar | (Optional) Specifies the service or IP address of the external service. |
CredentialVar | (Optional) Specifies the port of the external service. |
CredentialVar | (Optional) Specifies the pod FQDNs of the external service. |
ConnectionCredentialAuth | (Optional) Specifies the authentication credentials required for accessing an external service. |
ServiceDescriptorStatus
(Appears on:ServiceDescriptor)
ServiceDescriptorStatus defines the observed state of ServiceDescriptor
Field | Description |
---|---|
int64 | (Optional) Represents the generation number that has been processed by the controller. |
Phase | (Optional) Indicates the current lifecycle phase of the ServiceDescriptor. This can be either ‘Available’ or ‘Unavailable’. |
string | (Optional) Provides a human-readable explanation detailing the reason for the current phase of the ServiceConnectionCredential. |
ServiceRef
(Appears on:ClusterComponentSpec, ComponentSpec)
Field | Description |
---|---|
string | Specifies the identifier of the service reference declaration. It corresponds to the serviceRefDeclaration name defined in either:
|
string | (Optional) Specifies the namespace of the referenced Cluster or the namespace of the referenced ServiceDescriptor object. If not provided, the referenced Cluster and ServiceDescriptor will be searched in the namespace of the current Cluster by default. |
string | (Optional) Specifies the name of the KubeBlocks Cluster being referenced. This is used when services from another KubeBlocks Cluster are consumed. By default, the referenced KubeBlocks Cluster’s Note:
Deprecated since v0.9 since |
ServiceRefClusterSelector | (Optional) References a service provided by another KubeBlocks Cluster. It specifies the ClusterService and the account credentials needed for access. |
string | (Optional) Specifies the name of the ServiceDescriptor object that describes a service provided by external sources. When referencing a service provided by external sources, a ServiceDescriptor object is required to establish
the service binding.
The If both |
ServiceRefClusterSelector
(Appears on:ServiceRef)
Field | Description |
---|---|
string | The name of the Cluster being referenced. |
ServiceRefServiceSelector | (Optional) Identifies a ClusterService from the list of Services defined in |
ServiceRefPodFQDNsSelector | (Optional) |
ServiceRefCredentialSelector | (Optional) Specifies the SystemAccount to authenticate and establish a connection with the referenced Cluster.
The SystemAccount should be defined in |
ServiceRefCredentialSelector
(Appears on:ServiceRefClusterSelector)
Field | Description |
---|---|
string | The name of the Component where the credential resides in. |
string | The name of the credential (SystemAccount) to reference. |
ServiceRefDeclaration
(Appears on:ComponentDefinitionSpec)
ServiceRefDeclaration represents a reference to a service that can be either provided by a KubeBlocks Cluster or an external service. It acts as a placeholder for the actual service reference, which is determined later when a Cluster is created.
The purpose of ServiceRefDeclaration is to declare a service dependency without specifying the concrete details of the service. It allows for flexibility and abstraction in defining service references within a Component. By using ServiceRefDeclaration, you can define service dependencies in a declarative manner, enabling loose coupling and easier management of service references across different components and clusters.
Upon Cluster creation, the ServiceRefDeclaration is bound to an actual service through the ServiceRef field, effectively resolving and connecting to the specified service.
Field | Description |
---|---|
string | Specifies the name of the ServiceRefDeclaration. |
[]ServiceRefDeclarationSpec | Defines a list of constraints and requirements for services that can be bound to this ServiceRefDeclaration upon Cluster creation. Each ServiceRefDeclarationSpec defines a ServiceKind and ServiceVersion, outlining the acceptable service types and versions that are compatible. This flexibility allows a ServiceRefDeclaration to be fulfilled by any one of the provided specs. For example, if it requires an OLTP database, specs for both MySQL and PostgreSQL are listed, either MySQL or PostgreSQL services can be used when binding. |
bool | (Optional) Specifies whether the service reference can be optional. For an optional service-ref, the component can still be created even if the service-ref is not provided. |
ServiceRefDeclarationSpec
(Appears on:ServiceRefDeclaration)
Field | Description |
---|---|
string | Specifies the type or nature of the service. This should be a well-known application cluster type, such as
{mysql, redis, mongodb}.
The field is case-insensitive and supports abbreviations for some well-known databases.
For instance, both |
string | Defines the service version of the service reference. This is a regular expression that matches a version number pattern.
For instance, |
ServiceRefPodFQDNsSelector
(Appears on:ServiceRefClusterSelector)
Field | Description |
---|---|
string | The name of the Component where the pods reside in. |
string | (Optional) The role of the pods to reference. |
ServiceRefServiceSelector
(Appears on:ServiceRefClusterSelector)
Field | Description |
---|---|
string | (Optional) The name of the Component where the Service resides in. It is required when referencing a Component’s Service. |
string | The name of the Service to be referenced. Leave it empty to reference the default Service. Set it to “headless” to reference the default headless Service. If the referenced Service is of pod-service type (a Service per Pod), there will be multiple Service objects matched, and the resolved value will be presented in the following format: service1.name,service2.name… |
string | (Optional) The port name of the Service to be referenced. If there is a non-zero node-port exist for the matched Service port, the node-port will be selected first. If the referenced Service is of pod-service type (a Service per Pod), there will be multiple Service objects matched, and the resolved value will be presented in the following format: service1.name:port1,service2.name:port2… |
ServiceRefVarSelector
(Appears on:VarSource)
ServiceRefVarSelector selects a var from a ServiceRefDeclaration.
Field | Description |
---|---|
ClusterObjectReference | (Members of The ServiceRefDeclaration to select from. |
ServiceRefVars | (Members of |
ServiceRefVars
(Appears on:ServiceRefVarSelector)
ServiceRefVars defines the vars that can be referenced from a ServiceRef.
Field | Description |
---|---|
VarOption | (Optional) |
VarOption | (Optional) |
VarOption | (Optional) |
VarOption | (Optional) |
CredentialVars | (Members of |
ServiceVarSelector
(Appears on:VarSource)
ServiceVarSelector selects a var from a Service.
Field | Description |
---|---|
ClusterObjectReference | (Members of The Service to select from. It can be referenced from the default headless service by setting the name to “headless”. |
ServiceVars | (Members of |
ServiceVars
(Appears on:ServiceVarSelector)
ServiceVars defines the vars that can be referenced from a Service.
Field | Description |
---|---|
VarOption | (Optional) ServiceType references the type of the service. |
VarOption | (Optional) |
VarOption | (Optional) LoadBalancer represents the LoadBalancer ingress point of the service. If multiple ingress points are available, the first one will be used automatically, choosing between IP and Hostname. |
NamedVar | (Optional) Port references a port or node-port defined in the service. If the referenced service is a pod-service, there will be multiple service objects matched, and the value will be presented in the following format: service1.name:port1,service2.name:port2… |
ShardingDefinitionSpec
(Appears on:ShardingDefinition)
ShardingDefinitionSpec defines the desired state of ShardingDefinition
Field | Description |
---|---|
ShardingTemplate | This field is immutable. |
ShardsLimit | (Optional) Defines the upper limit of the number of shards supported by the sharding. This field is immutable. |
UpdateStrategy | (Optional) Specifies the strategy for provisioning shards of the sharding. Only This field is immutable. |
UpdateStrategy | (Optional) Specifies the strategy for updating shards of the sharding. Only This field is immutable. |
ShardingLifecycleActions | (Optional) Defines a set of hooks and procedures that customize the behavior of a sharding throughout its lifecycle. This field is immutable. |
[]ShardingSystemAccount | (Optional) Defines the system accounts for the sharding. This field is immutable. |
ShardingTLS | (Optional) Defines the TLS for the sharding. This field is immutable. |
ShardingDefinitionStatus
(Appears on:ShardingDefinition)
ShardingDefinitionStatus defines the observed state of ShardingDefinition
Field | Description |
---|---|
int64 | (Optional) Refers to the most recent generation that has been observed for the ShardingDefinition. |
Phase | (Optional) Represents the current status of the ShardingDefinition. Valid values include ``, |
string | (Optional) Provides additional information about the current phase. |
ShardingLifecycleActions
(Appears on:ShardingDefinitionSpec)
ShardingLifecycleActions defines a collection of Actions for customizing the behavior of a sharding.
Field | Description |
---|---|
Action | (Optional) Specifies the hook to be executed after a sharding’s creation. By setting With The PostProvision Action is intended to run only once. Note: This field is immutable once it has been set. |
Action | (Optional) Specifies the hook to be executed prior to terminating a sharding. The PreTerminate Action is intended to run only once. This action is executed immediately when a terminate operation for the sharding is initiated. The actual termination and cleanup of the sharding and its associated resources will not proceed until the PreTerminate action has completed successfully. Note: This field is immutable once it has been set. |
Action | (Optional) Specifies the hook to be executed after a shard added. Note: This field is immutable once it has been set. |
Action | (Optional) Specifies the hook to be executed prior to remove a shard. Note: This field is immutable once it has been set. |
ShardingSystemAccount
(Appears on:ShardingDefinitionSpec)
Field | Description |
---|---|
string | The name of the system account defined in the sharding template. This field is immutable once set. |
bool | (Optional) Specifies whether the account is shared across all shards in the sharding. |
ShardingTLS
(Appears on:ShardingDefinitionSpec)
Field | Description |
---|---|
bool | (Optional) Specifies whether the TLS configuration is shared across all shards in the sharding. |
ShardingTemplate
(Appears on:ShardingDefinitionSpec)
Field | Description |
---|---|
string | The component definition(s) that the sharding is based on. The component definition can be specified using one of the following:
This field is immutable. |
ShardsLimit
(Appears on:ShardingDefinitionSpec)
ShardsLimit defines the valid range of number of shards supported.
Field | Description |
---|---|
int32 | The minimum limit of shards. |
int32 | The maximum limit of replicas. |
Sidecar
(Appears on:ComponentSpec)
Field | Description |
---|---|
string | Name specifies the unique name of the sidecar. The name will be used as the name of the sidecar container in the Pod. |
string | Specifies the exact component definition that the sidecar belongs to. A sidecar will be updated when the owner component definition is updated only. |
string | Specifies the sidecar definition CR to be used to create the sidecar. |
SidecarDefinitionSpec
(Appears on:SidecarDefinition)
SidecarDefinitionSpec defines the desired state of SidecarDefinition
Field | Description |
---|---|
string | Specifies the name of the sidecar. |
string | Specifies the component definition that the sidecar belongs to. For a specific cluster object, if there is any components provided by the component definition of @owner, the sidecar will be created and injected into the components which are provided by the component definition of @selectors automatically. This field is immutable. |
[]string | Specifies the component definition of components that the sidecar along with. This field is immutable. |
[]Kubernetes core/v1.Container | List of containers for the sidecar. Cannot be updated. |
[]EnvVar | (Optional) Defines variables which are needed by the sidecar. This field is immutable. |
[]ComponentTemplateSpec | (Optional) Specifies the configuration file templates used by the Sidecar. This field is immutable. |
[]ComponentTemplateSpec | (Optional) Specifies the scripts used by the Sidecar. This field is immutable. |
SidecarDefinitionStatus
(Appears on:SidecarDefinition)
SidecarDefinitionStatus defines the observed state of SidecarDefinition
Field | Description |
---|---|
int64 | (Optional) Refers to the most recent generation that has been observed for the SidecarDefinition. |
Phase | (Optional) Represents the current status of the SidecarDefinition. Valid values include ``, |
string | (Optional) Provides additional information about the current phase. |
string | (Optional) Resolved owners of the SidecarDefinition. |
string | (Optional) Resolved selectors of the SidecarDefinition. |
SystemAccount
(Appears on:ComponentDefinitionSpec)
Field | Description |
---|---|
string | Specifies the unique identifier for the account. This name is used by other entities to reference the account. This field is immutable once set. |
bool | (Optional) Indicates if this account is a system initialization account (e.g., MySQL root). This field is immutable once set. |
string | (Optional) Defines the statement used to create the account with the necessary privileges. This field is immutable once set. |
PasswordConfig | (Optional) Specifies the policy for generating the account’s password. This field is immutable once set. |
ProvisionSecretRef | (Optional) Refers to the secret from which data will be copied to create the new account. This field is immutable once set. |
TLS
(Appears on:ComponentDefinitionSpec)
Field | Description |
---|---|
string | Specifies the volume name for the TLS secret. The controller will create a volume object with the specified name and add it to the pod when the TLS is enabled. This field is immutable once set. |
string | Specifies the mount path for the TLS secret to be mounted. Similar to the volume, the controller will mount the created volume to the specified path within containers when the TLS is enabled. This field is immutable once set. |
int32 | (Optional) The permissions for the mounted path. Defaults to 0600. This field is immutable once set. |
string | (Optional) The CA file of the TLS. This field is immutable once set. |
string | (Optional) The certificate file of the TLS. This field is immutable once set. |
string | (Optional) The key file of the TLS. This field is immutable once set. |
TLSConfig
(Appears on:ComponentSpec)
Field | Description |
---|---|
bool | (Optional) A boolean flag that indicates whether the Component should use Transport Layer Security (TLS) for secure communication. When set to true, the Component will be configured to use TLS encryption for its network connections. This ensures that the data transmitted between the Component and its clients or other Components is encrypted and protected from unauthorized access. If TLS is enabled, the Component may require additional configuration, such as specifying TLS certificates and keys, to properly set up the secure communication channel. |
Issuer | (Optional) Specifies the configuration for the TLS certificates issuer. It allows defining the issuer name and the reference to the secret containing the TLS certificates and key. The secret should contain the CA certificate, TLS certificate, and private key in the specified keys. Required when TLS is enabled. |
TLSSecretRef
(Appears on:Issuer)
TLSSecretRef defines Secret contains Tls certs
Field | Description |
---|---|
string | Name of the Secret that contains user-provided certificates. |
string | Key of CA cert in Secret |
string | Key of Cert in Secret |
string | Key of TLS private key in Secret |
TLSVarSelector
(Appears on:VarSource)
TLSVarSelector selects a var from the TLS.
Field | Description |
---|---|
ClusterObjectReference | (Members of The Component to select from. |
TLSVars | (Members of |
TLSVars
(Appears on:TLSVarSelector)
TLSVars defines the vars that can be referenced from the TLS.
Field | Description |
---|---|
VarOption | (Optional) |
TargetPodSelector
(string
alias)
(Appears on:ExecAction)
TargetPodSelector defines how to select pod(s) to execute an Action.
Value | Description |
---|---|
"All" | |
"Any" | |
"Ordinal" | |
"Role" |
TerminationPolicyType
(string
alias)
(Appears on:ClusterSpec)
TerminationPolicyType defines termination policy types.
Value | Description |
---|---|
"Delete" | Delete will delete all runtime resources belong to the cluster. |
"DoNotTerminate" | DoNotTerminate will block delete operation. |
"WipeOut" | WipeOut is based on Delete and wipe out all volume snapshots and snapshot data from backup storage location. |
UpdateStrategy
(string
alias)
(Appears on:ComponentDefinitionSpec, ShardingDefinitionSpec)
UpdateStrategy defines the update strategy for cluster components. This strategy determines how updates are applied
across the cluster.
The available strategies are Serial
, BestEffortParallel
, and Parallel
.
Value | Description |
---|---|
"BestEffortParallel" | BestEffortParallelStrategy indicates that the replicas are updated in parallel, with the operator making
a best-effort attempt to update as many replicas as possible concurrently
while maintaining the component’s availability.
Unlike the For example, consider a component with 5 replicas. To maintain the component’s availability and quorum, the operator may allow a maximum of 2 replicas to be simultaneously updated. This ensures that at least 3 replicas (a quorum) remain available and functional during the update process. The |
"Parallel" | ParallelStrategy indicates that updates are applied simultaneously to all Pods of a Component. The replicas are updated in parallel, with the operator updating all replicas concurrently. This strategy provides the fastest update time but may lead to a period of reduced availability or capacity during the update process. |
"Serial" | SerialStrategy indicates that updates are applied one at a time in a sequential manner. The operator waits for each replica to be updated and ready before proceeding to the next one. This ensures that only one replica is unavailable at a time during the update process. |
VarOption
(string
alias)
(Appears on:ClusterVars, ComponentVars, CredentialVars, NamedVar, RoledVar, ServiceRefVars, ServiceVars, TLSVars)
VarOption defines whether a variable is required or optional.
VarSource
(Appears on:EnvVar)
VarSource represents a source for the value of an EnvVar.
Field | Description |
---|---|
Kubernetes core/v1.ConfigMapKeySelector | (Optional) Selects a key of a ConfigMap. |
Kubernetes core/v1.SecretKeySelector | (Optional) Selects a key of a Secret. |
HostNetworkVarSelector | (Optional) Selects a defined var of host-network resources. |
ServiceVarSelector | (Optional) Selects a defined var of a Service. |
CredentialVarSelector | (Optional) Selects a defined var of a Credential (SystemAccount). |
TLSVarSelector | (Optional) Selects a defined var of the TLS. |
ServiceRefVarSelector | (Optional) Selects a defined var of a ServiceRef. |
ComponentVarSelector | (Optional) Selects a defined var of a Component. |
ClusterVarSelector | (Optional) Selects a defined var of a Cluster. |
apps.kubeblocks.io/v1alpha1
Resource Types:
- Cluster
- ClusterDefinition
- Component
- ComponentDefinition
- ComponentVersion
- ConfigConstraint
- Configuration
- ServiceDescriptor
Cluster
Cluster offers a unified management interface for a wide variety of database and storage systems:
Relational databases: MySQL, PostgreSQL, MariaDB
NoSQL databases: Redis, MongoDB
KV stores: ZooKeeper, etcd
Analytics systems: ElasticSearch, OpenSearch, ClickHouse, Doris, StarRocks, Solr
Message queues: Kafka, Pulsar
Distributed SQL: TiDB, OceanBase
Vector databases: Qdrant, Milvus, Weaviate
Object storage: Minio
KubeBlocks utilizes an abstraction layer to encapsulate the characteristics of these diverse systems. A Cluster is composed of multiple Components, each defined by vendors or KubeBlocks Addon developers via ComponentDefinition, arranged in Directed Acyclic Graph (DAG) topologies. The topologies, defined in a ClusterDefinition, coordinate reconciliation across Cluster’s lifecycle phases: Creating, Running, Updating, Stopping, Stopped, Deleting. Lifecycle management ensures that each Component operates in harmony, executing appropriate actions at each lifecycle stage.
For sharded-nothing architecture, the Cluster supports managing multiple shards, each shard managed by a separate Component, supporting dynamic resharding.
The Cluster object is aimed to maintain the overall integrity and availability of a database cluster, serves as the central control point, abstracting the complexity of multiple-component management, and providing a unified interface for cluster-wide operations.
Field | Description | ||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
| ||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||
Kubernetes meta/v1.ObjectMeta | Refer to the Kubernetes API documentation for the fields of the
| ||||||||||||||||||||||||||||||||||||
ClusterSpec |
| ||||||||||||||||||||||||||||||||||||
ClusterStatus |
ClusterDefinition
ClusterDefinition defines the topology for databases or storage systems, offering a variety of topological configurations to meet diverse deployment needs and scenarios.
It includes a list of Components, each linked to a ComponentDefinition, which enhances reusability and reduce redundancy. For example, widely used components such as etcd and Zookeeper can be defined once and reused across multiple ClusterDefinitions, simplifying the setup of new systems.
Additionally, ClusterDefinition also specifies the sequence of startup, upgrade, and shutdown for Components, ensuring a controlled and predictable management of component lifecycles.
Field | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|
|
| ||||||||
|
| ||||||||
Kubernetes meta/v1.ObjectMeta | Refer to the Kubernetes API documentation for the fields of the
| ||||||||
ClusterDefinitionSpec |
| ||||||||
ClusterDefinitionStatus |
Component
Component is a fundamental building block of a Cluster object. For example, a Redis Cluster can include Components like ‘redis’, ‘sentinel’, and potentially a proxy like ‘twemproxy’.
The Component object is responsible for managing the lifecycle of all replicas within a Cluster component, It supports a wide range of operations including provisioning, stopping, restarting, termination, upgrading, configuration changes, vertical and horizontal scaling, failover, switchover, cross-node migration, scheduling configuration, exposing Services, managing system accounts, enabling/disabling exporter, and configuring log collection.
Component is an internal sub-object derived from the user-submitted Cluster object. It is designed primarily to be used by the KubeBlocks controllers, users are discouraged from modifying Component objects directly and should use them only for monitoring Component statuses.
Field | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Kubernetes meta/v1.ObjectMeta | Refer to the Kubernetes API documentation for the fields of the
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||
ComponentSpec |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||
ComponentStatus |
ComponentDefinition
ComponentDefinition serves as a reusable blueprint for creating Components, encapsulating essential static settings such as Component description, Pod templates, configuration file templates, scripts, parameter lists, injected environment variables and their sources, and event handlers. ComponentDefinition works in conjunction with dynamic settings from the ClusterComponentSpec, to instantiate Components during Cluster creation.
Key aspects that can be defined in a ComponentDefinition include:
PodSpec template: Specifies the PodSpec template used by the Component.
Configuration templates: Specify the configuration file templates required by the Component.
Scripts: Provide the necessary scripts for Component management and operations.
Storage volumes: Specify the storage volumes and their configurations for the Component.
Pod roles: Outlines various roles of Pods within the Component along with their capabilities.
Exposed Kubernetes Services: Specify the Services that need to be exposed by the Component.
System accounts: Define the system accounts required for the Component.
Monitoring and logging: Configure the exporter and logging settings for the Component.
ComponentDefinitions also enable defining reactive behaviors of the Component in response to events, such as member join/leave, Component addition/deletion, role changes, switch over, and more. This allows for automatic event handling, thus encapsulating complex behaviors within the Component.
Referencing a ComponentDefinition when creating individual Components ensures inheritance of predefined configurations, promoting reusability and consistency across different deployments and cluster topologies.
Field | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
Kubernetes meta/v1.ObjectMeta | Refer to the Kubernetes API documentation for the fields of the
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
ComponentDefinitionSpec |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
ComponentDefinitionStatus |
ComponentVersion
ComponentVersion is the Schema for the componentversions API
Field | Description | ||||
---|---|---|---|---|---|
|
| ||||
|
| ||||
Kubernetes meta/v1.ObjectMeta | Refer to the Kubernetes API documentation for the fields of the
| ||||
ComponentVersionSpec |
| ||||
ComponentVersionStatus |
ConfigConstraint
ConfigConstraint manages the parameters across multiple configuration files contained in a single configure template. These configuration files should have the same format (e.g. ini, xml, properties, json).
It provides the following functionalities:
Parameter Value Validation: Validates and ensures compliance of parameter values with defined constraints.
Dynamic Reload on Modification: Monitors parameter changes and triggers dynamic reloads to apply updates.
Parameter Rendering in Templates: Injects parameters into templates to generate up-to-date configuration files.
Field | Description | ||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
| ||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||
Kubernetes meta/v1.ObjectMeta | Refer to the Kubernetes API documentation for the fields of the
| ||||||||||||||||||||||||||
ConfigConstraintSpec |
| ||||||||||||||||||||||||||
ConfigConstraintStatus |
Configuration
Configuration represents the complete set of configurations for a specific Component of a Cluster. This includes templates for each configuration file, their corresponding ConfigConstraints, volume mounts, and other relevant details.
Field | Description | ||||||
---|---|---|---|---|---|---|---|
|
| ||||||
|
| ||||||
Kubernetes meta/v1.ObjectMeta | Refer to the Kubernetes API documentation for the fields of the
| ||||||
ConfigurationSpec |
| ||||||
ConfigurationStatus |
ServiceDescriptor
ServiceDescriptor describes a service provided by external sources.
It contains the necessary details such as the service’s address and connection credentials.
To enable a Cluster to access this service, the ServiceDescriptor’s name should be specified
in the Cluster configuration under clusterComponent.serviceRefs[*].serviceDescriptor
.
Field | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
| ||||||||||||
|
| ||||||||||||
Kubernetes meta/v1.ObjectMeta | Refer to the Kubernetes API documentation for the fields of the
| ||||||||||||
ServiceDescriptorSpec |
| ||||||||||||
ServiceDescriptorStatus |
AccessMode
(string
alias)
(Appears on:ConsensusMember)
AccessMode defines the modes of access granted to the SVC.
The modes can be None
, Readonly
, or ReadWrite
.
Value | Description |
---|---|
"None" | None implies no access. |
"ReadWrite" | ReadWrite permits both read and write operations. |
"Readonly" | Readonly allows only read operations. |
AccountName
(string
alias)
(Appears on:SystemAccountConfig)
AccountName defines system account names.
Value | Description |
---|---|
"kbadmin" | |
"kbdataprotection" | |
"kbmonitoring" | |
"kbprobe" | |
"kbreplicator" |
Action
(Appears on:ComponentSwitchover, LifecycleActionHandler, Probe)
Action defines a customizable hook or procedure tailored for different database engines, designed to be invoked at predetermined points within the lifecycle of a Component instance. It provides a modular and extensible way to customize a Component’s behavior through the execution of defined actions.
Available Action triggers include:
postProvision
: Defines the hook to be executed after the creation of a Component, withpreCondition
specifying when the action should be fired relative to the Component’s lifecycle stages:Immediately
,RuntimeReady
,ComponentReady
, andClusterReady
.preTerminate
: Defines the hook to be executed before terminating a Component.roleProbe
: Defines the procedure which is invoked regularly to assess the role of replicas.switchover
: Defines the procedure for a controlled transition of leadership from the current leader to a new replica. This approach aims to minimize downtime and maintain availability in systems with a leader-follower topology, such as during planned maintenance or upgrades on the current leader node.memberJoin
: Defines the procedure to add a new replica to the replication group.memberLeave
: Defines the method to remove a replica from the replication group.readOnly
: Defines the procedure to switch a replica into the read-only state.readWrite
: Defines the procedure to transition a replica from the read-only state back to the read-write state.dataDump
: Defines the procedure to export the data from a replica.dataLoad
: Defines the procedure to import data into a replica.reconfigure
: Defines the procedure that update a replica with new configuration.accountProvision
: Defines the procedure to generate a new database account.
Actions can be executed in different ways:
ExecAction: Executes a command inside a container. which may run as a K8s job or be executed inside the Lorry sidecar container, depending on the implementation. Future implementations will standardize execution within Lorry. A set of predefined environment variables are available and can be leveraged within the
exec.command
to access context information such as details about pods, components, the overall cluster state, or database connection credentials. These variables provide a dynamic and context-aware mechanism for script execution.HTTPAction: Performs an HTTP request. HTTPAction is to be implemented in future version.
GRPCAction: In future version, Actions will support initiating gRPC calls. This allows developers to implement Actions using plugins written in programming language like Go, providing greater flexibility and extensibility.
An action is considered successful on returning 0, or HTTP 200 for status HTTP(s) Actions. Any other return value or HTTP status codes indicate failure, and the action may be retried based on the configured retry policy.
If an action exceeds the specified timeout duration, it will be terminated, and the action is considered failed.
If an action produces any data as output, it should be written to stdout, or included in the HTTP response payload for HTTP(s) actions.
If an action encounters any errors, error messages should be written to stderr, or detailed in the HTTP response with the appropriate non-200 status code.
Field | Description |
---|---|
string | (Optional) Specifies the container image to be used for running the Action. When specified, a dedicated container will be created using this image to execute the Action.
This field is mutually exclusive with the This field cannot be updated. |
ExecAction | (Optional) Defines the command to run. This field cannot be updated. |
HTTPAction | (Optional) Specifies the HTTP request to perform. This field cannot be updated. Note: HTTPAction is to be implemented in future version. |
[]Kubernetes core/v1.EnvVar | (Optional) Represents a list of environment variables that will be injected into the container. These variables enable the container to adapt its behavior based on the environment it’s running in. This field cannot be updated. |
TargetPodSelector | (Optional) Defines the criteria used to select the target Pod(s) for executing the Action. This is useful when there is no default target replica identified. It allows for precise control over which Pod(s) the Action should run in. This field cannot be updated. Note: This field is reserved for future use and is not currently active. |
string | (Optional) Used in conjunction with the
This field cannot be updated. Note: This field is reserved for future use and is not currently active. |
string | (Optional) Defines the name of the container within the target Pod where the action will be executed. This name must correspond to one of the containers defined in This field cannot be updated. Note: This field is reserved for future use and is not currently active. |
int32 | (Optional) Specifies the maximum duration in seconds that the Action is allowed to run. If the Action does not complete within this time frame, it will be terminated. This field cannot be updated. |
RetryPolicy | (Optional) Defines the strategy to be taken when retrying the Action after a failure. It specifies the conditions under which the Action should be retried and the limits to apply, such as the maximum number of retries and backoff strategy. This field cannot be updated. |
PreConditionType | (Optional) Specifies the state that the cluster must reach before the Action is executed.
Currently, this is only applicable to the The conditions are as follows:
This field cannot be updated. |
Affinity
(Appears on:ClusterComponentSpec, ClusterSpec, ComponentSpec)
Field | Description |
---|---|
PodAntiAffinity | (Optional) Specifies the anti-affinity level of Pods within a Component.
It determines how pods should be spread across nodes to improve availability and performance.
It can have the following values: |
[]string | (Optional) Represents the key of node labels used to define the topology domain for Pod anti-affinity and Pod spread constraints. In K8s, a topology domain is a set of nodes that have the same value for a specific label key. Nodes with labels containing any of the specified TopologyKeys and identical values are considered to be in the same topology domain. Note: The concept of topology in the context of K8s TopologyKeys is different from the concept of topology in the ClusterDefinition. When a Pod has anti-affinity or spread constraints specified, Kubernetes will attempt to schedule the Pod on nodes with different values for the specified TopologyKeys. This ensures that Pods are spread across different topology domains, promoting high availability and reducing the impact of node failures. Some well-known label keys, such as In addition to the well-known keys, users can also specify custom label keys as TopologyKeys. This allows for more flexible and custom topology definitions based on the specific needs of the application or environment. The TopologyKeys field is a slice of strings, where each string represents a label key. The order of the keys in the slice does not matter. |
map[string]string | (Optional) Indicates the node labels that must be present on nodes for pods to be scheduled on them. It is a map where the keys are the label keys and the values are the corresponding label values. Pods will only be scheduled on nodes that have all the specified labels with the corresponding values. For example, if NodeLabels is set to {“nodeType”: “ssd”, “environment”: “production”}, pods will only be scheduled on nodes that have both the “nodeType” label with value “ssd” and the “environment” label with value “production”. This field allows users to control Pod placement based on specific node labels. It can be used to ensure that Pods are scheduled on nodes with certain characteristics, such as specific hardware (e.g., SSD), environment (e.g., production, staging), or any other custom labels assigned to nodes. |
TenancyType | (Optional) Determines the level of resource isolation between Pods.
It can have the following values:
The default value is |
AvailabilityPolicyType
(string
alias)
(Appears on:ClusterSpec)
AvailabilityPolicyType defines the type of availability policy to be applied for cluster affinity, influencing how resources are distributed across zones or nodes for high availability and resilience.
Value | Description |
---|---|
"node" | AvailabilityPolicyNode specifies that resources should be distributed across different nodes within the same zone. This policy aims to provide resilience against node failures, ensuring that the failure of a single node does not impact the overall service availability. |
"none" | AvailabilityPolicyNone specifies that no specific availability policy is applied. Resources may not be explicitly distributed for high availability, potentially concentrating them in a single zone or node based on other scheduling decisions. |
"zone" | AvailabilityPolicyZone specifies that resources should be distributed across different availability zones. This policy aims to ensure high availability and protect against zone failures, spreading the resources to reduce the risk of simultaneous downtime. |
BackupStatusUpdateStage
(string
alias)
BackupStatusUpdateStage defines the stage of backup status update.
BaseBackupType
(string
alias)
BaseBackupType the base backup type, keep synchronized with the BaseBackupType of the data protection API.
BuiltinActionHandlerType
(string
alias)
(Appears on:LifecycleActionHandler)
BuiltinActionHandlerType defines build-in action handlers provided by Lorry, including:
mysql
wesql
oceanbase
redis
mongodb
etcd
postgresql
vanilla-postgresql
apecloud-postgresql
polardbx
custom
unknown
Value | Description |
---|---|
"apecloud-postgresql" | |
"custom" | |
"etcd" | |
"mongodb" | |
"mysql" | |
"oceanbase" | |
"polardbx" | |
"postgresql" | |
"redis" | |
"unknown" | |
"vanilla-postgresql" | |
"wesql" |
ClassDefRef
(Appears on:ClusterComponentSpec)
ClassDefRef is deprecated since v0.9.
Field | Description |
---|---|
string | (Optional) Specifies the name of the ComponentClassDefinition. |
string | Defines the name of the class that is defined in the ComponentClassDefinition. |
ClusterBackup
(Appears on:ClusterSpec)
Field | Description |
---|---|
bool | (Optional) Specifies whether automated backup is enabled for the Cluster. |
github.com/apecloud/kubeblocks/apis/dataprotection/v1alpha1.RetentionPeriod | (Optional) Determines the duration to retain backups. Backups older than this period are automatically removed. For example, RetentionPeriod of
You can also combine the above durations. For example: 30d12h30m. Default value is 7d. |
string | Specifies the backup method to use, as defined in backupPolicy. |
string | (Optional) The cron expression for the schedule. The timezone is in UTC. See https://en.wikipedia.org/wiki/Cron. |
int64 | (Optional) Specifies the maximum time in minutes that the system will wait to start a missed backup job. If the scheduled backup time is missed for any reason, the backup job must start within this deadline. Values must be between 0 (immediate execution) and 1440 (one day). |
string | (Optional) Specifies the name of the backupRepo. If not set, the default backupRepo will be used. |
bool | (Optional) Specifies whether to enable point-in-time recovery. |
bool | (Optional) Specifies whether to enable incremental backup. |
string | (Optional) The cron expression for the incremental backup schedule. The timezone is in UTC. See https://en.wikipedia.org/wiki/Cron. |
ClusterComponentConfig
(Appears on:ClusterComponentSpec, ComponentSpec)
ClusterComponentConfig represents a config with its source bound.
Field | Description |
---|---|
string | (Optional) The name of the config. |
ClusterComponentConfigSource | (Members of The source of the config. |
ClusterComponentConfigSource
(Appears on:ClusterComponentConfig)
ClusterComponentConfigSource represents the source of a config.
Field | Description |
---|---|
Kubernetes core/v1.ConfigMapVolumeSource | (Optional) ConfigMap source for the config. |
ClusterComponentDefinition
(Appears on:ClusterDefinitionSpec)
ClusterComponentDefinition defines a Component within a ClusterDefinition but is deprecated and has been replaced by ComponentDefinition.
Deprecated: Use ComponentDefinition instead. This type is deprecated as of version 0.8.
Field | Description |
---|---|
string | This name could be used as default name of |
string | (Optional) Description of the component definition. |
WorkloadType | Defines the type of the workload.
|
string | (Optional) Defines well-known database component name, such as mongos(mongodb), proxy(redis), mariadb(mysql). |
[]ComponentConfigSpec | (Optional) Defines the template of configurations. |
[]ComponentTemplateSpec | (Optional) Defines the template of scripts. |
ClusterDefinitionProbes | (Optional) Settings for health checks. |
[]LogConfig | (Optional) Specify the logging files which can be observed and configured by cluster users. |
Kubernetes core/v1.PodSpec | (Optional) Defines the pod spec template of component. |
ServiceSpec | (Optional) Defines the service spec. |
StatelessSetSpec | (Optional) Defines spec for |
StatefulSetSpec | (Optional) Defines spec for |
ConsensusSetSpec | (Optional) Defines spec for |
ReplicationSetSpec | (Optional) Defines spec for |
RSMSpec | (Optional) Defines workload spec of this component. From KB 0.7.0, RSM(InstanceSetSpec) will be the underlying CR which powers all kinds of workload in KB. RSM is an enhanced stateful workload extension dedicated for heavy-state workloads like databases. |
HorizontalScalePolicy | (Optional) Defines the behavior of horizontal scale. |
SystemAccountSpec | (Optional) Defines system accounts needed to manage the component, and the statement to create them. |
[]VolumeTypeSpec | (Optional) Used to describe the purpose of the volumes mapping the name of the VolumeMounts in the PodSpec.Container field, such as data volume, log volume, etc. When backing up the volume, the volume can be correctly backed up according to the volumeType. For example:
NOTE: When volumeTypes is not defined, the backup function will not be supported, even if a persistent volume has been specified. |
[]CustomLabelSpec | (Optional) Used for custom label tags which you want to add to the component resources. |
SwitchoverSpec | (Optional) Defines command to do switchover. In particular, when workloadType=Replication, the command defined in switchoverSpec will only be executed under the condition of cluster.componentSpecs[x].SwitchPolicy.type=Noop. |
PostStartAction | (Optional) Defines the command to be executed when the component is ready, and the command will only be executed once after the component becomes ready. |
VolumeProtectionSpec | (Optional) Defines settings to do volume protect. |
[]ComponentDefRef | (Optional) Used to inject values from other components into the current component. Values will be saved and updated in a configmap and mounted to the current component. |
[]ServiceRefDeclaration | (Optional) Used to declare the service reference of the current component. |
Exporter | (Optional) Defines the metrics exporter. |
MonitorConfig | (Optional) Deprecated since v0.9 monitor is monitoring config which provided by provider. |
ClusterComponentPhase
(string
alias)
(Appears on:ClusterComponentStatus, ComponentStatus)
ClusterComponentPhase defines the phase of a cluster component as represented in cluster.status.components.phase field.
Value | Description |
---|---|
"Abnormal" | AbnormalClusterCompPhase indicates the component has more than zero replicas, but there are some failed pods. The component is functioning, but it is in a fragile state. |
"Creating" | CreatingClusterCompPhase indicates the component is being created. |
"Deleting" | DeletingClusterCompPhase indicates the component is currently being deleted. |
"Failed" | FailedClusterCompPhase indicates the component has more than zero replicas, but there are some failed pods. The component is not functioning. |
"Running" | RunningClusterCompPhase indicates the component has more than zero replicas, and all pods are up-to-date and in a ‘Running’ state. |
"Stopped" | StoppedClusterCompPhase indicates the component has zero replicas, and all pods have been deleted. |
"Stopping" | StoppingClusterCompPhase indicates the component has zero replicas, and there are pods that are terminating. |
"Updating" | UpdatingClusterCompPhase indicates the component has more than zero replicas, and there are no failed pods, it is currently being updated. |
ClusterComponentService
(Appears on:ClusterComponentSpec)
Field | Description |
---|---|
string | References the ComponentService name defined in the |
Kubernetes core/v1.ServiceType | (Optional) Determines how the Service is exposed. Valid options are
Note: although K8s Service type allows the ‘ExternalName’ type, it is not a valid option for ClusterComponentService. For more info, see: https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types. |
map[string]string | (Optional) If ServiceType is LoadBalancer, cloud provider related parameters can be put here. More info: https://kubernetes.io/docs/concepts/services-networking/service/#loadbalancer. |
bool | (Optional) Indicates whether to generate individual Services for each Pod. If set to true, a separate Service will be created for each Pod in the Cluster. |
ClusterComponentSpec
(Appears on:ClusterSpec, ShardingSpec)
ClusterComponentSpec defines the specification of a Component within a Cluster.
Field | Description |
---|---|
string | (Optional) Specifies the Component’s name.
It’s part of the Service DNS name and must comply with the IANA service naming rule.
The name is optional when ClusterComponentSpec is used as a template (e.g., in |
string | (Optional) References a ClusterComponentDefinition defined in the Deprecated since v0.9,
because defining Components in |
string | (Optional) Specifies the exact name, name prefix, or regular expression pattern for matching the name of the ComponentDefinition custom resource (CR) that defines the Component’s characteristics and behavior. If both |
string | (Optional) ServiceVersion specifies the version of the Service expected to be provisioned by this Component. The version should follow the syntax and semantics of the “Semantic Versioning” specification (http://semver.org/). If no version is specified, the latest available version will be used. |
ClassDefRef | (Optional) References the class defined in ComponentClassDefinition. Deprecated since v0.9. This field is maintained for backward compatibility and its use is discouraged. Existing usage should be updated to the current preferred approach to avoid compatibility issues in future releases. |
[]ServiceRef | (Optional) Defines a list of ServiceRef for a Component, enabling access to both external services and Services provided by other Clusters. Types of services:
ServiceRefs with identical Example:
The example above includes ServiceRefs to an external Redis Sentinel service and a PostgreSQL Cluster. |
[]string | (Optional) Specifies which types of logs should be collected for the Component.
The log types are defined in the The elements in the
|
map[string]string | (Optional) Specifies Labels to override or add for underlying Pods, PVCs, Account & TLS Secrets, Services Owned by Component. |
map[string]string | (Optional) Specifies Annotations to override or add for underlying Pods, PVCs, Account & TLS Secrets, Services Owned by Component. |
[]Kubernetes core/v1.EnvVar | (Optional) List of environment variables to add. These environment variables will be placed after the environment variables declared in the Pod. |
int32 | Specifies the desired number of replicas in the Component for enhancing availability and durability, or load balancing. |
Affinity | (Optional) Specifies a group of affinity scheduling rules for the Component. It allows users to control how the Component’s Pods are scheduled onto nodes in the K8s cluster. Deprecated since v0.10, replaced by the |
[]Kubernetes core/v1.Toleration | (Optional) Allows Pods to be scheduled onto nodes with matching taints.
Each toleration in the array allows the Pod to tolerate node taints based on
specified
Pods with matching tolerations are allowed to be scheduled on tainted nodes, typically reserved for specific purposes. Deprecated since v0.10, replaced by the |
SchedulingPolicy | (Optional) Specifies the scheduling policy for the Component. |
Kubernetes core/v1.ResourceRequirements | (Optional) Specifies the resources required by the Component. It allows defining the CPU, memory requirements and limits for the Component’s containers. |
[]ClusterComponentVolumeClaimTemplate | (Optional) Specifies a list of PersistentVolumeClaim templates that represent the storage requirements for the Component. Each template specifies the desired characteristics of a persistent volume, such as storage class, size, and access modes. These templates are used to dynamically provision persistent volumes for the Component. |
[]Kubernetes core/v1.Volume | (Optional) List of volumes to override. |
[]ClusterComponentService | (Optional) Overrides services defined in referenced ComponentDefinition and expose endpoints that can be accessed by clients. |
[]ComponentSystemAccount | (Optional) Overrides system accounts defined in referenced ComponentDefinition. |
[]ClusterComponentConfig | (Optional) Specifies the configuration content of a config template. |
ClusterSwitchPolicy | (Optional) Defines the strategy for switchover and failover. Deprecated since v0.9. This field is maintained for backward compatibility and its use is discouraged. Existing usage should be updated to the current preferred approach to avoid compatibility issues in future releases. |
bool | (Optional) A boolean flag that indicates whether the Component should use Transport Layer Security (TLS) for secure communication. When set to true, the Component will be configured to use TLS encryption for its network connections. This ensures that the data transmitted between the Component and its clients or other Components is encrypted and protected from unauthorized access. If TLS is enabled, the Component may require additional configuration, such as specifying TLS certificates and keys, to properly set up the secure communication channel. |
Issuer | (Optional) Specifies the configuration for the TLS certificates issuer. It allows defining the issuer name and the reference to the secret containing the TLS certificates and key. The secret should contain the CA certificate, TLS certificate, and private key in the specified keys. Required when TLS is enabled. |
string | (Optional) Specifies the name of the ServiceAccount required by the running Component. This ServiceAccount is used to grant necessary permissions for the Component’s Pods to interact with other Kubernetes resources, such as modifying Pod labels or sending events. Defaults: To perform certain operational tasks, agent sidecars running in Pods require specific RBAC permissions. The service account will be bound to a default role named “kubeblocks-cluster-pod-role” which is installed together with KubeBlocks. If not specified, KubeBlocks automatically assigns a default ServiceAccount named “kb-{cluster.name}” Future Changes: Future versions might change the default ServiceAccount creation strategy to one per Component, potentially revising the naming to “kb-{cluster.name}-{component.name}”. Users can override the automatic ServiceAccount assignment by explicitly setting the name of an existed ServiceAccount in this field. |
UpdateStrategy | (Optional) Defines the update strategy for the Component. Deprecated since v0.9. This field is maintained for backward compatibility and its use is discouraged. Existing usage should be updated to the current preferred approach to avoid compatibility issues in future releases. |
InstanceUpdateStrategy | (Optional) Indicates the InstanceUpdateStrategy that will be employed to update Pods in the InstanceSet when a revision is made to Template. |
Kubernetes api utils intstr.IntOrString | (Optional) Controls the concurrency of pods during initial scale up, when replacing pods on nodes,
or when scaling down. It only used when |
PodUpdatePolicyType | (Optional) PodUpdatePolicy indicates how pods should be updated
|
UserResourceRefs | (Optional) Allows users to specify custom ConfigMaps and Secrets to be mounted as volumes in the Cluster’s Pods. This is useful in scenarios where users need to provide additional resources to the Cluster, such as:
|
[]InstanceTemplate | (Optional) Allows for the customization of configuration values for each instance within a Component. An instance represent a single replica (Pod and associated K8s resources like PVCs, Services, and ConfigMaps). While instances typically share a common configuration as defined in the ClusterComponentSpec, they can require unique settings in various scenarios: For example:
InstanceTemplate allows for specifying these unique configurations per instance. Each instance’s name is constructed using the pattern: $(component.name)-$(template.name)-$(ordinal), starting with an ordinal of 0. It is crucial to maintain unique names for each InstanceTemplate to avoid conflicts. The sum of replicas across all InstanceTemplates should not exceed the total number of replicas specified for the Component. Any remaining replicas will be generated using the default template and will follow the default naming rules. |
[]string | (Optional) Specifies the names of instances to be transitioned to offline status. Marking an instance as offline results in the following:
Setting instances to offline allows for a controlled scale-in process, preserving their data and maintaining ordinal consistency within the Cluster. Note that offline instances and their associated resources, such as PVCs, are not automatically deleted. The administrator must manually manage the cleanup and removal of these resources when they are no longer needed. |
bool | (Optional) Determines whether metrics exporter information is annotated on the Component’s headless Service. If set to true, the following annotations will not be patched into the Service:
These annotations allow the Prometheus installed by KubeBlocks to discover and scrape metrics from the exporter. |
bool | (Optional) Deprecated since v0.9 Determines whether metrics exporter information is annotated on the Component’s headless Service. If set to true, the following annotations will be patched into the Service:
These annotations allow the Prometheus installed by KubeBlocks to discover and scrape metrics from the exporter. |
bool | (Optional) Stop the Component. If set, all the computing resources will be released. |
ClusterComponentStatus
(Appears on:ClusterStatus)
ClusterComponentStatus records Component status.
Field | Description |
---|---|
ClusterComponentPhase | Specifies the current state of the Component. |
ComponentMessageMap | (Optional) Records detailed information about the Component in its current phase. The keys are either podName, deployName, or statefulSetName, formatted as ‘ObjectKind/Name’. |
bool | (Optional) Checks if all Pods of the Component are ready. |
Kubernetes meta/v1.Time | (Optional) Indicates the time when all Component Pods became ready. This is the readiness time of the last Component Pod. |
[]MemberStatus | (Optional) Represents the status of the members. |
ClusterComponentVolumeClaimTemplate
(Appears on:ClusterComponentSpec, ComponentSpec, InstanceTemplate)
Field | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|
string | Refers to the name of a volumeMount defined in either:
The value of | ||||||||
PersistentVolumeClaimSpec | (Optional) Defines the desired characteristics of a PersistentVolumeClaim that will be created for the volume
with the mount name specified in the When a Pod is created for this ClusterComponent, a new PVC will be created based on the specification
defined in the
|
ClusterDefinitionProbe
(Appears on:ClusterDefinitionProbes)
ClusterDefinitionProbe is deprecated since v0.8.
Field | Description |
---|---|
int32 | How often (in seconds) to perform the probe. |
int32 | Number of seconds after which the probe times out. Defaults to 1 second. |
int32 | Minimum consecutive failures for the probe to be considered failed after having succeeded. |
ClusterDefinitionProbeCMDs | (Optional) Commands used to execute for probe. |
ClusterDefinitionProbeCMDs
(Appears on:ClusterDefinitionProbe)
ClusterDefinitionProbeCMDs is deprecated since v0.8.
Field | Description |
---|---|
[]string | (Optional) Defines write checks that are executed on the probe sidecar. |
[]string | (Optional) Defines read checks that are executed on the probe sidecar. |
ClusterDefinitionProbes
(Appears on:ClusterComponentDefinition)
ClusterDefinitionProbes is deprecated since v0.8.
Field | Description |
---|---|
ClusterDefinitionProbe | (Optional) Specifies the probe used for checking the running status of the component. |
ClusterDefinitionProbe | (Optional) Specifies the probe used for checking the status of the component. |
ClusterDefinitionProbe | (Optional) Specifies the probe used for checking the role of the component. |
int32 | (Optional) Defines the timeout (in seconds) for the role probe after all pods of the component are ready. The system will check if the application is available in the pod. If pods exceed the InitializationTimeoutSeconds time without a role label, this component will enter the Failed/Abnormal phase. Note that this configuration will only take effect if the component supports RoleProbe and will not affect the life cycle of the pod. default values are 60 seconds. |
ClusterDefinitionSpec
(Appears on:ClusterDefinition)
ClusterDefinitionSpec defines the desired state of ClusterDefinition.
Field | Description |
---|---|
string | (Optional) Specifies the well-known database type, such as mysql, redis, or mongodb. Deprecated since v0.9. This field is maintained for backward compatibility and its use is discouraged. Existing usage should be updated to the current preferred approach to avoid compatibility issues in future releases. |
[]ClusterComponentDefinition | (Optional) Provides the definitions for the cluster components. Deprecated since v0.9.
Components should now be individually defined using ComponentDefinition and
collectively referenced via |
map[string]string | (Optional) Connection credential template used for creating a connection credential secret for cluster objects. Built-in objects are:
Deprecated since v0.9. This field is maintained for backward compatibility and its use is discouraged. Existing usage should be updated to the current preferred approach to avoid compatibility issues in future releases. |
[]ClusterTopology | (Optional) Topologies defines all possible topologies within the cluster. |
ClusterDefinitionStatus
(Appears on:ClusterDefinition)
ClusterDefinitionStatus defines the observed state of ClusterDefinition
Field | Description |
---|---|
int64 | (Optional) Represents the most recent generation observed for this ClusterDefinition. |
Phase | Specifies the current phase of the ClusterDefinition. Valid values are |
string | (Optional) Provides additional information about the current phase. |
string | (Optional) Topologies this ClusterDefinition supported. |
string | (Optional) The service references declared by this ClusterDefinition. |
ClusterNetwork
(Appears on:ClusterSpec)
ClusterNetwork is deprecated since v0.9.
Field | Description |
---|---|
bool | (Optional) Indicates whether the host network can be accessed. By default, this is set to false. |
bool | (Optional) Indicates whether the network is accessible to the public. By default, this is set to false. |
ClusterObjectReference
(Appears on:ComponentVarSelector, CredentialVarSelector, HostNetworkVarSelector, ServiceRefVarSelector, ServiceVarSelector)
ClusterObjectReference defines information to let you locate the referenced object inside the same Cluster.
Field | Description |
---|---|
string | (Optional) Specifies the exact name, name prefix, or regular expression pattern for matching the name of the ComponentDefinition custom resource (CR) used by the component that the referent object resident in. If not specified, the component itself will be used. |
string | (Optional) Name of the referent object. |
bool | (Optional) Specify whether the object must be defined. |
MultipleClusterObjectOption | (Optional) This option defines the behavior when multiple component objects match the specified @CompDef. If not provided, an error will be raised when handling multiple matches. |
ClusterPhase
(string
alias)
(Appears on:ClusterStatus)
ClusterPhase defines the phase of the Cluster within the .status.phase field.
Value | Description |
---|---|
"Abnormal" | AbnormalClusterPhase represents some components are in |
"Creating" | CreatingClusterPhase represents all components are in |
"Deleting" | DeletingClusterPhase indicates the cluster is being deleted. |
"Failed" | FailedClusterPhase represents all components are in |
"Running" | RunningClusterPhase represents all components are in |
"Stopped" | StoppedClusterPhase represents all components are in |
"Stopping" | StoppingClusterPhase represents at least one component is in |
"Updating" | UpdatingClusterPhase represents all components are in |
ClusterResources
(Appears on:ClusterSpec)
ClusterResources is deprecated since v0.9.
Field | Description |
---|---|
Kubernetes resource.Quantity | (Optional) Specifies the amount of CPU resource the Cluster needs. For more information, refer to: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ |
Kubernetes resource.Quantity | (Optional) Specifies the amount of memory resource the Cluster needs. For more information, refer to: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ |
ClusterService
(Appears on:ClusterSpec)
ClusterService defines a service that is exposed externally, allowing entities outside the cluster to access it.
For example, external applications, or other Clusters.
And another Cluster managed by the same KubeBlocks operator can resolve the address exposed by a ClusterService
using the serviceRef
field.
When a Component needs to access another Cluster’s ClusterService using the serviceRef
field,
it must also define the service type and version information in the componentDefinition.spec.serviceRefDeclarations
section.
Field | Description |
---|---|
Service | (Members of |
string | (Optional) Extends the ServiceSpec.Selector by allowing the specification of a sharding name, which is defined in
|
string | (Optional) Extends the ServiceSpec.Selector by allowing the specification of a component, to be used as a selector for the service.
Note that this and the |
ClusterSpec
(Appears on:Cluster)
ClusterSpec defines the desired state of Cluster.
Field | Description |
---|---|
string | (Optional) Specifies the name of the ClusterDefinition to use when creating a Cluster. This field enables users to create a Cluster based on a specific ClusterDefinition.
Which, in conjunction with the
This facilitates multiple-components management with predefined ClusterDefinition. Users with advanced requirements can bypass this general setting and specify more precise control over
the composition of the Cluster by directly referencing specific ComponentDefinitions for each component
within If this field is not provided, each component must be explicitly defined in Note: Once set, this field cannot be modified; it is immutable. |
string | (Optional) Refers to the ClusterVersion name. Deprecated since v0.9, use ComponentVersion instead. This field is maintained for backward compatibility and its use is discouraged. Existing usage should be updated to the current preferred approach to avoid compatibility issues in future releases. |
string | (Optional) Specifies the name of the ClusterTopology to be used when creating the Cluster. This field defines which set of Components, as outlined in the ClusterDefinition, will be used to
construct the Cluster based on the named topology.
The ClusterDefinition may list multiple topologies under If Note: Once set during the Cluster creation, the |
TerminationPolicyType | Specifies the behavior when a Cluster is deleted. It defines how resources, data, and backups associated with a Cluster are managed during termination. Choose a policy based on the desired level of resource cleanup and data preservation:
Warning: Choosing an inappropriate termination policy can result in data loss.
The |
[]ShardingSpec | (Optional) Specifies a list of ShardingSpec objects that manage the sharding topology for Cluster Components. Each ShardingSpec organizes components into shards, with each shard corresponding to a Component. Components within a shard are all based on a common ClusterComponentSpec template, ensuring uniform configurations. This field supports dynamic resharding by facilitating the addition or removal of shards
through the Note: |
[]ClusterComponentSpec | (Optional) Specifies a list of ClusterComponentSpec objects used to define the individual Components that make up a Cluster. This field allows for detailed configuration of each Component within the Cluster. Note: |
[]ClusterService | (Optional) Defines a list of additional Services that are exposed by a Cluster.
This field allows Services of selected Components, either from Services defined here can be referenced by other clusters using the ServiceRefClusterSelector. |
Affinity | (Optional) Defines a set of node affinity scheduling rules for the Cluster’s Pods. This field helps control the placement of Pods on nodes within the Cluster. Deprecated since v0.10. Use the |
[]Kubernetes core/v1.Toleration | (Optional) An array that specifies tolerations attached to the Cluster’s Pods, allowing them to be scheduled onto nodes with matching taints. Deprecated since v0.10. Use the |
SchedulingPolicy | (Optional) Specifies the scheduling policy for the Cluster. |
string | (Optional) Specifies runtimeClassName for all Pods managed by this Cluster. |
ClusterBackup | (Optional) Specifies the backup configuration of the Cluster. |
TenancyType | (Optional) Describes how Pods are distributed across node. Deprecated since v0.9. This field is maintained for backward compatibility and its use is discouraged. Existing usage should be updated to the current preferred approach to avoid compatibility issues in future releases. |
AvailabilityPolicyType | (Optional) Describes the availability policy, including zone, node, and none. Deprecated since v0.9. This field is maintained for backward compatibility and its use is discouraged. Existing usage should be updated to the current preferred approach to avoid compatibility issues in future releases. |
int32 | (Optional) Specifies the replicas of the first componentSpec, if the replicas of the first componentSpec is specified, this value will be ignored. Deprecated since v0.9. This field is maintained for backward compatibility and its use is discouraged. Existing usage should be updated to the current preferred approach to avoid compatibility issues in future releases. |
ClusterResources | (Optional) Specifies the resources of the first componentSpec, if the resources of the first componentSpec is specified, this value will be ignored. Deprecated since v0.9. This field is maintained for backward compatibility and its use is discouraged. Existing usage should be updated to the current preferred approach to avoid compatibility issues in future releases. |
ClusterStorage | (Optional) Specifies the storage of the first componentSpec, if the storage of the first componentSpec is specified, this value will be ignored. Deprecated since v0.9. This field is maintained for backward compatibility and its use is discouraged. Existing usage should be updated to the current preferred approach to avoid compatibility issues in future releases. |
ClusterNetwork | (Optional) The configuration of network. Deprecated since v0.9. This field is maintained for backward compatibility and its use is discouraged. Existing usage should be updated to the current preferred approach to avoid compatibility issues in future releases. |
ClusterStatus
(Appears on:Cluster)
ClusterStatus defines the observed state of the Cluster.
Field | Description |
---|---|
int64 | (Optional) The most recent generation number of the Cluster object that has been observed by the controller. |
ClusterPhase | (Optional) The current phase of the Cluster includes:
|
string | (Optional) Provides additional information about the current phase. |
map[string]github.com/apecloud/kubeblocks/apis/apps/v1alpha1.ClusterComponentStatus | (Optional) Records the current status information of all Components within the Cluster. |
int64 | (Optional) Represents the generation number of the referenced ClusterDefinition. |
[]Kubernetes meta/v1.Condition | (Optional) Represents a list of detailed status of the Cluster object. Each condition in the list provides real-time information about certain aspect of the Cluster object. This field is crucial for administrators and developers to monitor and respond to changes within the Cluster. It provides a history of state transitions and a snapshot of the current state that can be used for automated logic or direct inspection. |
ClusterStorage
(Appears on:ClusterSpec)
ClusterStorage is deprecated since v0.9.
Field | Description |
---|---|
Kubernetes resource.Quantity | (Optional) Specifies the amount of storage the Cluster needs. For more information, refer to: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ |
ClusterSwitchPolicy
(Appears on:ClusterComponentSpec)
ClusterSwitchPolicy defines the switch policy for a Cluster.
Deprecated since v0.9.
Field | Description |
---|---|
SwitchPolicyType | (Optional) Type specifies the type of switch policy to be applied. |
ClusterTopology
(Appears on:ClusterDefinitionSpec)
ClusterTopology represents the definition for a specific cluster topology.
Field | Description |
---|---|
string | Name is the unique identifier for the cluster topology. Cannot be updated. |
[]ClusterTopologyComponent | Components specifies the components in the topology. |
ClusterTopologyOrders | (Optional) Specifies the sequence in which components within a cluster topology are started, stopped, and upgraded. This ordering is crucial for maintaining the correct dependencies and operational flow across components. |
bool | (Optional) Default indicates whether this topology serves as the default configuration. When set to true, this topology is automatically used unless another is explicitly specified. |
ClusterTopologyComponent
(Appears on:ClusterTopology)
ClusterTopologyComponent defines a Component within a ClusterTopology.
Field | Description |
---|---|
string | Defines the unique identifier of the component within the cluster topology. It follows IANA Service naming rules and is used as part of the Service’s DNS name. The name must start with a lowercase letter, can contain lowercase letters, numbers, and hyphens, and must end with a lowercase letter or number. Cannot be updated once set. |
string | Specifies the exact name, name prefix, or regular expression pattern for matching the name of the ComponentDefinition custom resource (CR) that defines the Component’s characteristics and behavior. The system selects the ComponentDefinition CR with the latest version that matches the pattern. This approach allows:
Once set, this field cannot be updated. |
ClusterTopologyOrders
(Appears on:ClusterTopology)
ClusterTopologyOrders manages the lifecycle of components within a cluster by defining their provisioning, terminating, and updating sequences. It organizes components into stages or groups, where each group indicates a set of components that can be managed concurrently. These groups are processed sequentially, allowing precise control based on component dependencies and requirements.
Field | Description |
---|---|
[]string | (Optional) Specifies the order for creating and initializing components. This is designed for components that depend on one another. Components without dependencies can be grouped together. Components that can be provisioned independently or have no dependencies can be listed together in the same stage, separated by commas. |
[]string | (Optional) Outlines the order for stopping and deleting components. This sequence is designed for components that require a graceful shutdown or have interdependencies. Components that can be terminated independently or have no dependencies can be listed together in the same stage, separated by commas. |
[]string | (Optional) Update determines the order for updating components’ specifications, such as image upgrades or resource scaling. This sequence is designed for components that have dependencies or require specific update procedures. Components that can be updated independently or have no dependencies can be listed together in the same stage, separated by commas. |
CmdExecutorConfig
(Appears on:PostStartAction, SwitchoverAction, SystemAccountSpec)
CmdExecutorConfig specifies how to perform creation and deletion statements.
Deprecated since v0.8.
Field | Description |
---|---|
CommandExecutorEnvItem | (Members of |
CommandExecutorItem | (Members of |
CommandExecutorEnvItem
(Appears on:CmdExecutorConfig)
CommandExecutorEnvItem is deprecated since v0.8.
Field | Description |
---|---|
string | Specifies the image used to execute the command. |
[]Kubernetes core/v1.EnvVar | (Optional) A list of environment variables that will be injected into the command execution context. |
CommandExecutorItem
(Appears on:CmdExecutorConfig)
CommandExecutorItem is deprecated since v0.8.
Field | Description |
---|---|
[]string | The command to be executed. |
[]string | (Optional) Additional parameters used in the execution of the command. |
ComponentConfigSpec
(Appears on:ClusterComponentDefinition, ComponentDefinitionSpec, ConfigurationItemDetail)
Field | Description |
---|---|
ComponentTemplateSpec | (Members of |
[]string | (Optional) Specifies the configuration files within the ConfigMap that support dynamic updates. A configuration template (provided in the form of a ConfigMap) may contain templates for multiple configuration files. Each configuration file corresponds to a key in the ConfigMap. Some of these configuration files may support dynamic modification and reloading without requiring a pod restart. If empty or omitted, all configuration files in the ConfigMap are assumed to support dynamic updates, and ConfigConstraint applies to all keys. |
LegacyRenderedTemplateSpec | (Optional) Specifies the secondary rendered config spec for pod-specific customization. The template is rendered inside the pod (by the “config-manager” sidecar container) and merged with the main template’s render result to generate the final configuration file. This field is intended to handle scenarios where different pods within the same Component have varying configurations. It allows for pod-specific customization of the configuration. Note: This field will be deprecated in future versions, and the functionality will be moved to
|
string | (Optional) Specifies the name of the referenced configuration constraints object. |
[]string | (Optional) Specifies the containers to inject the ConfigMap parameters as environment variables. This is useful when application images accept parameters through environment variables and generate the final configuration file in the startup script based on these variables. This field allows users to specify a list of container names, and KubeBlocks will inject the environment variables converted from the ConfigMap into these designated containers. This provides a flexible way to pass the configuration items from the ConfigMap to the container without modifying the image. Deprecated: |
[]string | (Optional) Specifies the containers to inject the ConfigMap parameters as environment variables. This is useful when application images accept parameters through environment variables and generate the final configuration file in the startup script based on these variables. This field allows users to specify a list of container names, and KubeBlocks will inject the environment variables converted from the ConfigMap into these designated containers. This provides a flexible way to pass the configuration items from the ConfigMap to the container without modifying the image. |
[]RerenderResourceType | (Optional) Specifies whether the configuration needs to be re-rendered after v-scale or h-scale operations to reflect changes. In some scenarios, the configuration may need to be updated to reflect the changes in resource allocation or cluster topology. Examples:
|
bool | (Optional) Whether to store the final rendered parameters as a secret. |
ComponentDefRef
(Appears on:ClusterComponentDefinition)
ComponentDefRef is used to select the component and its fields to be referenced.
Deprecated since v0.8.
Field | Description |
---|---|
string | The name of the componentDef to be selected. |
FailurePolicyType | (Optional) Defines the policy to be followed in case of a failure in finding the component. |
[]ComponentRefEnv | (Optional) The values that are to be injected as environment variables into each component. |
ComponentDefinitionSpec
(Appears on:ComponentDefinition)
Field | Description |
---|---|
string | (Optional) Specifies the name of the Component provider, typically the vendor or developer name. It identifies the entity responsible for creating and maintaining the Component. When specifying the provider name, consider the following guidelines:
|
string | (Optional) Provides a brief and concise explanation of the Component’s purpose, functionality, and any relevant details. It serves as a quick reference for users to understand the Component’s role and characteristics. |
string | (Optional) Defines the type of well-known service protocol that the Component provides. It specifies the standard or widely recognized protocol used by the Component to offer its Services. The Some examples of well-known service protocols include:
The When specifying the
Note: The The |
string | (Optional) Specifies the version of the Service provided by the Component. It follows the syntax and semantics of the “Semantic Versioning” specification (http://semver.org/). The Semantic Versioning specification defines a version number format of X.Y.Z (MAJOR.MINOR.PATCH), where:
Additional labels for pre-release and build metadata are available as extensions to the X.Y.Z format:
Examples of valid ServiceVersion values:
The |
Kubernetes core/v1.PodSpec | Specifies the PodSpec template used in the Component. It includes the following elements:
This field is intended to define static settings that remain consistent across all instantiated Components.
Dynamic settings such as CPU and memory resource limits, as well as scheduling settings (affinity,
toleration, priority), may vary among different instantiated Components.
They should be specified in the Specific instances of a Component may override settings defined here, such as using a different container image
or modifying environment variable values.
These instance-specific overrides can be specified in This field is immutable and cannot be updated once set. |
MonitorConfig | (Optional) Deprecated since v0.9 monitor is monitoring config which provided by provider. |
Exporter | (Optional) Defines the built-in metrics exporter container. |
[]EnvVar | (Optional) Defines variables which are determined after Cluster instantiation and reflect dynamic or runtime attributes of instantiated Clusters. These variables serve as placeholders for setting environment variables in Pods and Actions, or for rendering configuration and script templates before actual values are finalized. These variables are placed in front of the environment variables declared in the Pod if used as environment variables. Variable values can be sourced from:
This field is immutable. |
[]ComponentVolume | (Optional) Defines the volumes used by the Component and some static attributes of the volumes.
After defining the volumes here, user can reference them in the
This field allows you to specify the following:
By configuring these volume behaviors, you can control how the volumes are managed and monitored within the Component. This field is immutable. |
HostNetwork | (Optional) Specifies the host network configuration for the Component. When The DNSPolicy field in the Pod spec determines how containers within the Pod perform DNS resolution. When using hostNetwork, the operator will set the DNSPolicy to ‘ClusterFirstWithHostNet’. With this policy, DNS queries will first go through the K8s cluster’s DNS service. If the query fails, it will fall back to the host’s DNS settings. If set, the DNS policy will be automatically set to “ClusterFirstWithHostNet”. This field is immutable. |
[]ComponentService | (Optional) Defines additional Services to expose the Component’s endpoints. A default headless Service, named This field enables customization of additional Services to expose the Component’s endpoints to other Components within the same or different Clusters, and to external applications. Each Service entry in this list can include properties such as ports, type, and selectors.
This field is immutable. |
[]ComponentConfigSpec | (Optional) Specifies the configuration file templates and volume mount parameters used by the Component. It also includes descriptions of the parameters in the ConfigMaps, such as value range limitations. This field specifies a list of templates that will be rendered into Component containers’ configuration files. Each template is represented as a ConfigMap and may contain multiple configuration files, with each file being a key in the ConfigMap. The rendered configuration files will be mounted into the Component’s containers according to the specified volume mount parameters. This field is immutable. |
[]LogConfig | (Optional) Defines the types of logs generated by instances of the Component and their corresponding file paths. These logs can be collected for further analysis and monitoring. The Examples:
This field is immutable. |
[]ComponentTemplateSpec | (Optional) Specifies groups of scripts, each provided via a ConfigMap, to be mounted as volumes in the container. These scripts can be executed during container startup or via specific actions. Each script group is encapsulated in a ComponentTemplateSpec that includes:
This field is immutable. |
[]Kubernetes rbac/v1.PolicyRule | (Optional) Defines the namespaced policy rules required by the Component. The The purpose of this field is to automatically generate the necessary RBAC roles for the Component based on the specified policy rules. This ensures that the Pods in the Component has appropriate permissions to function. Note: This field is currently non-functional and is reserved for future implementation. This field is immutable. |
map[string]string | (Optional) Specifies static labels that will be patched to all Kubernetes resources created for the Component. Note: If a label key in the This field is immutable. |
map[string]string | (Optional) Specifies static annotations that will be patched to all Kubernetes resources created for the Component. Note: If an annotation key in the This field is immutable. |
ReplicasLimit | (Optional) Defines the upper limit of the number of replicas supported by the Component. It defines the maximum number of replicas that can be created for the Component. This field allows you to set a limit on the scalability of the Component, preventing it from exceeding a certain number of replicas. This field is immutable. |
[]SystemAccount | (Optional) An array of Each
Use cases for system accounts typically involve tasks like system initialization, backups, monitoring, health checks, replication, and other system-level operations. System accounts are distinct from user accounts, although both are database accounts.
This field is immutable. |
UpdateStrategy | (Optional) Specifies the concurrency strategy for updating multiple instances of the Component. Available strategies:
This field is immutable and defaults to ‘Serial’. |
Kubernetes apps/v1.PodManagementPolicyType | (Optional) InstanceSet controls the creation of pods during initial scale up, replacement of pods on nodes, and scaling down.
|
[]ReplicaRole | (Optional) Enumerate all possible roles assigned to each replica of the Component, influencing its behavior. A replica can have zero to multiple roles.
KubeBlocks operator determines the roles of each replica by invoking the The roles assigned to a replica can influence various aspects of the Component’s behavior, such as:
This field is immutable. |
RoleArbitrator | (Optional) This field has been deprecated since v0.9. This field is maintained for backward compatibility and its use is discouraged. Existing usage should be updated to the current preferred approach to avoid compatibility issues in future releases. This field is immutable. |
ComponentLifecycleActions | (Optional) Defines a set of hooks and procedures that customize the behavior of a Component throughout its lifecycle. Actions are triggered at specific lifecycle stages:
This field is immutable. |
[]ServiceRefDeclaration | (Optional) Lists external service dependencies of the Component, including services from other Clusters or outside the K8s environment. This field is immutable. |
int32 | (Optional)
A default value of 0 seconds means the Pod is considered available as soon as it enters the ready state. |
ComponentDefinitionStatus
(Appears on:ComponentDefinition)
ComponentDefinitionStatus defines the observed state of ComponentDefinition.
Field | Description |
---|---|
int64 | (Optional) Refers to the most recent generation that has been observed for the ComponentDefinition. |
Phase | (Optional) Represents the current status of the ComponentDefinition. Valid values include ``, |
string | (Optional) Provides additional information about the current phase. |
ComponentLifecycleActions
(Appears on:ComponentDefinitionSpec)
ComponentLifecycleActions defines a collection of Actions for customizing the behavior of a Component.
Field | Description |
---|---|
LifecycleActionHandler | (Optional) Specifies the hook to be executed after a component’s creation. By setting The PostProvision Action is intended to run only once. The container executing this action has access to following environment variables:
Note: This field is immutable once it has been set. |
LifecycleActionHandler | (Optional) Specifies the hook to be executed prior to terminating a component. The PreTerminate Action is intended to run only once. This action is executed immediately when a scale-down operation for the Component is initiated. The actual termination and cleanup of the Component and its associated resources will not proceed until the PreTerminate action has completed successfully. The container executing this action has access to following environment variables:
Note: This field is immutable once it has been set. |
RoleProbe | (Optional) Defines the procedure which is invoked regularly to assess the role of replicas. This action is periodically triggered by Lorry at the specified interval to determine the role of each replica.
Upon successful execution, the action’s output designates the role of the replica,
which should match one of the predefined role names within Defining a RoleProbe Action for a Component is required if roles are defined for the Component. It ensures replicas are correctly labeled with their respective roles. Without this, services that rely on roleSelectors might improperly direct traffic to wrong replicas. The container executing this action has access to following environment variables:
Expected output of this action:
Note: This field is immutable once it has been set. |
ComponentSwitchover | (Optional) Defines the procedure for a controlled transition of leadership from the current leader to a new replica. This approach aims to minimize downtime and maintain availability in systems with a leader-follower topology, during events such as planned maintenance or when performing stop, shutdown, restart, or upgrade operations involving the current leader node. The container executing this action has access to following environment variables:
The environment variables with the following prefixes are deprecated and will be removed in future releases:
Note: This field is immutable once it has been set. |
LifecycleActionHandler | (Optional) Defines the procedure to add a new replica to the replication group. This action is initiated after a replica pod becomes ready. The role of the replica (e.g., primary, secondary) will be determined and assigned as part of the action command implementation, or automatically by the database kernel or a sidecar utility like Patroni that implements a consensus algorithm. The container executing this action has access to following environment variables:
Expected action output:
For example, to add a new OBServer to an OceanBase Cluster in ‘zone1’, the following command may be used:
Note: This field is immutable once it has been set. |
LifecycleActionHandler | (Optional) Defines the procedure to remove a replica from the replication group. This action is initiated before remove a replica from the group. The operator will wait for MemberLeave to complete successfully before releasing the replica and cleaning up related Kubernetes resources. The process typically includes updating configurations and informing other group members about the removal. Data migration is generally not part of this action and should be handled separately if needed. The container executing this action has access to following environment variables:
Expected action output:
For example, to remove an OBServer from an OceanBase Cluster in ‘zone1’, the following command can be executed:
Note: This field is immutable once it has been set. |
LifecycleActionHandler | (Optional) Defines the procedure to switch a replica into the read-only state. Use Case: This action is invoked when the database’s volume capacity nears its upper limit and space is about to be exhausted. The container executing this action has access to following environment variables:
Expected action output:
Note: This field is immutable once it has been set. |
LifecycleActionHandler | (Optional) Defines the procedure to transition a replica from the read-only state back to the read-write state. Use Case: This action is used to bring back a replica that was previously in a read-only state, which restricted write operations, to its normal operational state where it can handle both read and write operations. The container executing this action has access to following environment variables:
Expected action output:
Note: This field is immutable once it has been set. |
LifecycleActionHandler | (Optional) Defines the procedure for exporting the data from a replica. Use Case: This action is intended for initializing a newly created replica with data. It involves exporting data from an existing replica and importing it into the new, empty replica. This is essential for synchronizing the state of replicas across the system. Applicability: Some database engines or associated sidecar applications (e.g., Patroni) may already provide this functionality. In such cases, this action may not be required. The output should be a valid data dump streamed to stdout. It must exclude any irrelevant information to ensure that only the necessary data is exported for import into the new replica. Note: This field is immutable once it has been set. |
LifecycleActionHandler | (Optional) Defines the procedure for importing data into a replica. Use Case: This action is intended for initializing a newly created replica with data. It involves exporting data from an existing replica and importing it into the new, empty replica. This is essential for synchronizing the state of replicas across the system. Some database engines or associated sidecar applications (e.g., Patroni) may already provide this functionality. In such cases, this action may not be required. Data should be received through stdin. If any error occurs during the process, the action must be able to guarantee idempotence to allow for retries from the beginning. Note: This field is immutable once it has been set. |
LifecycleActionHandler | (Optional) Defines the procedure that update a replica with new configuration. Note: This field is immutable once it has been set. This Action is reserved for future versions. |
LifecycleActionHandler | (Optional) Defines the procedure to generate a new database account. Use Case: This action is designed to create system accounts that are utilized for replication, monitoring, backup, and other administrative tasks. Note: This field is immutable once it has been set. |
ComponentMessageMap
(map[string]string
alias)
(Appears on:ClusterComponentStatus, ComponentStatus)
ComponentRefEnv
(Appears on:ComponentDefRef)
ComponentRefEnv specifies name and value of an env.
Deprecated since v0.8.
Field | Description |
---|---|
string | The name of the env, it must be a C identifier. |
string | (Optional) The value of the env. |
ComponentValueFrom | (Optional) The source from which the value of the env. |
ComponentService
(Appears on:ComponentDefinitionSpec, ComponentSpec)
ComponentService defines a service that would be exposed as an inter-component service within a Cluster. A Service defined in the ComponentService is expected to be accessed by other Components within the same Cluster.
When a Component needs to use a ComponentService provided by another Component within the same Cluster,
it can declare a variable in the componentDefinition.spec.vars
section and bind it to the specific exposed address
of the ComponentService using the serviceVarRef
field.
Field | Description |
---|---|
Service | (Members of |
bool | (Optional) Indicates whether to create a corresponding Service for each Pod of the selected Component.
When set to true, a set of Services will be automatically generated for each Pod,
and the The names of the generated Services will follow the same suffix naming pattern: Example usage:
In this example, if the Component has 3 replicas, three Services will be generated:
Each generated Service will have the specified spec configuration and will target its respective Pod. This feature is useful when you need to expose each Pod of a Component individually, allowing external access to specific instances of the Component. |
bool | (Optional) Indicates whether the automatic provisioning of the service should be disabled. If set to true, the service will not be automatically created at the component provisioning. Instead, you can enable the creation of this service by specifying it explicitly in the cluster API. |
ComponentSpec
(Appears on:Component)
ComponentSpec defines the desired state of Component.
Field | Description |
---|---|
string | Specifies the name of the referenced ComponentDefinition. |
string | (Optional) ServiceVersion specifies the version of the Service expected to be provisioned by this Component. The version should follow the syntax and semantics of the “Semantic Versioning” specification (http://semver.org/). |
[]ServiceRef | (Optional) Defines a list of ServiceRef for a Component, enabling access to both external services and Services provided by other Clusters. Types of services:
ServiceRefs with identical Example:
The example above includes ServiceRefs to an external Redis Sentinel service and a PostgreSQL Cluster. |
map[string]string | (Optional) Specifies Labels to override or add for underlying Pods, PVCs, Account & TLS Secrets, Services Owned by Component. |
map[string]string | (Optional) Specifies Annotations to override or add for underlying Pods, PVCs, Account & TLS Secrets, Services Owned by Component. |
[]Kubernetes core/v1.EnvVar | (Optional) List of environment variables to add. |
Kubernetes core/v1.ResourceRequirements | (Optional) Specifies the resources required by the Component. It allows defining the CPU, memory requirements and limits for the Component’s containers. |
[]ClusterComponentVolumeClaimTemplate | (Optional) Specifies a list of PersistentVolumeClaim templates that define the storage requirements for the Component. Each template specifies the desired characteristics of a persistent volume, such as storage class, size, and access modes. These templates are used to dynamically provision persistent volumes for the Component. |
[]Kubernetes core/v1.Volume | (Optional) List of volumes to override. |
[]ComponentService | (Optional) Overrides Services defined in referenced ComponentDefinition and exposes endpoints that can be accessed by clients. |
[]ComponentSystemAccount | (Optional) Overrides system accounts defined in referenced ComponentDefinition. |
int32 | Specifies the desired number of replicas in the Component for enhancing availability and durability, or load balancing. |
[]ClusterComponentConfig | (Optional) Specifies the configuration content of a config template. |
[]string | (Optional) Specifies which types of logs should be collected for the Cluster.
The log types are defined in the The elements in the
|
string | (Optional) Specifies the name of the ServiceAccount required by the running Component. This ServiceAccount is used to grant necessary permissions for the Component’s Pods to interact with other Kubernetes resources, such as modifying Pod labels or sending events. Defaults: If not specified, KubeBlocks automatically assigns a default ServiceAccount named “kb-{cluster.name}”, bound to a default role defined during KubeBlocks installation. Future Changes: Future versions might change the default ServiceAccount creation strategy to one per Component, potentially revising the naming to “kb-{cluster.name}-{component.name}”. Users can override the automatic ServiceAccount assignment by explicitly setting the name of an existed ServiceAccount in this field. |
InstanceUpdateStrategy | (Optional) Indicates the InstanceUpdateStrategy that will be employed to update Pods in the InstanceSet when a revision is made to Template. |
Kubernetes api utils intstr.IntOrString | (Optional) Controls the concurrency of pods during initial scale up, when replacing pods on nodes,
or when scaling down. It only used when |
PodUpdatePolicyType | (Optional) PodUpdatePolicy indicates how pods should be updated
|
Affinity | (Optional) Specifies a group of affinity scheduling rules for the Component. It allows users to control how the Component’s Pods are scheduled onto nodes in the Cluster. Deprecated since v0.10, replaced by the |
[]Kubernetes core/v1.Toleration | (Optional) Allows Pods to be scheduled onto nodes with matching taints.
Each toleration in the array allows the Pod to tolerate node taints based on
specified
Pods with matching tolerations are allowed to be scheduled on tainted nodes, typically reserved for specific purposes. Deprecated since v0.10, replaced by the |
SchedulingPolicy | (Optional) Specifies the scheduling policy for the Component. |
TLSConfig | (Optional) Specifies the TLS configuration for the Component, including:
|
[]InstanceTemplate | (Optional) Allows for the customization of configuration values for each instance within a Component. An Instance represent a single replica (Pod and associated K8s resources like PVCs, Services, and ConfigMaps). While instances typically share a common configuration as defined in the ClusterComponentSpec, they can require unique settings in various scenarios: For example:
InstanceTemplate allows for specifying these unique configurations per instance. Each instance’s name is constructed using the pattern: $(component.name)-$(template.name)-$(ordinal), starting with an ordinal of 0. It is crucial to maintain unique names for each InstanceTemplate to avoid conflicts. The sum of replicas across all InstanceTemplates should not exceed the total number of Replicas specified for the Component. Any remaining replicas will be generated using the default template and will follow the default naming rules. |
[]string | (Optional) Specifies the names of instances to be transitioned to offline status. Marking an instance as offline results in the following:
Setting instances to offline allows for a controlled scale-in process, preserving their data and maintaining ordinal consistency within the Cluster. Note that offline instances and their associated resources, such as PVCs, are not automatically deleted. The administrator must manually manage the cleanup and removal of these resources when they are no longer needed. |
string | (Optional) Defines runtimeClassName for all Pods managed by this Component. |
bool | (Optional) Determines whether metrics exporter information is annotated on the Component’s headless Service. If set to true, the following annotations will not be patched into the Service:
These annotations allow the Prometheus installed by KubeBlocks to discover and scrape metrics from the exporter. |
bool | (Optional) Stop the Component. If set, all the computing resources will be released. |
ComponentStatus
(Appears on:Component)
ComponentStatus represents the observed state of a Component within the Cluster.
Field | Description |
---|---|
int64 | (Optional) Specifies the most recent generation observed for this Component object. |
[]Kubernetes meta/v1.Condition | (Optional) Represents a list of detailed status of the Component object. Each condition in the list provides real-time information about certain aspect of the Component object. This field is crucial for administrators and developers to monitor and respond to changes within the Component. It provides a history of state transitions and a snapshot of the current state that can be used for automated logic or direct inspection. |
ClusterComponentPhase | Indicates the current phase of the Component, with each phase indicating specific conditions:
|
ComponentMessageMap | (Optional) A map that stores detailed message about the Component. Each entry in the map provides insights into specific elements of the Component, such as Pods or workloads. Keys in this map are formatted as |
ComponentSwitchover
(Appears on:ComponentLifecycleActions)
Field | Description |
---|---|
Action | (Optional) Represents the switchover process for a specified candidate primary or leader instance. Note that only Action.Exec is currently supported, while Action.HTTP is not. |
Action | (Optional) Represents a switchover process that does not involve a specific candidate primary or leader instance. As with the previous field, only Action.Exec is currently supported, not Action.HTTP. |
[]ScriptSpecSelector | (Optional) Used to define the selectors for the scriptSpecs that need to be referenced. If this field is set, the scripts defined under the ‘scripts’ field can be invoked or referenced within an Action. This field is deprecated from v0.9. This field is maintained for backward compatibility and its use is discouraged. Existing usage should be updated to the current preferred approach to avoid compatibility issues in future releases. |
ComponentSystemAccount
(Appears on:ClusterComponentSpec, ComponentSpec)
Field | Description |
---|---|
string | The name of the system account. |
PasswordConfig | (Optional) Specifies the policy for generating the account’s password. This field is immutable once set. |
ProvisionSecretRef | (Optional) Refers to the secret from which data will be copied to create the new account. This field is immutable once set. |
ComponentTemplateSpec
(Appears on:ClusterComponentDefinition, ComponentConfigSpec, ComponentDefinitionSpec)
Field | Description |
---|---|
string | Specifies the name of the configuration template. |
string | (Optional) Specifies the name of the referenced configuration template ConfigMap object. |
string | (Optional) Specifies the namespace of the referenced configuration template ConfigMap object. An empty namespace is equivalent to the “default” namespace. |
string | (Optional) Refers to the volume name of PodTemplate. The configuration file produced through the configuration template will be mounted to the corresponding volume. Must be a DNS_LABEL name. The volume name must be defined in podSpec.containers[*].volumeMounts. |
int32 | (Optional) The operator attempts to set default file permissions for scripts (0555) and configurations (0444). However, certain database engines may require different file permissions. You can specify the desired file permissions here. Must be specified as an octal value between 0000 and 0777 (inclusive), or as a decimal value between 0 and 511 (inclusive). YAML supports both octal and decimal values for file permissions. Please note that this setting only affects the permissions of the files themselves. Directories within the specified path are not impacted by this setting. It’s important to be aware that this setting might conflict with other options that influence the file mode, such as fsGroup. In such cases, the resulting file mode may have additional bits set. Refers to documents of k8s.ConfigMapVolumeSource.defaultMode for more information. |
ComponentValueFrom
(Appears on:ComponentRefEnv)
ComponentValueFrom is deprecated since v0.8.
Field | Description |
---|---|
ComponentValueFromType | Specifies the source to select. It can be one of three types: |
string | (Optional) The jsonpath of the source to select when the Type is
|
string | (Optional) Defines the format of each headless service address.
Three builtin variables can be used as placeholders:
|
string | (Optional) The string used to join the values of headless service addresses. |
ComponentValueFromType
(string
alias)
(Appears on:ComponentValueFrom)
ComponentValueFromType specifies the type of component value from which the data is derived.
Deprecated since v0.8.
Value | Description |
---|---|
"FieldRef" | FromFieldRef refers to the value of a specific field in the object. |
"HeadlessServiceRef" | FromHeadlessServiceRef refers to a headless service within the same namespace as the object. |
"ServiceRef" | FromServiceRef refers to a service within the same namespace as the object. |
ComponentVarSelector
(Appears on:VarSource)
ComponentVarSelector selects a var from a Component.
Field | Description |
---|---|
ClusterObjectReference | (Members of The Component to select from. |
ComponentVars | (Members of |
ComponentVars
(Appears on:ComponentVarSelector)
Field | Description |
---|---|
VarOption | (Optional) Reference to the name of the Component object. |
VarOption | (Optional) Reference to the replicas of the component. |
VarOption | (Optional) Reference to the pod name list of the component. and the value will be presented in the following format: name1,name2,… |
VarOption | (Optional) Reference to the pod FQDN list of the component. The value will be presented in the following format: FQDN1,FQDN2,… |
ComponentVersionCompatibilityRule
(Appears on:ComponentVersionSpec)
ComponentVersionCompatibilityRule defines the compatibility between a set of component definitions and a set of releases.
Field | Description |
---|---|
[]string | CompDefs specifies names for the component definitions associated with this ComponentVersion. Each name in the list can represent an exact name, a name prefix, or a regular expression pattern. For example:
|
[]string | Releases is a list of identifiers for the releases. |
ComponentVersionRelease
(Appears on:ComponentVersionSpec)
ComponentVersionRelease represents a release of component instances within a ComponentVersion.
Field | Description |
---|---|
string | Name is a unique identifier for this release. Cannot be updated. |
string | (Optional) Changes provides information about the changes made in this release. |
string | ServiceVersion defines the version of the well-known service that the component provides. The version should follow the syntax and semantics of the “Semantic Versioning” specification (http://semver.org/). If the release is used, it will serve as the service version for component instances, overriding the one defined in the component definition. Cannot be updated. |
map[string]string | Images define the new images for different containers within the release. |
ComponentVersionSpec
(Appears on:ComponentVersion)
ComponentVersionSpec defines the desired state of ComponentVersion
Field | Description |
---|---|
[]ComponentVersionCompatibilityRule | CompatibilityRules defines compatibility rules between sets of component definitions and releases. |
[]ComponentVersionRelease | Releases represents different releases of component instances within this ComponentVersion. |
ComponentVersionStatus
(Appears on:ComponentVersion)
ComponentVersionStatus defines the observed state of ComponentVersion
Field | Description |
---|---|
int64 | (Optional) ObservedGeneration is the most recent generation observed for this ComponentVersion. |
Phase | (Optional) Phase valid values are ``, |
string | (Optional) Extra message for current phase. |
string | (Optional) ServiceVersions represent the supported service versions of this ComponentVersion. |
ComponentVolume
(Appears on:ComponentDefinitionSpec)
Field | Description |
---|---|
string | Specifies the name of the volume. It must be a DNS_LABEL and unique within the pod. More info can be found at: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names Note: This field cannot be updated. |
bool | (Optional) Specifies whether the creation of a snapshot of this volume is necessary when performing a backup of the Component. Note: This field cannot be updated. |
int | (Optional) Sets the critical threshold for volume space utilization as a percentage (0-100). Exceeding this percentage triggers the system to switch the volume to read-only mode as specified in
Note: This field cannot be updated. |
ConfigConstraintSpec
(Appears on:ConfigConstraint)
ConfigConstraintSpec defines the desired state of ConfigConstraint
Field | Description |
---|---|
ReloadOptions | (Optional) Specifies the dynamic reload action supported by the engine. When set, the controller executes the method defined here to execute hot parameter updates. Dynamic reloading is triggered only if both of the following conditions are met:
If Example:
|
bool | (Optional) Indicates whether to consolidate dynamic reload and restart actions into a single restart.
This flag allows for more efficient handling of configuration changes by potentially eliminating an unnecessary reload step. |
bool | (Optional) Configures whether the dynamic reload specified in
|
ToolsSetup | (Optional) Specifies the tools container image used by ShellTrigger for dynamic reload. If the dynamic reload action is triggered by a ShellTrigger, this field is required. This image must contain all necessary tools for executing the ShellTrigger scripts. Usually the specified image is referenced by the init container, which is then responsible for copy the tools from the image to a bin volume. This ensures that the tools are available to the ‘config-manager’ sidecar. |
[]DownwardAPIChangeTriggeredAction | (Optional) Specifies a list of actions to execute specified commands based on Pod labels. It utilizes the K8s Downward API to mount label information as a volume into the pod. The ‘config-manager’ sidecar container watches for changes in the role label and dynamically invoke registered commands (usually execute some SQL statements) when a change is detected. It is designed for scenarios where:
|
[]ScriptConfig | (Optional) A list of ScriptConfig Object. Each ScriptConfig object specifies a ConfigMap that contains script files that should be mounted inside the pod. The scripts are mounted as volumes and can be referenced and executed by the dynamic reload and DownwardAction to perform specific tasks or configurations. |
string | (Optional) Specifies the top-level key in the ‘configurationSchema.cue’ that organizes the validation rules for parameters. This key must exist within the CUE script defined in ‘configurationSchema.cue’. |
CustomParametersValidation | (Optional) Defines a list of parameters including their names, default values, descriptions, types, and constraints (permissible values or the range of valid values). |
[]string | (Optional) List static parameters. Modifications to any of these parameters require a restart of the process to take effect. |
[]string | (Optional) List dynamic parameters. Modifications to these parameters trigger a configuration reload without requiring a process restart. |
[]string | (Optional) Lists the parameters that cannot be modified once set. Attempting to change any of these parameters will be ignored. |
Kubernetes meta/v1.LabelSelector | (Optional) Used to match labels on the pod to determine whether a dynamic reload should be performed. In some scenarios, only specific pods (e.g., primary replicas) need to undergo a dynamic reload.
The If the |
FileFormatConfig | Specifies the format of the configuration file and any associated parameters that are specific to the chosen format.
Supported formats include Each format may have its own set of parameters that can be configured.
For instance, when using the Example:
|
ConfigConstraintStatus
(Appears on:ConfigConstraint)
ConfigConstraintStatus represents the observed state of a ConfigConstraint.
Field | Description |
---|---|
ConfigConstraintPhase | (Optional) Specifies the status of the configuration template. When set to CCAvailablePhase, the ConfigConstraint can be referenced by ClusterDefinition. |
string | (Optional) Provides descriptions for abnormal states. |
int64 | (Optional) Refers to the most recent generation observed for this ConfigConstraint. This value is updated by the API Server. |
ConfigMapRef
(Appears on:UserResourceRefs)
ConfigMapRef defines a reference to a ConfigMap.
Field | Description |
---|---|
ResourceMeta | (Members of |
Kubernetes core/v1.ConfigMapVolumeSource | ConfigMap specifies the ConfigMap to be mounted as a volume. |
ConfigParams
(Appears on:ConfigurationItemDetail)
Field | Description |
---|---|
string | (Optional) Holds the configuration keys and values. This field is a workaround for issues found in kubebuilder and code-generator. Refer to https://github.com/kubernetes-sigs/kubebuilder/issues/528 and https://github.com/kubernetes/code-generator/issues/50 for more details. Represents the content of the configuration file. |
map[string]*string | (Optional) Represents the updated parameters for a single configuration file. |
ConfigTemplateExtension
(Appears on:ConfigurationItemDetail, LegacyRenderedTemplateSpec)
Field | Description |
---|---|
string | Specifies the name of the referenced configuration template ConfigMap object. |
string | (Optional) Specifies the namespace of the referenced configuration template ConfigMap object. An empty namespace is equivalent to the “default” namespace. |
MergedPolicy | (Optional) Defines the strategy for merging externally imported templates into component templates. |
ConfigurationItemDetail
(Appears on:ConfigurationSpec)
ConfigurationItemDetail corresponds to settings of a configuration template (a ConfigMap).
Field | Description |
---|---|
string | Defines the unique identifier of the configuration template. It must be a string of maximum 63 characters, and can only include lowercase alphanumeric characters, hyphens, and periods. The name must start and end with an alphanumeric character. |
string | (Optional) Deprecated: No longer used. Please use ‘Payload’ instead. Previously represented the version of the configuration template. |
Payload | (Optional) External controllers can trigger a configuration rerender by modifying this field. Note: Currently, the |
ComponentConfigSpec | (Optional) Specifies the name of the configuration template (a ConfigMap), ConfigConstraint, and other miscellaneous options. The configuration template is a ConfigMap that contains multiple configuration files. Each configuration file is stored as a key-value pair within the ConfigMap. ConfigConstraint allows defining constraints and validation rules for configuration parameters. It ensures that the configuration adheres to certain requirements and limitations. |
ConfigTemplateExtension | (Optional) Specifies the user-defined configuration template. When provided, the |
map[string]github.com/apecloud/kubeblocks/apis/apps/v1alpha1.ConfigParams | (Optional) Specifies the user-defined configuration parameters. When provided, the parameter values in |
ConfigurationItemDetailStatus
(Appears on:ConfigurationStatus)
Field | Description |
---|---|
string | Specifies the name of the configuration template. It is a required field and must be a string of maximum 63 characters. The name should only contain lowercase alphanumeric characters, hyphens, or periods. It should start and end with an alphanumeric character. |
ConfigurationPhase | (Optional) Indicates the current status of the configuration item. Possible values include “Creating”, “Init”, “Running”, “Pending”, “Merged”, “MergeFailed”, “FailedAndPause”, “Upgrading”, “Deleting”, “FailedAndRetry”, “Finished”. |
string | (Optional) Represents the last completed revision of the configuration item. This field is optional. |
string | (Optional) Represents the updated revision of the configuration item. This field is optional. |
string | (Optional) Provides a description of any abnormal status. This field is optional. |
ReconcileDetail | (Optional) Provides detailed information about the execution of the configuration change. This field is optional. |
ConfigurationPhase
(string
alias)
(Appears on:ConfigurationItemDetailStatus)
ConfigurationPhase defines the Configuration FSM phase
Value | Description |
---|---|
"Creating" | |
"Deleting" | |
"FailedAndPause" | |
"FailedAndRetry" | |
"Finished" | |
"Init" | |
"MergeFailed" | |
"Merged" | |
"Pending" | |
"Running" | |
"Upgrading" |
ConfigurationSpec
(Appears on:Configuration)
ConfigurationSpec defines the desired state of a Configuration resource.
Field | Description |
---|---|
string | Specifies the name of the Cluster that this configuration is associated with. |
string | Represents the name of the Component that this configuration pertains to. |
[]ConfigurationItemDetail | (Optional) ConfigItemDetails is an array of ConfigurationItemDetail objects. Each ConfigurationItemDetail corresponds to a configuration template, which is a ConfigMap that contains multiple configuration files. Each configuration file is stored as a key-value pair within the ConfigMap. The ConfigurationItemDetail includes information such as:
|
ConfigurationStatus
(Appears on:Configuration)
ConfigurationStatus represents the observed state of a Configuration resource.
Field | Description |
---|---|
string | (Optional) Provides a description of any abnormal status. |
int64 | (Optional) Represents the latest generation observed for this ClusterDefinition. It corresponds to the ConfigConstraint’s generation, which is updated by the API Server. |
[]Kubernetes meta/v1.Condition | (Optional) Provides detailed status information for opsRequest. |
[]ConfigurationItemDetailStatus | Provides the status of each component undergoing reconfiguration. |
ConnectionCredentialAuth
(Appears on:ServiceDescriptorSpec)
ConnectionCredentialAuth specifies the authentication credentials required for accessing an external service.
Field | Description |
---|---|
CredentialVar | (Optional) Specifies the username for the external service. |
CredentialVar | (Optional) Specifies the password for the external service. |
ConsensusMember
(Appears on:ConsensusSetSpec)
ConsensusMember is deprecated since v0.7.
Field | Description |
---|---|
string | Specifies the name of the consensus member. |
AccessMode | Specifies the services that this member is capable of providing. |
int32 | (Optional) Indicates the number of Pods that perform this role.
The default is 1 for |
ConsensusSetSpec
(Appears on:ClusterComponentDefinition)
ConsensusSetSpec is deprecated since v0.7.
Field | Description |
---|---|
StatefulSetSpec | (Members of |
ConsensusMember | Represents a single leader in the consensus set. |
[]ConsensusMember | (Optional) Members of the consensus set that have voting rights but are not the leader. |
ConsensusMember | (Optional) Represents a member of the consensus set that does not have voting rights. |
ContainerVars
(Appears on:HostNetworkVars)
ContainerVars defines the vars that can be referenced from a Container.
Field | Description |
---|---|
string | The name of the container. |
NamedVar | (Optional) Container port to reference. |
CredentialVar
(Appears on:ConnectionCredentialAuth, ServiceDescriptorSpec)
CredentialVar represents a variable that retrieves its value either directly from a specified expression
or from a source defined in valueFrom
.
Only one of these options may be used at a time.
Field | Description |
---|---|
string | (Optional) Holds a direct string or an expression that can be evaluated to a string. It can include variables denoted by $(VAR_NAME). These variables are expanded to the value of the environment variables defined in the container. If a variable cannot be resolved, it remains unchanged in the output. To escape variable expansion and retain the literal value, use double $ characters. For example:
Default value is an empty string. |
Kubernetes core/v1.EnvVarSource | (Optional) Specifies the source for the variable’s value. |
CredentialVarSelector
(Appears on:VarSource)
CredentialVarSelector selects a var from a Credential (SystemAccount).
Field | Description |
---|---|
ClusterObjectReference | (Members of The Credential (SystemAccount) to select from. |
CredentialVars | (Members of |
CredentialVars
(Appears on:CredentialVarSelector, ServiceRefVars)
CredentialVars defines the vars that can be referenced from a Credential (SystemAccount). !!!!! CredentialVars will only be used as environment variables for Pods & Actions, and will not be used to render the templates.
Field | Description |
---|---|
VarOption | (Optional) |
VarOption | (Optional) |
CustomLabelSpec
(Appears on:ClusterComponentDefinition)
CustomLabelSpec is deprecated since v0.8.
Field | Description |
---|---|
string | The key of the label. |
string | The value of the label. |
[]GVKResource | The resources that will be patched with the label. |
CustomParametersValidation
(Appears on:ConfigConstraintSpec)
CustomParametersValidation Defines a list of configuration items with their names, default values, descriptions, types, and constraints.
Field | Description |
---|---|
string | (Optional) Hold a string that contains a script written in CUE language that defines a list of configuration items. Each item is detailed with its name, default value, description, type (e.g. string, integer, float), and constraints (permissible values or the valid range of values). CUE (Configure, Unify, Execute) is a declarative language designed for defining and validating complex data configurations. It is particularly useful in environments like K8s where complex configurations and validation rules are common. This script functions as a validator for user-provided configurations, ensuring compliance with the established specifications and constraints. |
Kubernetes api extensions v1.JSONSchemaProps | Generated from the ‘cue’ field and transformed into a JSON format. |
EnvVar
(Appears on:ComponentDefinitionSpec)
EnvVar represents a variable present in the env of Pod/Action or the template of config/script.
Field | Description |
---|---|
string | Name of the variable. Must be a C_IDENTIFIER. |
string | (Optional) Variable references If a variable cannot be resolved, the reference in the input string will be unchanged.
Double
Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to “”. |
VarSource | (Optional) Source for the variable’s value. Cannot be used if value is not empty. |
string | (Optional) A Go template expression that will be applied to the resolved value of the var. The expression will only be evaluated if the var is successfully resolved to a non-credential value. The resolved value can be accessed by its name within the expression, system vars and other user-defined non-credential vars can be used within the expression in the same way. Notice that, when accessing vars by its name, you should replace all the “-” in the name with “_”, because of that “-” is not a valid identifier in Go. All expressions are evaluated in the order the vars are defined. If a var depends on any vars that also have expressions defined, be careful about the evaluation order as it may use intermediate values. The result of evaluation will be used as the final value of the var. If the expression fails to evaluate, the resolving of var will also be considered failed. |
ExecAction
(Appears on:Action)
ExecAction describes an Action that executes a command inside a container. Which may run as a K8s job or be executed inside the Lorry sidecar container, depending on the implementation. Future implementations will standardize execution within Lorry.
Field | Description |
---|---|
[]string | (Optional) Specifies the command to be executed inside the container. The working directory for this command is the container’s root directory(‘/’). Commands are executed directly without a shell environment, meaning shell-specific syntax (‘|’, etc.) is not supported. If the shell is required, it must be explicitly invoked in the command. A successful execution is indicated by an exit status of 0; any non-zero status signifies a failure. |
[]string | (Optional) Args represents the arguments that are passed to the |
Exporter
(Appears on:ClusterComponentDefinition, ComponentDefinitionSpec)
Field | Description |
---|---|
string | (Optional) Specifies the name of the built-in metrics exporter container. |
string | (Optional) Specifies the http/https url path to scrape for metrics.
If empty, Prometheus uses the default value (e.g. |
string | (Optional) Specifies the port name to scrape for metrics. |
PrometheusScheme | (Optional) Specifies the schema to use for scraping.
|
ExporterConfig
(Appears on:MonitorConfig)
Field | Description |
---|---|
Kubernetes api utils intstr.IntOrString | scrapePort is exporter port for Time Series Database to scrape metrics. |
string | (Optional) scrapePath is exporter url path for Time Series Database to scrape metrics. |
FailurePolicyType
(string
alias)
(Appears on:ComponentDefRef)
FailurePolicyType specifies the type of failure policy.
Value | Description |
---|---|
"Fail" | FailurePolicyFail means that an error will be reported. |
"Ignore" | FailurePolicyIgnore means that an error will be ignored but logged. |
GVKResource
(Appears on:CustomLabelSpec)
GVKResource is deprecated since v0.8.
Field | Description |
---|---|
string | Represents the GVK of a resource, such as “v1/Pod”, “apps/v1/StatefulSet”, etc. When a resource matching this is found by the selector, a custom label will be added if it doesn’t already exist, or updated if it does. |
map[string]string | (Optional) A label query used to filter a set of resources. |
HScaleDataClonePolicyType
(string
alias)
(Appears on:HorizontalScalePolicy)
HScaleDataClonePolicyType defines the data clone policy to be used during horizontal scaling.
This policy determines how data is handled when new nodes are added to the cluster.
The policy can be set to None
, CloneVolume
, or Snapshot
.
Value | Description |
---|---|
"CloneVolume" | HScaleDataClonePolicyCloneVolume indicates that data will be cloned from existing volumes during horizontal scaling. |
"Snapshot" | HScaleDataClonePolicyFromSnapshot indicates that data will be cloned from a snapshot during horizontal scaling. |
"None" | HScaleDataClonePolicyNone indicates that no data cloning will occur during horizontal scaling. |
HTTPAction
(Appears on:Action)
HTTPAction describes an Action that triggers HTTP requests. HTTPAction is to be implemented in future version.
Field | Description |
---|---|
string | (Optional) Specifies the endpoint to be requested on the HTTP server. |
Kubernetes api utils intstr.IntOrString | Specifies the target port for the HTTP request. It can be specified either as a numeric value in the range of 1 to 65535, or as a named port that meets the IANA_SVC_NAME specification. |
string | (Optional) Indicates the server’s domain name or IP address. Defaults to the Pod’s IP. Prefer setting the “Host” header in httpHeaders when needed. |
Kubernetes core/v1.URIScheme | (Optional) Designates the protocol used to make the request, such as HTTP or HTTPS. If not specified, HTTP is used by default. |
string | (Optional) Represents the type of HTTP request to be made, such as “GET,” “POST,” “PUT,” etc. If not specified, “GET” is the default method. |
[]Kubernetes core/v1.HTTPHeader | (Optional) Allows for the inclusion of custom headers in the request. HTTP permits the use of repeated headers. |
HorizontalScalePolicy
(Appears on:ClusterComponentDefinition)
HorizontalScalePolicy is deprecated since v0.8.
Field | Description |
---|---|
HScaleDataClonePolicyType | (Optional) Determines the data synchronization method when a component scales out.
The policy can be one of the following: {None, CloneVolume}. The default policy is
|
string | (Optional) Refers to the backup policy template. |
string | (Optional) Specifies the volumeMount of the container to backup. This only works if Type is not None. If not specified, the first volumeMount will be selected. |
HostNetwork
(Appears on:ComponentDefinitionSpec)
Field | Description |
---|---|
[]HostNetworkContainerPort | (Optional) The list of container ports that are required by the component. |
HostNetworkContainerPort
(Appears on:HostNetwork)
Field | Description |
---|---|
string | Container specifies the target container within the Pod. |
[]string | Ports are named container ports within the specified container. These container ports must be defined in the container for proper port allocation. |
HostNetworkVarSelector
(Appears on:VarSource)
HostNetworkVarSelector selects a var from host-network resources.
Field | Description |
---|---|
ClusterObjectReference | (Members of The component to select from. |
HostNetworkVars | (Members of |
HostNetworkVars
(Appears on:HostNetworkVarSelector)
HostNetworkVars defines the vars that can be referenced from host-network resources.
Field | Description |
---|---|
ContainerVars | (Optional) |
InstanceTemplate
(Appears on:ClusterComponentSpec, ComponentSpec)
InstanceTemplate allows customization of individual replica configurations in a Component.
Field | Description |
---|---|
string | Name specifies the unique name of the instance Pod created using this InstanceTemplate. This name is constructed by concatenating the Component’s name, the template’s name, and the instance’s ordinal using the pattern: $(cluster.name)-$(component.name)-$(template.name)-$(ordinal). Ordinals start from 0. The specified name overrides any default naming conventions or patterns. |
int32 | (Optional) Specifies the number of instances (Pods) to create from this InstanceTemplate. This field allows setting how many replicated instances of the Component, with the specific overrides in the InstanceTemplate, are created. The default value is 1. A value of 0 disables instance creation. |
map[string]string | (Optional) Specifies a map of key-value pairs to be merged into the Pod’s existing annotations. Existing keys will have their values overwritten, while new keys will be added to the annotations. |
map[string]string | (Optional) Specifies a map of key-value pairs that will be merged into the Pod’s existing labels. Values for existing keys will be overwritten, and new keys will be added. |
string | (Optional) Specifies an override for the first container’s image in the Pod. |
SchedulingPolicy | (Optional) Specifies the scheduling policy for the Component. |
Kubernetes core/v1.ResourceRequirements | (Optional) Specifies an override for the resource requirements of the first container in the Pod. This field allows for customizing resource allocation (CPU, memory, etc.) for the container. |
[]Kubernetes core/v1.EnvVar | (Optional) Defines Env to override. Add new or override existing envs. |
[]Kubernetes core/v1.Volume | (Optional) Defines Volumes to override. Add new or override existing volumes. |
[]Kubernetes core/v1.VolumeMount | (Optional) Defines VolumeMounts to override. Add new or override existing volume mounts of the first container in the Pod. |
[]ClusterComponentVolumeClaimTemplate | (Optional) Defines VolumeClaimTemplates to override. Add new or override existing volume claim templates. |
InstanceUpdateStrategy
(Appears on:ClusterComponentSpec, ComponentSpec)
InstanceUpdateStrategy indicates the strategy that the InstanceSet controller will use to perform updates.
Field | Description |
---|---|
int32 | (Optional) Partition indicates the number of pods that should be updated during a rolling update. The remaining pods will remain untouched. This is helpful in defining how many pods should participate in the update process. The update process will follow the order of pod names in descending lexicographical (dictionary) order. The default value is ComponentSpec.Replicas (i.e., update all pods). |
Kubernetes api utils intstr.IntOrString | (Optional) The maximum number of pods that can be unavailable during the update. Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%). Absolute number is calculated from percentage by rounding up. This can not be 0. Defaults to 1. The field applies to all pods. That means if there is any unavailable pod, it will be counted towards MaxUnavailable. |
Issuer
(Appears on:ClusterComponentSpec, TLSConfig)
Issuer defines the TLS certificates issuer for the Cluster.
Field | Description |
---|---|
IssuerName | The issuer for TLS certificates.
It only allows two enum values:
|
TLSSecretRef | (Optional) SecretRef is the reference to the secret that contains user-provided certificates.
It is required when the issuer is set to |
IssuerName
(string
alias)
(Appears on:Issuer)
IssuerName defines the name of the TLS certificates issuer.
Value | Description |
---|---|
"KubeBlocks" | IssuerKubeBlocks represents certificates that are signed by the KubeBlocks Operator. |
"UserProvided" | IssuerUserProvided indicates that the user has provided their own CA-signed certificates. |
LegacyRenderedTemplateSpec
(Appears on:ComponentConfigSpec)
LegacyRenderedTemplateSpec describes the configuration extension for the lazy rendered template. Deprecated: LegacyRenderedTemplateSpec has been deprecated since 0.9.0 and will be removed in 0.10.0
Field | Description |
---|---|
ConfigTemplateExtension | (Members of Extends the configuration template. |
LetterCase
(string
alias)
(Appears on:PasswordConfig)
LetterCase defines the available cases to be used in password generation.
Value | Description |
---|---|
"LowerCases" | LowerCases represents the use of lower case letters only. |
"MixedCases" | MixedCases represents the use of a mix of both lower and upper case letters. |
"UpperCases" | UpperCases represents the use of upper case letters only. |
LifecycleActionHandler
(Appears on:ComponentLifecycleActions, RoleProbe)
LifecycleActionHandler describes the implementation of a specific lifecycle action.
Each action is deemed successful if it returns an exit code of 0 for command executions, or an HTTP 200 status for HTTP(s) actions. Any other exit code or HTTP status is considered an indication of failure.
Field | Description |
---|---|
BuiltinActionHandlerType | (Optional) Specifies the name of the predefined action handler to be invoked for lifecycle actions. Lorry, as a sidecar agent co-located with the database container in the same Pod,
includes a suite of built-in action implementations that are tailored to different database engines.
These are known as “builtin” handlers, includes: If the The If you need to define lifecycle actions for database engines not covered by the existing built-in support,
or when the pre-existing built-in handlers do not meet your specific needs,
you can use the Deprecation Notice:
|
Action | (Optional) Specifies a user-defined hook or procedure that is called to perform the specific lifecycle action. It offers a flexible and expandable approach for customizing the behavior of a Component by leveraging tailored actions. An Action can be implemented as either an ExecAction or an HTTPAction, with future versions planning to support GRPCAction, thereby accommodating unique logic for different database systems within the Action’s framework. In future iterations, all built-in handlers are expected to transition to GRPCAction. This change means that Lorry or other sidecar agents will expose the implementation of actions through a GRPC interface for external invocation. Then the controller will interact with these actions via GRPCAction calls. |
LogConfig
(Appears on:ClusterComponentDefinition, ComponentDefinitionSpec)
Field | Description |
---|---|
string | Specifies a descriptive label for the log type, such as ‘slow’ for a MySQL slow log file. It provides a clear identification of the log’s purpose and content. |
string | Specifies the paths or patterns identifying where the log files are stored. This field allows the system to locate and manage log files effectively. Examples:
|
MergedPolicy
(string
alias)
(Appears on:ConfigTemplateExtension)
MergedPolicy defines how to merge external imported templates into component templates.
Value | Description |
---|---|
"none" | |
"add" | |
"patch" | |
"replace" |
MonitorConfig
(Appears on:ClusterComponentDefinition, ComponentDefinitionSpec)
Field | Description |
---|---|
bool | (Optional) builtIn is a switch to enable KubeBlocks builtIn monitoring. If BuiltIn is set to true, monitor metrics will be scraped automatically. If BuiltIn is set to false, the provider should set ExporterConfig and Sidecar container own. |
ExporterConfig | (Optional) exporterConfig provided by provider, which specify necessary information to Time Series Database. exporterConfig is valid when builtIn is false. |
MultipleClusterObjectCombinedOption
(Appears on:MultipleClusterObjectOption)
MultipleClusterObjectCombinedOption defines options for handling combined variables.
Field | Description |
---|---|
string | (Optional) If set, the existing variable will be kept, and a new variable will be defined with the specified suffix in pattern: $(var.name)_$(suffix). The new variable will be auto-created and placed behind the existing one. If not set, the existing variable will be reused with the value format defined below. |
MultipleClusterObjectValueFormat | (Optional) The format of the value that the operator will use to compose values from multiple components. |
MultipleClusterObjectValueFormatFlatten | (Optional) The flatten format, default is: $(comp-name-1):value,$(comp-name-2):value. |
MultipleClusterObjectOption
(Appears on:ClusterObjectReference)
MultipleClusterObjectOption defines the options for handling multiple cluster objects matched.
Field | Description |
---|---|
MultipleClusterObjectStrategy | Define the strategy for handling multiple cluster objects. |
MultipleClusterObjectCombinedOption | (Optional) Define the options for handling combined variables. Valid only when the strategy is set to “combined”. |
MultipleClusterObjectStrategy
(string
alias)
(Appears on:MultipleClusterObjectOption)
MultipleClusterObjectStrategy defines the strategy for handling multiple cluster objects.
Value | Description |
---|---|
"combined" | MultipleClusterObjectStrategyCombined - the values from all matched components will be combined into a single variable using the specified option. |
"individual" | MultipleClusterObjectStrategyIndividual - each matched component will have its individual variable with its name as the suffix. This is required when referencing credential variables that cannot be passed by values. |
MultipleClusterObjectValueFormat
(string
alias)
(Appears on:MultipleClusterObjectCombinedOption)
MultipleClusterObjectValueFormat defines the format details for the value.
Value | Description |
---|---|
"Flatten" |
MultipleClusterObjectValueFormatFlatten
(Appears on:MultipleClusterObjectCombinedOption)
MultipleClusterObjectValueFormatFlatten defines the flatten format for the value.
Field | Description |
---|---|
string | Pair delimiter. |
string | Key-value delimiter. |
NamedVar
(Appears on:ContainerVars, ServiceVars)
Field | Description |
---|---|
string | (Optional) |
VarOption | (Optional) |
PasswordConfig
(Appears on:ComponentSystemAccount, SystemAccount, SystemAccountSpec)
PasswordConfig helps provide to customize complexity of password generation pattern.
Field | Description |
---|---|
int32 | (Optional) The length of the password. |
int32 | (Optional) The number of digits in the password. |
int32 | (Optional) The number of symbols in the password. |
LetterCase | (Optional) The case of the letters in the password. |
string | (Optional) Seed to generate the account’s password. Cannot be updated. |
Payload
(Appears on:ConfigurationItemDetail)
Field | Description |
---|---|
map[string]any | (Optional) Holds the payload data. This field is optional and can contain any type of data. Not included in the JSON representation of the object. |
PersistentVolumeClaimSpec
(Appears on:ClusterComponentVolumeClaimTemplate)
Field | Description |
---|---|
[]Kubernetes core/v1.PersistentVolumeAccessMode | (Optional) Contains the desired access modes the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1. |
Kubernetes core/v1.VolumeResourceRequirements | (Optional) Represents the minimum resources the volume should have. If the RecoverVolumeExpansionFailure feature is enabled, users are allowed to specify resource requirements that are lower than the previous value but must still be higher than the capacity recorded in the status field of the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources. |
string | (Optional) The name of the StorageClass required by the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1. |
Kubernetes core/v1.PersistentVolumeMode | (Optional) Defines what type of volume is required by the claim, either Block or Filesystem. |
Phase
(string
alias)
(Appears on:ClusterDefinitionStatus, ComponentDefinitionStatus, ComponentVersionStatus, ServiceDescriptorStatus)
Phase represents the current status of the ClusterDefinition CR.
Value | Description |
---|---|
"Available" | AvailablePhase indicates that the object is in an available state. |
"Unavailable" | UnavailablePhase indicates that the object is in an unavailable state. |
PodAntiAffinity
(string
alias)
(Appears on:Affinity)
PodAntiAffinity defines the pod anti-affinity strategy.
This strategy determines how pods are scheduled in relation to other pods, with the aim of either spreading pods across nodes (Preferred) or ensuring that certain pods do not share a node (Required).
Value | Description |
---|---|
"Preferred" | Preferred indicates that the scheduler will try to enforce the anti-affinity rules, but it will not guarantee it. |
"Required" | Required indicates that the scheduler must enforce the anti-affinity rules and will not schedule the pods unless the rules are met. |
PodAvailabilityPolicy
(string
alias)
PodAvailabilityPolicy pod availability strategy.
Value | Description |
---|---|
"Available" | |
"None" | |
"UnAvailable" |
PostStartAction
(Appears on:ClusterComponentDefinition)
PostStartAction is deprecated since v0.8.
Field | Description |
---|---|
CmdExecutorConfig | Specifies the post-start command to be executed. |
[]ScriptSpecSelector | (Optional) Used to select the script that need to be referenced. When defined, the scripts defined in scriptSpecs can be referenced within the CmdExecutorConfig. |
PreConditionType
(string
alias)
(Appears on:Action)
PreConditionType defines the preCondition type of the action execution.
Value | Description |
---|---|
"ClusterReady" | |
"ComponentReady" | |
"Immediately" | |
"RuntimeReady" |
Probe
Field | Description |
---|---|
Action | (Members of |
int32 | (Optional) Specifies the number of seconds to wait after the container has started before the RoleProbe begins to detect the container’s role. |
int32 | (Optional) Specifies the frequency at which the probe is conducted. This value is expressed in seconds. Default to 10 seconds. Minimum value is 1. |
int32 | (Optional) Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to 1. Minimum value is 1. |
int32 | (Optional) Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1. |
PrometheusScheme
(string
alias)
(Appears on:Exporter)
PrometheusScheme defines the protocol of prometheus scrape metrics.
Value | Description |
---|---|
"http" | |
"https" |
ProtectedVolume
(Appears on:VolumeProtectionSpec)
Field | Description |
---|---|
string | (Optional) The Name of the volume to protect. |
int | (Optional) Defines the high watermark threshold for the volume, it will override the component level threshold. If the value is invalid, it will be ignored and the component level threshold will be used. |
ProvisionPolicy
(Appears on:SystemAccountConfig)
ProvisionPolicy defines the policy details for creating accounts.
Deprecated since v0.9.
Field | Description |
---|---|
ProvisionPolicyType | Specifies the method to provision an account. |
ProvisionScope | Defines the scope within which the account is provisioned. |
ProvisionStatements | (Optional) The statement to provision an account. |
ProvisionSecretRef | (Optional) The external secret to refer. |
ProvisionPolicyType
(string
alias)
(Appears on:ProvisionPolicy)
ProvisionPolicyType defines the policy for creating accounts.
Value | Description |
---|---|
"CreateByStmt" | CreateByStmt will create account w.r.t. deletion and creation statement given by provider. |
"ReferToExisting" | ReferToExisting will not create account, but create a secret by copying data from referred secret file. |
ProvisionScope
(string
alias)
(Appears on:ProvisionPolicy)
ProvisionScope defines the scope of provision within a component.
Value | Description |
---|---|
"AllPods" | AllPods indicates that accounts will be created for all pods within the component. |
"AnyPods" | AnyPods indicates that accounts will be created only on a single pod within the component. |
ProvisionSecretRef
(Appears on:ComponentSystemAccount, ProvisionPolicy, SystemAccount)
ProvisionSecretRef represents the reference to a secret.
Field | Description |
---|---|
string | The unique identifier of the secret. |
string | The namespace where the secret is located. |
ProvisionStatements
(Appears on:ProvisionPolicy)
ProvisionStatements defines the statements used to create accounts.
Deprecated since v0.9.
Field | Description |
---|---|
string | Specifies the statement required to create a new account with the necessary privileges. |
string | (Optional) Defines the statement required to update the password of an existing account. |
string | (Optional) Defines the statement required to delete an existing account.
Typically used in conjunction with the creation statement to delete an account before recreating it.
For example, one might use a Deprecated: This field is deprecated and the update statement should be used instead. |
RSMSpec
(Appears on:ClusterComponentDefinition)
RSMSpec is deprecated since v0.8.
Field | Description |
---|---|
[]ReplicaRole | (Optional) Specifies a list of roles defined within the system. |
RoleProbe | (Optional) Defines the method used to probe a role. |
MembershipReconfiguration | (Optional) Indicates the actions required for dynamic membership reconfiguration. |
MemberUpdateStrategy | (Optional) Describes the strategy for updating Members (Pods).
|
ReconcileDetail
(Appears on:ConfigurationItemDetailStatus)
Field | Description |
---|---|
string | (Optional) Represents the policy applied during the most recent execution. |
string | (Optional) Represents the outcome of the most recent execution. |
string | (Optional) Represents the current revision of the configuration item. |
int32 | (Optional) Represents the number of pods where configuration changes were successfully applied. |
int32 | (Optional) Represents the total number of pods that require execution of configuration changes. |
string | (Optional) Represents the error message generated when the execution of configuration changes fails. |
ReloadOptions
(Appears on:ConfigConstraintSpec)
ReloadOptions defines the mechanisms available for dynamically reloading a process within K8s without requiring a restart.
Only one of the mechanisms can be specified at a time.
Field | Description |
---|---|
UnixSignalTrigger | (Optional) Used to trigger a reload by sending a specific Unix signal to the process. |
ShellTrigger | (Optional) Allows to execute a custom shell script to reload the process. |
TPLScriptTrigger | (Optional) Enables reloading process using a Go template script. |
AutoTrigger | (Optional) Automatically perform the reload when specified conditions are met. |
ReplicaRole
(Appears on:ComponentDefinitionSpec)
ReplicaRole represents a role that can be assumed by a component instance.
Field | Description |
---|---|
string | Defines the role’s identifier. It is used to set the “apps.kubeblocks.io/role” label value on the corresponding object. This field is immutable once set. |
bool | (Optional) Indicates whether a replica assigned this role is capable of providing services. This field is immutable once set. |
bool | (Optional) Determines if a replica in this role has the authority to perform write operations. A writable replica can modify data, handle update operations. This field is immutable once set. |
bool | (Optional) Specifies whether a replica with this role has voting rights. In distributed systems, this typically means the replica can participate in consensus decisions, configuration changes, or other processes that require a quorum. This field is immutable once set. |
ReplicasLimit
(Appears on:ComponentDefinitionSpec)
ReplicasLimit defines the valid range of number of replicas supported.
Field | Description |
---|---|
int32 | The minimum limit of replicas. |
int32 | The maximum limit of replicas. |
ReplicationSetSpec
(Appears on:ClusterComponentDefinition)
ReplicationSetSpec is deprecated since v0.7.
Field | Description |
---|---|
StatefulSetSpec | (Members of |
RerenderResourceType
(string
alias)
(Appears on:ComponentConfigSpec)
RerenderResourceType defines the resource requirements for a component.
Value | Description |
---|---|
"hscale" | |
"vscale" |
ResourceMeta
(Appears on:ConfigMapRef, SecretRef)
ResourceMeta encapsulates metadata and configuration for referencing ConfigMaps and Secrets as volumes.
Field | Description |
---|---|
string | Name is the name of the referenced ConfigMap or Secret object. It must conform to DNS label standards. |
string | MountPoint is the filesystem path where the volume will be mounted. |
string | (Optional) SubPath specifies a path within the volume from which to mount. |
[]string | (Optional) AsVolumeFrom lists the names of containers in which the volume should be mounted. |
RetryPolicy
(Appears on:Action)
Field | Description |
---|---|
int | (Optional) Defines the maximum number of retry attempts that should be made for a given Action. This value is set to 0 by default, indicating that no retries will be made. |
time.Duration | (Optional) Indicates the duration of time to wait between each retry attempt. This value is set to 0 by default, indicating that there will be no delay between retry attempts. |
RoleArbitrator
(string
alias)
(Appears on:ComponentDefinitionSpec)
RoleArbitrator defines how to arbitrate the role of replicas.
Deprecated since v0.9
Value | Description |
---|---|
"External" | |
"Lorry" |
RoleProbe
(Appears on:ComponentLifecycleActions)
Field | Description |
---|---|
LifecycleActionHandler | (Members of |
int32 | (Optional) Specifies the number of seconds to wait after the container has started before the RoleProbe begins to detect the container’s role. |
int32 | (Optional) Specifies the number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. |
int32 | (Optional) Specifies the frequency at which the probe is conducted. This value is expressed in seconds. Default to 10 seconds. Minimum value is 1. |
SchedulingPolicy
(Appears on:ClusterComponentSpec, ClusterSpec, ComponentSpec, InstanceTemplate)
Field | Description |
---|---|
string | (Optional) If specified, the Pod will be dispatched by specified scheduler. If not specified, the Pod will be dispatched by default scheduler. |
map[string]string | (Optional) NodeSelector is a selector which must be true for the Pod to fit on a node. Selector which must match a node’s labels for the Pod to be scheduled on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/ |
string | (Optional) NodeName is a request to schedule this Pod onto a specific node. If it is non-empty, the scheduler simply schedules this Pod onto that node, assuming that it fits resource requirements. |
Kubernetes core/v1.Affinity | (Optional) Specifies a group of affinity scheduling rules of the Cluster, including NodeAffinity, PodAffinity, and PodAntiAffinity. |
[]Kubernetes core/v1.Toleration | (Optional) Allows Pods to be scheduled onto nodes with matching taints.
Each toleration in the array allows the Pod to tolerate node taints based on
specified
Pods with matching tolerations are allowed to be scheduled on tainted nodes, typically reserved for specific purposes. |
[]Kubernetes core/v1.TopologySpreadConstraint | (Optional) TopologySpreadConstraints describes how a group of Pods ought to spread across topology domains. Scheduler will schedule Pods in a way which abides by the constraints. All topologySpreadConstraints are ANDed. |
ScriptSpecSelector
(Appears on:ComponentSwitchover, PostStartAction, SwitchoverAction)
Field | Description |
---|---|
string | Represents the name of the ScriptSpec referent. |
SecretRef
(Appears on:UserResourceRefs)
SecretRef defines a reference to a Secret.
Field | Description |
---|---|
ResourceMeta | (Members of |
Kubernetes core/v1.SecretVolumeSource | Secret specifies the Secret to be mounted as a volume. |
Service
(Appears on:ClusterService, ComponentService)
Field | Description | ||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
string | Name defines the name of the service. otherwise, it indicates the name of the service. Others can refer to this service by its name. (e.g., connection credential) Cannot be updated. | ||||||||||||||||||||||||||||||||||||||
string | (Optional) ServiceName defines the name of the underlying service object. If not specified, the default service name with different patterns will be used:
Only one default service name is allowed. Cannot be updated. | ||||||||||||||||||||||||||||||||||||||
map[string]string | (Optional) If ServiceType is LoadBalancer, cloud provider related parameters can be put here More info: https://kubernetes.io/docs/concepts/services-networking/service/#loadbalancer. | ||||||||||||||||||||||||||||||||||||||
Kubernetes core/v1.ServiceSpec | (Optional) Spec defines the behavior of a service. https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
| ||||||||||||||||||||||||||||||||||||||
string | (Optional) Extends the above
In this example, setting Note that if |
ServiceDescriptorSpec
(Appears on:ServiceDescriptor)
ServiceDescriptorSpec defines the desired state of ServiceDescriptor.
Field | Description |
---|---|
string | Describes the type of database service provided by the external service. For example, “mysql”, “redis”, “mongodb”. This field categorizes databases by their functionality, protocol and compatibility, facilitating appropriate service integration based on their unique capabilities. This field is case-insensitive. It also supports abbreviations for some well-known databases:
|
string | Describes the version of the service provided by the external service. This is crucial for ensuring compatibility between different components of the system, as different versions of a service may have varying features. |
CredentialVar | (Optional) Specifies the endpoint of the external service. If the service is exposed via a cluster, the endpoint will be provided in the format of |
CredentialVar | (Optional) Specifies the service or IP address of the external service. |
CredentialVar | (Optional) Specifies the port of the external service. |
ConnectionCredentialAuth | (Optional) Specifies the authentication credentials required for accessing an external service. |
ServiceDescriptorStatus
(Appears on:ServiceDescriptor)
ServiceDescriptorStatus defines the observed state of ServiceDescriptor
Field | Description |
---|---|
Phase | (Optional) Indicates the current lifecycle phase of the ServiceDescriptor. This can be either ‘Available’ or ‘Unavailable’. |
string | (Optional) Provides a human-readable explanation detailing the reason for the current phase of the ServiceConnectionCredential. |
int64 | (Optional) Represents the generation number that has been processed by the controller. |
ServicePort
(Appears on:ServiceSpec)
ServicePort is deprecated since v0.8.
Field | Description |
---|---|
string | The name of this port within the service. This must be a DNS_LABEL. All ports within a ServiceSpec must have unique names. When considering the endpoints for a Service, this must match the ‘name’ field in the EndpointPort. |
Kubernetes core/v1.Protocol | (Optional) The IP protocol for this port. Supports “TCP”, “UDP”, and “SCTP”. Default is TCP. |
string | (Optional) The application protocol for this port. This field follows standard Kubernetes label syntax. Un-prefixed names are reserved for IANA standard service names (as per RFC-6335 and https://www.iana.org/assignments/service-names). Non-standard protocols should use prefixed names such as mycompany.com/my-custom-protocol. |
int32 | The port that will be exposed by this service. |
Kubernetes api utils intstr.IntOrString | (Optional) Number or name of the port to access on the pods targeted by the service. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME.
This field is ignored for services with clusterIP=None, and should be
omitted or set equal to the More info: https://kubernetes.io/docs/concepts/services-networking/service/#defining-a-service |
ServiceRef
(Appears on:ClusterComponentSpec, ComponentSpec)
Field | Description |
---|---|
string | Specifies the identifier of the service reference declaration. It corresponds to the serviceRefDeclaration name defined in either:
|
string | (Optional) Specifies the namespace of the referenced Cluster or the namespace of the referenced ServiceDescriptor object. If not provided, the referenced Cluster and ServiceDescriptor will be searched in the namespace of the current Cluster by default. |
string | (Optional) Specifies the name of the KubeBlocks Cluster being referenced. This is used when services from another KubeBlocks Cluster are consumed. By default, the referenced KubeBlocks Cluster’s Note:
Deprecated since v0.9 since |
ServiceRefClusterSelector | (Optional) References a service provided by another KubeBlocks Cluster. It specifies the ClusterService and the account credentials needed for access. |
string | (Optional) Specifies the name of the ServiceDescriptor object that describes a service provided by external sources. When referencing a service provided by external sources, a ServiceDescriptor object is required to establish
the service binding.
The If both |
ServiceRefClusterSelector
(Appears on:ServiceRef)
Field | Description |
---|---|
string | The name of the Cluster being referenced. |
ServiceRefServiceSelector | (Optional) Identifies a ClusterService from the list of Services defined in |
ServiceRefCredentialSelector | (Optional) Specifies the SystemAccount to authenticate and establish a connection with the referenced Cluster.
The SystemAccount should be defined in |
ServiceRefCredentialSelector
(Appears on:ServiceRefClusterSelector)
Field | Description |
---|---|
string | The name of the Component where the credential resides in. |
string | The name of the credential (SystemAccount) to reference. |
ServiceRefDeclaration
(Appears on:ClusterComponentDefinition, ComponentDefinitionSpec)
ServiceRefDeclaration represents a reference to a service that can be either provided by a KubeBlocks Cluster or an external service. It acts as a placeholder for the actual service reference, which is determined later when a Cluster is created.
The purpose of ServiceRefDeclaration is to declare a service dependency without specifying the concrete details of the service. It allows for flexibility and abstraction in defining service references within a Component. By using ServiceRefDeclaration, you can define service dependencies in a declarative manner, enabling loose coupling and easier management of service references across different components and clusters.
Upon Cluster creation, the ServiceRefDeclaration is bound to an actual service through the ServiceRef field, effectively resolving and connecting to the specified service.
Field | Description |
---|---|
string | Specifies the name of the ServiceRefDeclaration. |
[]ServiceRefDeclarationSpec | Defines a list of constraints and requirements for services that can be bound to this ServiceRefDeclaration upon Cluster creation. Each ServiceRefDeclarationSpec defines a ServiceKind and ServiceVersion, outlining the acceptable service types and versions that are compatible. This flexibility allows a ServiceRefDeclaration to be fulfilled by any one of the provided specs. For example, if it requires an OLTP database, specs for both MySQL and PostgreSQL are listed, either MySQL or PostgreSQL services can be used when binding. |
bool | (Optional) Specifies whether the service reference can be optional. For an optional service-ref, the component can still be created even if the service-ref is not provided. |
ServiceRefDeclarationSpec
(Appears on:ServiceRefDeclaration)
Field | Description |
---|---|
string | Specifies the type or nature of the service. This should be a well-known application cluster type, such as
{mysql, redis, mongodb}.
The field is case-insensitive and supports abbreviations for some well-known databases.
For instance, both |
string | Defines the service version of the service reference. This is a regular expression that matches a version number pattern.
For instance, |
ServiceRefServiceSelector
(Appears on:ServiceRefClusterSelector)
Field | Description |
---|---|
string | (Optional) The name of the Component where the Service resides in. It is required when referencing a Component’s Service. |
string | The name of the Service to be referenced. Leave it empty to reference the default Service. Set it to “headless” to reference the default headless Service. If the referenced Service is of pod-service type (a Service per Pod), there will be multiple Service objects matched, and the resolved value will be presented in the following format: service1.name,service2.name… |
string | (Optional) The port name of the Service to be referenced. If there is a non-zero node-port exist for the matched Service port, the node-port will be selected first. If the referenced Service is of pod-service type (a Service per Pod), there will be multiple Service objects matched, and the resolved value will be presented in the following format: service1.name:port1,service2.name:port2… |
ServiceRefVarSelector
(Appears on:VarSource)
ServiceRefVarSelector selects a var from a ServiceRefDeclaration.
Field | Description |
---|---|
ClusterObjectReference | (Members of The ServiceRefDeclaration to select from. |
ServiceRefVars | (Members of |
ServiceRefVars
(Appears on:ServiceRefVarSelector)
ServiceRefVars defines the vars that can be referenced from a ServiceRef.
Field | Description |
---|---|
VarOption | (Optional) |
VarOption | (Optional) |
VarOption | (Optional) |
CredentialVars | (Members of |
ServiceSpec
(Appears on:ClusterComponentDefinition)
ServiceSpec is deprecated since v0.8.
Field | Description |
---|---|
[]ServicePort | (Optional) The list of ports that are exposed by this service. More info: https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies |
ServiceVarSelector
(Appears on:VarSource)
ServiceVarSelector selects a var from a Service.
Field | Description |
---|---|
ClusterObjectReference | (Members of The Service to select from. It can be referenced from the default headless service by setting the name to “headless”. |
ServiceVars | (Members of |
ServiceVars
(Appears on:ServiceVarSelector)
ServiceVars defines the vars that can be referenced from a Service.
Field | Description |
---|---|
VarOption | (Optional) |
VarOption | (Optional) LoadBalancer represents the LoadBalancer ingress point of the service. If multiple ingress points are available, the first one will be used automatically, choosing between IP and Hostname. |
NamedVar | (Optional) Port references a port or node-port defined in the service. If the referenced service is a pod-service, there will be multiple service objects matched, and the value will be presented in the following format: service1.name:port1,service2.name:port2… |
ShardingSpec
(Appears on:ClusterSpec)
ShardingSpec defines how KubeBlocks manage dynamic provisioned shards. A typical design pattern for distributed databases is to distribute data across multiple shards, with each shard consisting of multiple replicas. Therefore, KubeBlocks supports representing a shard with a Component and dynamically instantiating Components using a template when shards are added. When shards are removed, the corresponding Components are also deleted.
Field | Description |
---|---|
string | Represents the common parent part of all shard names.
This identifier is included as part of the Service DNS name and must comply with IANA service naming rules.
It is used to generate the names of underlying Components following the pattern Note that the name defined in Component template( |
ClusterComponentSpec | The template for generating Components for shards, where each shard consists of one Component.
This field is of type ClusterComponentSpec, which encapsulates all the required details and
definitions for creating and managing the Components.
KubeBlocks uses this template to generate a set of identical Components or shards.
All the generated Components will have the same specifications and definitions as specified in the This allows for the creation of multiple Components with consistent configurations, enabling sharding and distribution of workloads across Components. |
int32 | Specifies the desired number of shards. Users can declare the desired number of shards through this field. KubeBlocks dynamically creates and deletes Components based on the difference between the desired and actual number of shards. KubeBlocks provides lifecycle management for sharding, including:
|
StatefulSetSpec
(Appears on:ClusterComponentDefinition, ConsensusSetSpec, ReplicationSetSpec)
StatefulSetSpec is deprecated since v0.7.
Field | Description |
---|---|
UpdateStrategy | (Optional) Specifies the strategy for updating Pods.
For workloadType=
|
Kubernetes apps/v1.PodManagementPolicyType | (Optional) Controls the creation of pods during initial scale up, replacement of pods on nodes, and scaling down.
|
Kubernetes apps/v1.StatefulSetUpdateStrategy | (Optional) Specifies the low-level StatefulSetUpdateStrategy to be used when updating Pods in the StatefulSet upon a
revision to the Template.
|
StatefulSetWorkload
StatefulSetWorkload interface
StatelessSetSpec
(Appears on:ClusterComponentDefinition)
StatelessSetSpec is deprecated since v0.7.
Field | Description |
---|---|
Kubernetes apps/v1.DeploymentStrategy | (Optional) Specifies the deployment strategy that will be used to replace existing pods with new ones. |
SwitchPolicyType
(string
alias)
(Appears on:ClusterSwitchPolicy)
SwitchPolicyType defines the types of switch policies that can be applied to a cluster.
Currently, only the Noop policy is supported. Support for MaximumAvailability and MaximumDataProtection policies is planned for future releases.
Value | Description |
---|---|
"MaximumAvailability" | MaximumAvailability represents a switch policy that aims for maximum availability. This policy will switch if the primary is active and the synchronization delay is 0 according to the user-defined lagProbe data delay detection logic. If the primary is down, it will switch immediately. This policy is intended for future support. |
"MaximumDataProtection" | MaximumDataProtection represents a switch policy focused on maximum data protection. This policy will only switch if the primary is active and the synchronization delay is 0, based on the user-defined lagProbe data lag detection logic. If the primary is down, it will switch only if it can be confirmed that the primary and secondary data are consistent. Otherwise, it will not switch. This policy is planned for future implementation. |
"Noop" | Noop indicates that KubeBlocks will not perform any high-availability switching for the components. Users are required to implement their own HA solution or integrate an existing open-source HA solution. |
SwitchoverAction
(Appears on:SwitchoverSpec)
SwitchoverAction is deprecated since v0.8.
Field | Description |
---|---|
CmdExecutorConfig | Specifies the switchover command. |
[]ScriptSpecSelector | (Optional) Used to select the script that need to be referenced. When defined, the scripts defined in scriptSpecs can be referenced within the SwitchoverAction.CmdExecutorConfig. |
SwitchoverSpec
(Appears on:ClusterComponentDefinition)
SwitchoverSpec is deprecated since v0.8.
Field | Description |
---|---|
SwitchoverAction | (Optional) Represents the action of switching over to a specified candidate primary or leader instance. |
SwitchoverAction | (Optional) Represents the action of switching over without specifying a candidate primary or leader instance. |
SystemAccount
(Appears on:ComponentDefinitionSpec)
Field | Description |
---|---|
string | Specifies the unique identifier for the account. This name is used by other entities to reference the account. This field is immutable once set. |
bool | (Optional) Indicates if this account is a system initialization account (e.g., MySQL root). This field is immutable once set. |
string | (Optional) Defines the statement used to create the account with the necessary privileges. This field is immutable once set. |
PasswordConfig | (Optional) Specifies the policy for generating the account’s password. This field is immutable once set. |
ProvisionSecretRef | (Optional) Refers to the secret from which data will be copied to create the new account. This field is immutable once set. |
SystemAccountConfig
(Appears on:SystemAccountSpec)
SystemAccountConfig specifies how to create and delete system accounts.
Deprecated since v0.9.
Field | Description |
---|---|
AccountName | The unique identifier of a system account. |
ProvisionPolicy | Outlines the strategy for creating the account. |
SystemAccountSpec
(Appears on:ClusterComponentDefinition)
SystemAccountSpec specifies information to create system accounts.
Deprecated since v0.8, be replaced by componentDefinition.spec.systemAccounts
and
componentDefinition.spec.lifecycleActions.accountProvision
.
Field | Description |
---|---|
CmdExecutorConfig | Configures how to obtain the client SDK and execute statements. |
PasswordConfig | Defines the pattern used to generate passwords for system accounts. |
[]SystemAccountConfig | Defines the configuration settings for system accounts. |
TLSConfig
(Appears on:ComponentSpec)
Field | Description |
---|---|
bool | (Optional) A boolean flag that indicates whether the Component should use Transport Layer Security (TLS) for secure communication. When set to true, the Component will be configured to use TLS encryption for its network connections. This ensures that the data transmitted between the Component and its clients or other Components is encrypted and protected from unauthorized access. If TLS is enabled, the Component may require additional configuration, such as specifying TLS certificates and keys, to properly set up the secure communication channel. |
Issuer | (Optional) Specifies the configuration for the TLS certificates issuer. It allows defining the issuer name and the reference to the secret containing the TLS certificates and key. The secret should contain the CA certificate, TLS certificate, and private key in the specified keys. Required when TLS is enabled. |
TLSSecretRef
(Appears on:Issuer)
TLSSecretRef defines Secret contains Tls certs
Field | Description |
---|---|
string | Name of the Secret that contains user-provided certificates. |
string | Key of CA cert in Secret |
string | Key of Cert in Secret |
string | Key of TLS private key in Secret |
TargetPodSelector
(string
alias)
(Appears on:Action)
TargetPodSelector defines how to select pod(s) to execute an Action.
Value | Description |
---|---|
"All" | |
"Any" | |
"Ordinal" | |
"Role" |
TenancyType
(string
alias)
(Appears on:Affinity, ClusterSpec)
TenancyType defines the type of tenancy for cluster tenant resources.
Value | Description |
---|---|
"DedicatedNode" | DedicatedNode means each pod runs on their own dedicated node. |
"SharedNode" | SharedNode means multiple pods may share the same node. |
TerminationPolicyType
(string
alias)
(Appears on:ClusterSpec)
TerminationPolicyType defines termination policy types.
Value | Description |
---|---|
"Delete" | Delete is based on Halt and deletes PVCs. |
"DoNotTerminate" | DoNotTerminate will block delete operation. |
"Halt" | Halt will delete workload resources such as statefulset, deployment workloads but keep PVCs. |
"WipeOut" | WipeOut is based on Delete and wipe out all volume snapshots and snapshot data from backup storage location. |
UpdateStrategy
(string
alias)
(Appears on:ClusterComponentSpec, ComponentDefinitionSpec, StatefulSetSpec)
UpdateStrategy defines the update strategy for cluster components. This strategy determines how updates are applied
across the cluster.
The available strategies are Serial
, BestEffortParallel
, and Parallel
.
Value | Description |
---|---|
"BestEffortParallel" | BestEffortParallelStrategy indicates that the replicas are updated in parallel, with the operator making
a best-effort attempt to update as many replicas as possible concurrently
while maintaining the component’s availability.
Unlike the For example, consider a component with 5 replicas. To maintain the component’s availability and quorum, the operator may allow a maximum of 2 replicas to be simultaneously updated. This ensures that at least 3 replicas (a quorum) remain available and functional during the update process. The |
"Parallel" | ParallelStrategy indicates that updates are applied simultaneously to all Pods of a Component. The replicas are updated in parallel, with the operator updating all replicas concurrently. This strategy provides the fastest update time but may lead to a period of reduced availability or capacity during the update process. |
"Serial" | SerialStrategy indicates that updates are applied one at a time in a sequential manner. The operator waits for each replica to be updated and ready before proceeding to the next one. This ensures that only one replica is unavailable at a time during the update process. |
UpgradePolicy
(string
alias)
UpgradePolicy defines the policy of reconfiguring.
Value | Description |
---|---|
"autoReload" | |
"dynamicReloadBeginRestart" | |
"none" | |
"simple" | |
"parallel" | |
"rolling" | |
"operatorSyncUpdate" |
UserResourceRefs
(Appears on:ClusterComponentSpec)
UserResourceRefs defines references to user-defined Secrets and ConfigMaps.
Field | Description |
---|---|
[]SecretRef | (Optional) SecretRefs defines the user-defined Secrets. |
[]ConfigMapRef | (Optional) ConfigMapRefs defines the user-defined ConfigMaps. |
VarOption
(string
alias)
(Appears on:ComponentVars, CredentialVars, NamedVar, ServiceRefVars, ServiceVars)
VarOption defines whether a variable is required or optional.
VarSource
(Appears on:EnvVar)
VarSource represents a source for the value of an EnvVar.
Field | Description |
---|---|
Kubernetes core/v1.ConfigMapKeySelector | (Optional) Selects a key of a ConfigMap. |
Kubernetes core/v1.SecretKeySelector | (Optional) Selects a key of a Secret. |
HostNetworkVarSelector | (Optional) Selects a defined var of host-network resources. |
ServiceVarSelector | (Optional) Selects a defined var of a Service. |
CredentialVarSelector | (Optional) Selects a defined var of a Credential (SystemAccount). |
ServiceRefVarSelector | (Optional) Selects a defined var of a ServiceRef. |
ComponentVarSelector | (Optional) Selects a defined var of a Component. |
VolumeProtectionSpec
(Appears on:ClusterComponentDefinition)
VolumeProtectionSpec is deprecated since v0.9, replaced with ComponentVolume.HighWatermark.
Field | Description |
---|---|
int | (Optional) The high watermark threshold for volume space usage. If there is any specified volumes who’s space usage is over the threshold, the pre-defined “LOCK” action will be triggered to degrade the service to protect volume from space exhaustion, such as to set the instance as read-only. And after that, if all volumes’ space usage drops under the threshold later, the pre-defined “UNLOCK” action will be performed to recover the service normally. |
[]ProtectedVolume | (Optional) The Volumes to be protected. |
VolumeType
(string
alias)
(Appears on:VolumeTypeSpec)
VolumeType defines the type of volume, specifically distinguishing between volumes used for backup data and those used for logs.
Value | Description |
---|---|
"data" | VolumeTypeData indicates a volume designated for storing backup data. This type of volume is optimized for the storage and retrieval of data backups, ensuring data persistence and reliability. |
"log" | VolumeTypeLog indicates a volume designated for storing logs. This type of volume is optimized for log data, facilitating efficient log storage, retrieval, and management. |
VolumeTypeSpec
(Appears on:ClusterComponentDefinition)
VolumeTypeSpec is deprecated since v0.9, replaced with ComponentVolume.
Field | Description |
---|---|
string | Corresponds to the name of the VolumeMounts field in PodSpec.Container. |
VolumeType | (Optional) Type of data the volume will persistent. |
WorkloadType
(string
alias)
(Appears on:ClusterComponentDefinition)
WorkloadType defines the type of workload for the components of the ClusterDefinition.
It can be one of the following: Stateless
, Stateful
, Consensus
, or Replication
.
Deprecated since v0.8.
Value | Description |
---|---|
"Consensus" | Consensus represents a workload type involving distributed consensus algorithms for coordinated decision-making. |
"Replication" | Replication represents a workload type that involves replication, typically used for achieving high availability and fault tolerance. |
"Stateful" | Stateful represents a workload type where components maintain state, and each instance has a unique identity. |
"Stateless" | Stateless represents a workload type where components do not maintain state, and instances are interchangeable. |
apps.kubeblocks.io/v1beta1
Resource Types:
ConfigConstraint
ConfigConstraint manages the parameters across multiple configuration files contained in a single configure template. These configuration files should have the same format (e.g. ini, xml, properties, json).
It provides the following functionalities:
Parameter Value Validation: Validates and ensures compliance of parameter values with defined constraints.
Dynamic Reload on Modification: Monitors parameter changes and triggers dynamic reloads to apply updates.
Parameter Rendering in Templates: Injects parameters into templates to generate up-to-date configuration files.
Field | Description | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
| ||||||||||||||||||
|
| ||||||||||||||||||
Kubernetes meta/v1.ObjectMeta | Refer to the Kubernetes API documentation for the fields of the
| ||||||||||||||||||
ConfigConstraintSpec |
| ||||||||||||||||||
ConfigConstraintStatus |
AutoTrigger
(Appears on:ReloadOptions, ReloadAction)
AutoTrigger automatically perform the reload when specified conditions are met.
Field | Description |
---|---|
string | (Optional) The name of the process. |
CfgFileFormat
(string
alias)
(Appears on:FileFormatConfig)
CfgFileFormat defines formatter of configuration files.
Value | Description |
---|---|
"dotenv" | |
"hcl" | |
"ini" | |
"json" | |
"properties" | |
"props-plus" | |
"redis" | |
"toml" | |
"xml" | |
"yaml" |
ConfigConstraintPhase
(string
alias)
(Appears on:ConfigConstraintStatus, ConfigConstraintStatus)
ConfigConstraintPhase defines the ConfigConstraint CR .status.phase
Value | Description |
---|---|
"Available" | |
"Deleting" | |
"Unavailable" |
ConfigConstraintSpec
(Appears on:ConfigConstraint)
ConfigConstraintSpec defines the desired state of ConfigConstraint
Field | Description |
---|---|
ReloadAction | (Optional) Specifies the dynamic reload (dynamic reconfiguration) actions supported by the engine. When set, the controller executes the scripts defined in these actions to handle dynamic parameter updates. Dynamic reloading is triggered only if both of the following conditions are met:
If Example:
|
bool | (Optional) Indicates whether to consolidate dynamic reload and restart actions into a single restart.
This flag allows for more efficient handling of configuration changes by potentially eliminating an unnecessary reload step. |
bool | (Optional) Configures whether the dynamic reload specified in
|
[]DownwardAPIChangeTriggeredAction | (Optional) Specifies a list of actions to execute specified commands based on Pod labels. It utilizes the K8s Downward API to mount label information as a volume into the pod. The ‘config-manager’ sidecar container watches for changes in the role label and dynamically invoke registered commands (usually execute some SQL statements) when a change is detected. It is designed for scenarios where:
|
ParametersSchema | (Optional) Defines a list of parameters including their names, default values, descriptions, types, and constraints (permissible values or the range of valid values). |
[]string | (Optional) List static parameters. Modifications to any of these parameters require a restart of the process to take effect. |
[]string | (Optional) List dynamic parameters. Modifications to these parameters trigger a configuration reload without requiring a process restart. |
[]string | (Optional) Lists the parameters that cannot be modified once set. Attempting to change any of these parameters will be ignored. |
FileFormatConfig | Specifies the format of the configuration file and any associated parameters that are specific to the chosen format.
Supported formats include Each format may have its own set of parameters that can be configured.
For instance, when using the Example:
|
ConfigConstraintStatus
(Appears on:ConfigConstraint)
ConfigConstraintStatus represents the observed state of a ConfigConstraint.
Field | Description |
---|---|
ConfigConstraintPhase | (Optional) Specifies the status of the configuration template. When set to CCAvailablePhase, the ConfigConstraint can be referenced by ClusterDefinition. |
string | (Optional) Provides descriptions for abnormal states. |
int64 | (Optional) Refers to the most recent generation observed for this ConfigConstraint. This value is updated by the API Server. |
DownwardAPIChangeTriggeredAction
(Appears on:ConfigConstraintSpec, ConfigConstraintSpec)
DownwardAPIChangeTriggeredAction defines an action that triggers specific commands in response to changes in Pod labels. For example, a command might be executed when the ‘role’ label of the Pod is updated.
Field | Description |
---|---|
string | Specifies the name of the field. It must be a string of maximum length 63.
The name should match the regex pattern |
string | Specifies the mount point of the Downward API volume. |
[]Kubernetes core/v1.DownwardAPIVolumeFile | Represents a list of files under the Downward API volume. |
[]string | (Optional) Specifies the command to be triggered when changes are detected in Downward API volume files. It relies on the inotify mechanism in the config-manager sidecar to monitor file changes. |
ScriptConfig | (Optional) ScriptConfig object specifies a ConfigMap that contains script files that should be mounted inside the pod. The scripts are mounted as volumes and can be referenced and executed by the DownwardAction to perform specific tasks or configurations. |
DynamicParameterSelectedPolicy
(string
alias)
DynamicParameterSelectedPolicy determines how to select the parameters of dynamic reload actions
Value | Description |
---|---|
"all" | |
"dynamic" |
DynamicReloadType
(string
alias)
DynamicReloadType defines reload method.
Value | Description |
---|---|
"auto" | |
"http" | |
"sql" | |
"exec" | |
"tpl" | |
"signal" |
FileFormatConfig
(Appears on:ConfigConstraintSpec, ConfigConstraintSpec)
FileFormatConfig specifies the format of the configuration file and any associated parameters that are specific to the chosen format.
Field | Description |
---|---|
FormatterAction | (Members of Each format may have its own set of parameters that can be configured.
For instance, when using the |
CfgFileFormat | The config file format. Valid values are
|
FormatterAction
(Appears on:FileFormatConfig)
FormatterAction configures format-specific options for different configuration file format. Note: Only one of its members should be specified at any given time.
Field | Description |
---|---|
IniConfig | (Optional) Holds options specific to the ‘ini’ file format. |
IniConfig
(Appears on:FormatterAction)
IniConfig holds options specific to the ‘ini’ file format.
Field | Description |
---|---|
string | (Optional) A string that describes the name of the ini section. |
ParametersSchema
(Appears on:ConfigConstraintSpec)
ParametersSchema Defines a list of configuration items with their names, default values, descriptions, types, and constraints.
Field | Description |
---|---|
string | (Optional) Specifies the top-level key in the ‘configSchema.cue’ that organizes the validation rules for parameters. This key must exist within the CUE script defined in ‘configSchema.cue’. |
string | (Optional) Hold a string that contains a script written in CUE language that defines a list of configuration items. Each item is detailed with its name, default value, description, type (e.g. string, integer, float), and constraints (permissible values or the valid range of values). CUE (Configure, Unify, Execute) is a declarative language designed for defining and validating complex data configurations. It is particularly useful in environments like K8s where complex configurations and validation rules are common. This script functions as a validator for user-provided configurations, ensuring compliance with the established specifications and constraints. |
Kubernetes api extensions v1.JSONSchemaProps | Generated from the ‘cue’ field and transformed into a JSON format. |
ReloadAction
(Appears on:ConfigConstraintSpec)
ReloadAction defines the mechanisms available for dynamically reloading a process within K8s without requiring a restart.
Only one of the mechanisms can be specified at a time.
Field | Description |
---|---|
UnixSignalTrigger | (Optional) Used to trigger a reload by sending a specific Unix signal to the process. |
ShellTrigger | (Optional) Allows to execute a custom shell script to reload the process. |
TPLScriptTrigger | (Optional) Enables reloading process using a Go template script. |
AutoTrigger | (Optional) Automatically perform the reload when specified conditions are met. |
Kubernetes meta/v1.LabelSelector | (Optional) Used to match labels on the pod to determine whether a dynamic reload should be performed. In some scenarios, only specific pods (e.g., primary replicas) need to undergo a dynamic reload.
The If the |
ScriptConfig
(Appears on:ConfigConstraintSpec, DownwardAPIChangeTriggeredAction, ShellTrigger, TPLScriptTrigger)
Field | Description |
---|---|
string | Specifies the reference to the ConfigMap containing the scripts. |
string | (Optional) Specifies the namespace for the ConfigMap. If not specified, it defaults to the “default” namespace. |
ShellTrigger
(Appears on:ReloadOptions, ReloadAction)
ShellTrigger allows to execute a custom shell script to reload the process.
Field | Description |
---|---|
[]string | Specifies the command to execute in order to reload the process. It should be a valid shell command. |
bool | (Optional) Determines the synchronization mode of parameter updates with “config-manager”.
|
bool | (Optional) Controls whether parameter updates are processed individually or collectively in a batch:
Defaults to ‘False’ if unspecified. |
string | (Optional) Specifies a Go template string for formatting batch input data.
It’s used when Example template:
This example generates batch input data in a key:value format, sorted by keys.
If not specified, the default format is key=value, sorted by keys, for each updated parameter.
|
ToolsSetup | (Optional) Specifies the tools container image used by ShellTrigger for dynamic reload. If the dynamic reload action is triggered by a ShellTrigger, this field is required. This image must contain all necessary tools for executing the ShellTrigger scripts. Usually the specified image is referenced by the init container, which is then responsible for copy the tools from the image to a bin volume. This ensures that the tools are available to the ‘config-manager’ sidecar. |
ScriptConfig | (Optional) ScriptConfig object specifies a ConfigMap that contains script files that should be mounted inside the pod. The scripts are mounted as volumes and can be referenced and executed by the dynamic reload. |
SignalType
(string
alias)
(Appears on:UnixSignalTrigger)
SignalType defines which signals are valid.
Value | Description |
---|---|
"SIGABRT" | |
"SIGALRM" | |
"SIGBUS" | |
"SIGCHLD" | |
"SIGCONT" | |
"SIGFPE" | |
"SIGHUP" | |
"SIGILL" | |
"SIGINT" | |
"SIGIO" | |
"SIGKILL" | |
"SIGPIPE" | |
"SIGPROF" | |
"SIGPWR" | |
"SIGQUIT" | |
"SIGSEGV" | |
"SIGSTKFLT" | |
"SIGSTOP" | |
"SIGSYS" | |
"SIGTERM" | |
"SIGTRAP" | |
"SIGTSTP" | |
"SIGTTIN" | |
"SIGTTOU" | |
"SIGURG" | |
"SIGUSR1" | |
"SIGUSR2" | |
"SIGVTALRM" | |
"SIGWINCH" | |
"SIGXCPU" | |
"SIGXFSZ" |
TPLScriptTrigger
(Appears on:ReloadOptions, ReloadAction)
TPLScriptTrigger Enables reloading process using a Go template script.
Field | Description |
---|---|
ScriptConfig | (Members of Specifies the ConfigMap that contains the script to be executed for reload. |
bool | (Optional) Determines whether parameter updates should be synchronized with the “config-manager”. Specifies the controller’s reload strategy:
|
ToolConfig
(Appears on:ToolsSetup)
ToolConfig specifies the settings of an init container that prepare tools for dynamic reload.
Field | Description |
---|---|
string | Specifies the name of the init container. |
bool | (Optional) Indicates whether the tool image should be used as the container image for a sidecar. This is useful for large tool images, such as those for C++ tools, which may depend on numerous libraries (e.g., *.so files). If enabled, the tool image is deployed as a sidecar container image. Examples:
generated containers:
|
string | (Optional) Specifies the tool container image. |
[]string | (Optional) Specifies the command to be executed by the init container. |
ToolsSetup
(Appears on:ConfigConstraintSpec, ShellTrigger)
ToolsSetup prepares the tools for dynamic reloads used in ShellTrigger from a specified container image.
Example:
toolsSetup:
mountPoint: /kb_tools
toolConfigs:
- name: kb-tools
command:
- cp
- /bin/ob-tools
- /kb_tools/obtools
image: docker.io/apecloud/obtools
This example copies the “/bin/ob-tools” binary from the image to “/kb_tools/obtools”.
Field | Description |
---|---|
string | Specifies the directory path in the container where the tools-related files are to be copied. This field is typically used with an emptyDir volume to ensure a temporary, empty directory is provided at pod creation. |
[]ToolConfig | (Optional) Specifies a list of settings of init containers that prepare tools for dynamic reload. |
UnixSignalTrigger
(Appears on:ReloadOptions, ReloadAction)
UnixSignalTrigger is used to trigger a reload by sending a specific Unix signal to the process.
Field | Description |
---|---|
SignalType | Specifies a valid Unix signal to be sent. For a comprehensive list of all Unix signals, see: ../../pkg/configuration/configmap/handler.go:allUnixSignals |
string | Identifies the name of the process to which the Unix signal will be sent. |
workloads.kubeblocks.io/v1
Resource Types:
InstanceSet
InstanceSet is the Schema for the instancesets API.
Field | Description | ||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
| ||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||
Kubernetes meta/v1.ObjectMeta | Contains the metadata for the particular object, such as name, namespace, labels, and annotations. Refer to the Kubernetes API documentation for the fields of the
| ||||||||||||||||||||||||||||||||||||
InstanceSetSpec | Defines the desired state of the state machine. It includes the configuration details for the state machine.
| ||||||||||||||||||||||||||||||||||||
InstanceSetStatus | Represents the current information about the state machine. This data may be out of date. |
AccessMode
(string
alias)
AccessMode defines SVC access mode enums.
Value | Description |
---|---|
"None" | |
"ReadWrite" | |
"Readonly" |
Action
(Appears on:MembershipReconfiguration)
Field | Description |
---|---|
string | (Optional) Refers to the utility image that contains the command which can be utilized to retrieve or process role information. |
[]string | A set of instructions that will be executed within the Container to retrieve or process role information. This field is required. |
[]string | (Optional) Additional parameters used to perform specific statements. This field is optional. |
ConditionType
(string
alias)
Value | Description |
---|---|
"InstanceAvailable" | InstanceAvailable ConditionStatus will be True if all instances(pods) are in the ready condition and continue for “MinReadySeconds” seconds. Otherwise, it will be set to False. |
"InstanceFailure" | InstanceFailure is added in an instance set when at least one of its instances(pods) is in a |
"InstanceReady" | InstanceReady is added in an instance set when at least one of its instances(pods) is in a Ready condition. ConditionStatus will be True if all its instances(pods) are in a Ready condition. Or, a NotReady reason with not ready instances encoded in the Message filed will be set. |
"InstanceUpdateRestricted" | InstanceUpdateRestricted represents a ConditionType that indicates updates to an InstanceSet are blocked(when the PodUpdatePolicy is set to StrictInPlace but the pods cannot be updated in-place). |
Credential
(Appears on:InstanceSetSpec)
Field | Description |
---|---|
CredentialVar | Defines the user’s name for the credential. The corresponding environment variable will be KB_ITS_USERNAME. |
CredentialVar | Represents the user’s password for the credential. The corresponding environment variable will be KB_ITS_PASSWORD. |
CredentialVar
(Appears on:Credential)
Field | Description |
---|---|
string | (Optional) Specifies the value of the environment variable. This field is optional and defaults to an empty string. The value can include variable references in the format $(VAR_NAME) which will be expanded using previously defined environment variables in the container and any service environment variables. If a variable cannot be resolved, the reference in the input string will remain unchanged. Double $$ can be used to escape the $(VAR_NAME) syntax, resulting in a single $ and producing the string literal “$(VAR_NAME)”. Escaped references will not be expanded, regardless of whether the variable exists or not. |
Kubernetes core/v1.EnvVarSource | (Optional) Defines the source for the environment variable’s value. This field is optional and cannot be used if the ‘Value’ field is not empty. |
InstanceSetSpec
(Appears on:InstanceSet)
InstanceSetSpec defines the desired state of InstanceSet
Field | Description |
---|---|
int32 | (Optional) Specifies the desired number of replicas of the given Template. These replicas are instantiations of the same Template, with each having a consistent identity. Defaults to 1 if unspecified. |
Ordinals | Specifies the desired Ordinals of the default template. The Ordinals used to specify the ordinal of the instance (pod) names to be generated under the default template. For example, if Ordinals is {ranges: [{start: 0, end: 1}], discrete: [7]}, then the instance names generated under the default template would be $(cluster.name)-$(component.name)-0、$(cluster.name)-$(component.name)-1 and $(cluster.name)-$(component.name)-7 |
int32 | (Optional) Defines the minimum number of seconds a newly created pod should be ready without any of its container crashing to be considered available. Defaults to 0, meaning the pod will be considered available as soon as it is ready. |
Kubernetes meta/v1.LabelSelector | Represents a label query over pods that should match the desired replica count indicated by the |
Kubernetes core/v1.PodTemplateSpec | |
[]InstanceTemplate | (Optional) Overrides values in default Template. Instance is the fundamental unit managed by KubeBlocks. It represents a Pod with additional objects such as PVCs, Services, ConfigMaps, etc. An InstanceSet manages instances with a total count of Replicas, and by default, all these instances are generated from the same template. The InstanceTemplate provides a way to override values in the default template, allowing the InstanceSet to manage instances from different templates. The naming convention for instances (pods) based on the InstanceSet Name, InstanceTemplate Name, and ordinal. The constructed instance name follows the pattern: $(instance_set.name)-$(template.name)-$(ordinal). By default, the ordinal starts from 0 for each InstanceTemplate. It is important to ensure that the Name of each InstanceTemplate is unique. The sum of replicas across all InstanceTemplates should not exceed the total number of Replicas specified for the InstanceSet. Any remaining replicas will be generated using the default template and will follow the default naming rules. |
[]string | (Optional) Specifies the names of instances to be transitioned to offline status. Marking an instance as offline results in the following:
Setting instances to offline allows for a controlled scale-in process, preserving their data and maintaining ordinal consistency within the cluster. Note that offline instances and their associated resources, such as PVCs, are not automatically deleted. The cluster administrator must manually manage the cleanup and removal of these resources when they are no longer needed. |
[]Kubernetes core/v1.PersistentVolumeClaim | (Optional) Specifies a list of PersistentVolumeClaim templates that define the storage requirements for each replica. Each template specifies the desired characteristics of a persistent volume, such as storage class, size, and access modes. These templates are used to dynamically provision persistent volumes for replicas upon their creation. The final name of each PVC is generated by appending the pod’s identifier to the name specified in volumeClaimTemplates[*].name. |
Kubernetes apps/v1.PodManagementPolicyType | (Optional) Controls how pods are created during initial scale up, when replacing pods on nodes, or when scaling down. The default policy is Note: This field will be removed in future version. |
Kubernetes api utils intstr.IntOrString | (Optional) Controls the concurrency of pods during initial scale up, when replacing pods on nodes,
or when scaling down. It only used when |
PodUpdatePolicyType | (Optional) PodUpdatePolicy indicates how pods should be updated
|
Kubernetes apps/v1.StatefulSetUpdateStrategy | Indicates the StatefulSetUpdateStrategy that will be employed to update Pods in the InstanceSet when a revision is made to Template. UpdateStrategy.Type will be set to appsv1.OnDeleteStatefulSetStrategyType if MemberUpdateStrategy is not nil Note: This field will be removed in future version. |
[]ReplicaRole | (Optional) A list of roles defined in the system. Instanceset obtains role through pods’ role label |
MembershipReconfiguration | (Optional) Provides actions to do membership dynamic reconfiguration. |
map[string]string | (Optional) Provides variables which are used to call Actions. |
MemberUpdateStrategy | (Optional) Members(Pods) update strategy.
|
bool | (Optional) Indicates that the InstanceSet is paused, meaning the reconciliation of this InstanceSet object will be paused. |
Credential | (Optional) Credential used to connect to DB engine |
InstanceSetStatus
(Appears on:InstanceSet)
InstanceSetStatus defines the observed state of InstanceSet
Field | Description |
---|---|
int64 | (Optional) observedGeneration is the most recent generation observed for this InstanceSet. It corresponds to the InstanceSet’s generation, which is updated on mutation by the API Server. |
int32 | replicas is the number of instances created by the InstanceSet controller. |
int32 | readyReplicas is the number of instances created for this InstanceSet with a Ready Condition. |
int32 | currentReplicas is the number of instances created by the InstanceSet controller from the InstanceSet version indicated by CurrentRevisions. |
int32 | updatedReplicas is the number of instances created by the InstanceSet controller from the InstanceSet version indicated by UpdateRevisions. |
string | currentRevision, if not empty, indicates the version of the InstanceSet used to generate instances in the sequence [0,currentReplicas). |
string | updateRevision, if not empty, indicates the version of the InstanceSet used to generate instances in the sequence [replicas-updatedReplicas,replicas) |
[]Kubernetes meta/v1.Condition | (Optional) Represents the latest available observations of an instanceset’s current state. Known .status.conditions.type are: “InstanceFailure”, “InstanceReady” |
int32 | (Optional) Total number of available instances (ready for at least minReadySeconds) targeted by this InstanceSet. |
int32 | (Optional) Defines the initial number of instances when the cluster is first initialized. This value is set to spec.Replicas at the time of object creation and remains constant thereafter. Used only when spec.roles set. |
int32 | (Optional) Represents the number of instances that have already reached the MembersStatus during the cluster initialization stage. This value remains constant once it equals InitReplicas. Used only when spec.roles set. |
[]MemberStatus | (Optional) Provides the status of each member in the cluster. |
map[string]string | (Optional) currentRevisions, if not empty, indicates the old version of the InstanceSet used to generate the underlying workload. key is the pod name, value is the revision. |
map[string]string | (Optional) updateRevisions, if not empty, indicates the new version of the InstanceSet used to generate the underlying workload. key is the pod name, value is the revision. |
[]InstanceTemplateStatus | (Optional) TemplatesStatus represents status of each instance generated by InstanceTemplates |
InstanceTemplateStatus
(Appears on:InstanceSetStatus)
InstanceTemplateStatus aggregates the status of replicas for each InstanceTemplate
Field | Description |
---|---|
string | Name, the name of the InstanceTemplate. |
int32 | (Optional) Replicas is the number of replicas of the InstanceTemplate. |
int32 | (Optional) ReadyReplicas is the number of Pods that have a Ready Condition. |
int32 | (Optional) AvailableReplicas is the number of Pods that ready for at least minReadySeconds. |
int32 | currentReplicas is the number of instances created by the InstanceSet controller from the InstanceSet version indicated by CurrentRevisions. |
int32 | (Optional) UpdatedReplicas is the number of Pods created by the InstanceSet controller from the InstanceSet version indicated by UpdateRevisions. |
MemberStatus
(Appears on:InstanceSetStatus)
Field | Description |
---|---|
string | Represents the name of the pod. |
ReplicaRole | (Optional) Defines the role of the replica in the cluster. |
MemberUpdateStrategy
(string
alias)
(Appears on:InstanceSetSpec)
MemberUpdateStrategy defines Cluster Component update strategy.
Value | Description |
---|---|
"BestEffortParallel" | |
"Parallel" | |
"Serial" |
MembershipReconfiguration
(Appears on:InstanceSetSpec)
Field | Description |
---|---|
Action | (Optional) Specifies the environment variables that can be used in all following Actions:
Defines the action to perform a switchover. If the Image is not configured, the latest BusyBox image will be used. |
Action | (Optional) Defines the action to add a member. If the Image is not configured, the Image from the previous non-nil action will be used. |
Action | (Optional) Defines the action to remove a member. If the Image is not configured, the Image from the previous non-nil action will be used. |
Action | (Optional) Defines the action to trigger the new member to start log syncing. If the Image is not configured, the Image from the previous non-nil action will be used. |
Action | (Optional) Defines the action to inform the cluster that the new member can join voting now. If the Image is not configured, the Image from the previous non-nil action will be used. |
Action | (Optional) Defines the procedure for a controlled transition of a role to a new replica. |
PodUpdatePolicyType
(string
alias)
(Appears on:InstanceSetSpec)
Value | Description |
---|---|
"PreferInPlace" | PreferInPlacePodUpdatePolicyType indicates that we will first attempt an in-place upgrade of the Pod. If that fails, it will fall back to the ReCreate, where pod will be recreated. |
"StrictInPlace" | StrictInPlacePodUpdatePolicyType indicates that only allows in-place upgrades. Any attempt to modify other fields will be rejected. |
RoleUpdateMechanism
(string
alias)
RoleUpdateMechanism defines the way how pod role label being updated.
Value | Description |
---|---|
"DirectAPIServerEventUpdate" | |
"ReadinessProbeEventUpdate" |
workloads.kubeblocks.io/v1alpha1
Resource Types:
InstanceSet
InstanceSet is the Schema for the instancesets API.
Field | Description | ||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
| ||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||
Kubernetes meta/v1.ObjectMeta | Contains the metadata for the particular object, such as name, namespace, labels, and annotations. Refer to the Kubernetes API documentation for the fields of the
| ||||||||||||||||||||||||||||||||||||||
InstanceSetSpec | Defines the desired state of the state machine. It includes the configuration details for the state machine.
| ||||||||||||||||||||||||||||||||||||||
InstanceSetStatus | Represents the current information about the state machine. This data may be out of date. |
AccessMode
(string
alias)
(Appears on:ReplicaRole)
AccessMode defines SVC access mode enums.
Value | Description |
---|---|
"None" | |
"ReadWrite" | |
"Readonly" |
Action
(Appears on:MembershipReconfiguration, RoleProbe)
Field | Description |
---|---|
string | (Optional) Refers to the utility image that contains the command which can be utilized to retrieve or process role information. |
[]string | A set of instructions that will be executed within the Container to retrieve or process role information. This field is required. |
[]string | (Optional) Additional parameters used to perform specific statements. This field is optional. |
ConditionType
(string
alias)
Value | Description |
---|---|
"InstanceAvailable" | InstanceAvailable ConditionStatus will be True if all instances(pods) are in the ready condition and continue for “MinReadySeconds” seconds. Otherwise, it will be set to False. |
"InstanceFailure" | InstanceFailure is added in an instance set when at least one of its instances(pods) is in a |
"InstanceReady" | InstanceReady is added in an instance set when at least one of its instances(pods) is in a Ready condition. ConditionStatus will be True if all its instances(pods) are in a Ready condition. Or, a NotReady reason with not ready instances encoded in the Message filed will be set. |
"InstanceUpdateRestricted" | InstanceUpdateRestricted represents a ConditionType that indicates updates to an InstanceSet are blocked(when the PodUpdatePolicy is set to StrictInPlace but the pods cannot be updated in-place). |
Credential
(Appears on:InstanceSetSpec)
Field | Description |
---|---|
CredentialVar | Defines the user’s name for the credential. The corresponding environment variable will be KB_ITS_USERNAME. |
CredentialVar | Represents the user’s password for the credential. The corresponding environment variable will be KB_ITS_PASSWORD. |
CredentialVar
(Appears on:Credential)
Field | Description |
---|---|
string | (Optional) Specifies the value of the environment variable. This field is optional and defaults to an empty string. The value can include variable references in the format $(VAR_NAME) which will be expanded using previously defined environment variables in the container and any service environment variables. If a variable cannot be resolved, the reference in the input string will remain unchanged. Double $$ can be used to escape the $(VAR_NAME) syntax, resulting in a single $ and producing the string literal “$(VAR_NAME)”. Escaped references will not be expanded, regardless of whether the variable exists or not. |
Kubernetes core/v1.EnvVarSource | (Optional) Defines the source for the environment variable’s value. This field is optional and cannot be used if the ‘Value’ field is not empty. |
InstanceSetSpec
(Appears on:InstanceSet)
InstanceSetSpec defines the desired state of InstanceSet
Field | Description |
---|---|
int32 | (Optional) Specifies the desired number of replicas of the given Template. These replicas are instantiations of the same Template, with each having a consistent identity. Defaults to 1 if unspecified. |
Ordinals | Specifies the desired Ordinals of the default template. The Ordinals used to specify the ordinal of the instance (pod) names to be generated under the default template. For example, if Ordinals is {ranges: [{start: 0, end: 1}], discrete: [7]}, then the instance names generated under the default template would be $(cluster.name)-$(component.name)-0、$(cluster.name)-$(component.name)-1 and $(cluster.name)-$(component.name)-7 |
int32 | (Optional) Defines the minimum number of seconds a newly created pod should be ready without any of its container crashing to be considered available. Defaults to 0, meaning the pod will be considered available as soon as it is ready. |
Kubernetes meta/v1.LabelSelector | Represents a label query over pods that should match the desired replica count indicated by the |
Kubernetes core/v1.Service | (Optional) Defines the behavior of a service spec. Provides read-write service. https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status Note: This field will be removed in future version. |
Kubernetes core/v1.PodTemplateSpec | |
[]InstanceTemplate | (Optional) Overrides values in default Template. Instance is the fundamental unit managed by KubeBlocks. It represents a Pod with additional objects such as PVCs, Services, ConfigMaps, etc. An InstanceSet manages instances with a total count of Replicas, and by default, all these instances are generated from the same template. The InstanceTemplate provides a way to override values in the default template, allowing the InstanceSet to manage instances from different templates. The naming convention for instances (pods) based on the InstanceSet Name, InstanceTemplate Name, and ordinal. The constructed instance name follows the pattern: $(instance_set.name)-$(template.name)-$(ordinal). By default, the ordinal starts from 0 for each InstanceTemplate. It is important to ensure that the Name of each InstanceTemplate is unique. The sum of replicas across all InstanceTemplates should not exceed the total number of Replicas specified for the InstanceSet. Any remaining replicas will be generated using the default template and will follow the default naming rules. |
[]string | (Optional) Specifies the names of instances to be transitioned to offline status. Marking an instance as offline results in the following:
Setting instances to offline allows for a controlled scale-in process, preserving their data and maintaining ordinal consistency within the cluster. Note that offline instances and their associated resources, such as PVCs, are not automatically deleted. The cluster administrator must manually manage the cleanup and removal of these resources when they are no longer needed. |
[]Kubernetes core/v1.PersistentVolumeClaim | (Optional) Specifies a list of PersistentVolumeClaim templates that define the storage requirements for each replica. Each template specifies the desired characteristics of a persistent volume, such as storage class, size, and access modes. These templates are used to dynamically provision persistent volumes for replicas upon their creation. The final name of each PVC is generated by appending the pod’s identifier to the name specified in volumeClaimTemplates[*].name. |
Kubernetes apps/v1.PodManagementPolicyType | (Optional) Controls how pods are created during initial scale up, when replacing pods on nodes, or when scaling down. The default policy is Note: This field will be removed in future version. |
Kubernetes api utils intstr.IntOrString | (Optional) Controls the concurrency of pods during initial scale up, when replacing pods on nodes,
or when scaling down. It only used when |
PodUpdatePolicyType | (Optional) PodUpdatePolicy indicates how pods should be updated
|
InstanceUpdateStrategy | Indicates the StatefulSetUpdateStrategy that will be employed to update Pods in the InstanceSet when a revision is made to Template. Note: This field will be removed in future version. |
[]ReplicaRole | (Optional) A list of roles defined in the system. |
RoleProbe | (Optional) Provides method to probe role. |
MembershipReconfiguration | (Optional) Provides actions to do membership dynamic reconfiguration. |
MemberUpdateStrategy | (Optional) Members(Pods) update strategy.
|
bool | (Optional) Indicates that the InstanceSet is paused, meaning the reconciliation of this InstanceSet object will be paused. |
Credential | (Optional) Credential used to connect to DB engine |
InstanceSetStatus
(Appears on:InstanceSet)
InstanceSetStatus defines the observed state of InstanceSet
Field | Description |
---|---|
int64 | (Optional) observedGeneration is the most recent generation observed for this InstanceSet. It corresponds to the InstanceSet’s generation, which is updated on mutation by the API Server. |
int32 | replicas is the number of instances created by the InstanceSet controller. |
int32 | readyReplicas is the number of instances created for this InstanceSet with a Ready Condition. |
int32 | currentReplicas is the number of instances created by the InstanceSet controller from the InstanceSet version indicated by CurrentRevisions. |
int32 | updatedReplicas is the number of instances created by the InstanceSet controller from the InstanceSet version indicated by UpdateRevisions. |
string | currentRevision, if not empty, indicates the version of the InstanceSet used to generate instances in the sequence [0,currentReplicas). |
string | updateRevision, if not empty, indicates the version of the InstanceSet used to generate instances in the sequence [replicas-updatedReplicas,replicas) |
[]Kubernetes meta/v1.Condition | (Optional) Represents the latest available observations of an instanceset’s current state. Known .status.conditions.type are: “InstanceFailure”, “InstanceReady” |
int32 | (Optional) Total number of available instances (ready for at least minReadySeconds) targeted by this InstanceSet. |
int32 | (Optional) Defines the initial number of instances when the cluster is first initialized. This value is set to spec.Replicas at the time of object creation and remains constant thereafter. Used only when spec.roles set. |
int32 | (Optional) Represents the number of instances that have already reached the MembersStatus during the cluster initialization stage. This value remains constant once it equals InitReplicas. Used only when spec.roles set. |
[]MemberStatus | (Optional) Provides the status of each member in the cluster. |
bool | (Optional) Indicates whether it is required for the InstanceSet to have at least one primary instance ready. |
map[string]string | (Optional) currentRevisions, if not empty, indicates the old version of the InstanceSet used to generate the underlying workload. key is the pod name, value is the revision. |
map[string]string | (Optional) updateRevisions, if not empty, indicates the new version of the InstanceSet used to generate the underlying workload. key is the pod name, value is the revision. |
[]InstanceTemplateStatus | (Optional) TemplatesStatus represents status of each instance generated by InstanceTemplates |
InstanceTemplate
(Appears on:InstanceSetSpec)
InstanceTemplate allows customization of individual replica configurations within a Component, without altering the base component template defined in ClusterComponentSpec. It enables the application of distinct settings to specific instances (replicas), providing flexibility while maintaining a common configuration baseline.
Field | Description |
---|---|
string | Name specifies the unique name of the instance Pod created using this InstanceTemplate. This name is constructed by concatenating the component’s name, the template’s name, and the instance’s ordinal using the pattern: $(cluster.name)-$(component.name)-$(template.name)-$(ordinal). Ordinals start from 0. The specified name overrides any default naming conventions or patterns. |
int32 | (Optional) Specifies the number of instances (Pods) to create from this InstanceTemplate. This field allows setting how many replicated instances of the component, with the specific overrides in the InstanceTemplate, are created. The default value is 1. A value of 0 disables instance creation. |
Ordinals | Specifies the desired Ordinals of this InstanceTemplate. The Ordinals used to specify the ordinal of the instance (pod) names to be generated under this InstanceTemplate. For example, if Ordinals is {ranges: [{start: 0, end: 1}], discrete: [7]}, then the instance names generated under this InstanceTemplate would be $(cluster.name)-$(component.name)-$(template.name)-0、$(cluster.name)-$(component.name)-$(template.name)-1 and $(cluster.name)-$(component.name)-$(template.name)-7 |
map[string]string | (Optional) Specifies a map of key-value pairs to be merged into the Pod’s existing annotations. Existing keys will have their values overwritten, while new keys will be added to the annotations. |
map[string]string | (Optional) Specifies a map of key-value pairs that will be merged into the Pod’s existing labels. Values for existing keys will be overwritten, and new keys will be added. |
string | (Optional) Specifies an override for the first container’s image in the pod. |
SchedulingPolicy | (Optional) Specifies the scheduling policy for the Component. |
Kubernetes core/v1.ResourceRequirements | (Optional) Specifies an override for the resource requirements of the first container in the Pod. This field allows for customizing resource allocation (CPU, memory, etc.) for the container. |
[]Kubernetes core/v1.EnvVar | (Optional) Defines Env to override. Add new or override existing envs. |
[]Kubernetes core/v1.Volume | (Optional) Defines Volumes to override. Add new or override existing volumes. |
[]Kubernetes core/v1.VolumeMount | (Optional) Defines VolumeMounts to override. Add new or override existing volume mounts of the first container in the pod. |
[]Kubernetes core/v1.PersistentVolumeClaim | (Optional) Defines VolumeClaimTemplates to override. Add new or override existing volume claim templates. |
InstanceTemplateStatus
(Appears on:InstanceSetStatus)
InstanceTemplateStatus aggregates the status of replicas for each InstanceTemplate
Field | Description |
---|---|
string | Name, the name of the InstanceTemplate. |
int32 | (Optional) Replicas is the number of replicas of the InstanceTemplate. |
int32 | (Optional) ReadyReplicas is the number of Pods that have a Ready Condition. |
int32 | (Optional) AvailableReplicas is the number of Pods that ready for at least minReadySeconds. |
int32 | currentReplicas is the number of instances created by the InstanceSet controller from the InstanceSet version indicated by CurrentRevisions. |
int32 | (Optional) UpdatedReplicas is the number of Pods created by the InstanceSet controller from the InstanceSet version indicated by UpdateRevisions. |
InstanceUpdateStrategy
(Appears on:InstanceSetSpec)
InstanceUpdateStrategy indicates the strategy that the InstanceSet controller will use to perform updates. It includes any additional parameters necessary to perform the update for the indicated strategy.
Field | Description |
---|---|
int32 | (Optional) Partition indicates the number of pods that should be updated during a rolling update. The remaining pods will remain untouched. This is helpful in defining how many pods should participate in the update process. The update process will follow the order of pod names in descending lexicographical (dictionary) order. The default value is Replicas (i.e., update all pods). |
Kubernetes api utils intstr.IntOrString | (Optional) The maximum number of pods that can be unavailable during the update. Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%). Absolute number is calculated from percentage by rounding up. This can not be 0. Defaults to 1. The field applies to all pods. That means if there is any unavailable pod, it will be counted towards MaxUnavailable. |
MemberUpdateStrategy | (Optional) Members(Pods) update strategy.
|
MemberStatus
(Appears on:ClusterComponentStatus, InstanceSetStatus)
Field | Description |
---|---|
string | Represents the name of the pod. |
ReplicaRole | (Optional) Defines the role of the replica in the cluster. |
MemberUpdateStrategy
(string
alias)
(Appears on:RSMSpec, InstanceSetSpec, InstanceUpdateStrategy)
MemberUpdateStrategy defines Cluster Component update strategy.
Value | Description |
---|---|
"BestEffortParallel" | |
"Parallel" | |
"Serial" |
MembershipReconfiguration
(Appears on:RSMSpec, InstanceSetSpec)
Field | Description |
---|---|
Action | (Optional) Specifies the environment variables that can be used in all following Actions:
Defines the action to perform a switchover. If the Image is not configured, the latest BusyBox image will be used. |
Action | (Optional) Defines the action to add a member. If the Image is not configured, the Image from the previous non-nil action will be used. |
Action | (Optional) Defines the action to remove a member. If the Image is not configured, the Image from the previous non-nil action will be used. |
Action | (Optional) Defines the action to trigger the new member to start log syncing. If the Image is not configured, the Image from the previous non-nil action will be used. |
Action | (Optional) Defines the action to inform the cluster that the new member can join voting now. If the Image is not configured, the Image from the previous non-nil action will be used. |
Ordinals
(Appears on:InstanceSetSpec, InstanceTemplate)
Ordinals represents a combination of continuous segments and individual values.
Field | Description |
---|---|
[]Range | |
[]int32 |
PodUpdatePolicyType
(string
alias)
(Appears on:ClusterComponentSpec, ComponentSpec, InstanceSetSpec)
Value | Description |
---|---|
"PreferInPlace" | PreferInPlacePodUpdatePolicyType indicates that we will first attempt an in-place upgrade of the Pod. If that fails, it will fall back to the ReCreate, where pod will be recreated. |
"StrictInPlace" | StrictInPlacePodUpdatePolicyType indicates that only allows in-place upgrades. Any attempt to modify other fields will be rejected. |
Range
(Appears on:Ordinals)
Range represents a range with a start and an end value. It is used to define a continuous segment.
Field | Description |
---|---|
int32 | |
int32 |
ReplicaRole
(Appears on:RSMSpec, InstanceSetSpec, MemberStatus)
Field | Description |
---|---|
string | Defines the role name of the replica. |
AccessMode | Specifies the service capabilities of this member. |
bool | (Optional) Indicates if this member has voting rights. |
bool | (Optional) Determines if this member is the leader. |
RoleProbe
(Appears on:RSMSpec, InstanceSetSpec)
RoleProbe defines how to observe role
Field | Description |
---|---|
string | (Optional) Specifies the builtin handler name to use to probe the role of the main container. Available handlers include: mysql, postgres, mongodb, redis, etcd, kafka. Use CustomHandler to define a custom role probe function if none of the built-in handlers meet the requirement. |
[]Action | (Optional) Defines a custom method for role probing. Actions defined here are executed in series. Upon completion of all actions, the final output should be a single string representing the role name defined in spec.Roles. The latest BusyBox image will be used if Image is not configured. Environment variables can be used in Command:
|
int32 | (Optional) Specifies the number of seconds to wait after the container has started before initiating role probing. |
int32 | (Optional) Specifies the number of seconds after which the probe times out. |
int32 | (Optional) Specifies the frequency (in seconds) of probe execution. |
int32 | (Optional) Specifies the minimum number of consecutive successes for the probe to be considered successful after having failed. |
int32 | (Optional) Specifies the minimum number of consecutive failures for the probe to be considered failed after having succeeded. |
RoleUpdateMechanism | (Optional) Specifies the method for updating the pod role label. |
RoleUpdateMechanism
(string
alias)
(Appears on:RoleProbe)
RoleUpdateMechanism defines the way how pod role label being updated.
Value | Description |
---|---|
"DirectAPIServerEventUpdate" | |
"ReadinessProbeEventUpdate" |
SchedulingPolicy
(Appears on:InstanceTemplate)
SchedulingPolicy the scheduling policy. Deprecated: Unify with apps/v1alpha1.SchedulingPolicy
Field | Description |
---|---|
string | (Optional) If specified, the Pod will be dispatched by specified scheduler. If not specified, the Pod will be dispatched by default scheduler. |
map[string]string | (Optional) NodeSelector is a selector which must be true for the Pod to fit on a node. Selector which must match a node’s labels for the Pod to be scheduled on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/ |
string | (Optional) NodeName is a request to schedule this Pod onto a specific node. If it is non-empty, the scheduler simply schedules this Pod onto that node, assuming that it fits resource requirements. |
Kubernetes core/v1.Affinity | (Optional) Specifies a group of affinity scheduling rules of the Cluster, including NodeAffinity, PodAffinity, and PodAntiAffinity. |
[]Kubernetes core/v1.Toleration | (Optional) Allows Pods to be scheduled onto nodes with matching taints.
Each toleration in the array allows the Pod to tolerate node taints based on
specified
Pods with matching tolerations are allowed to be scheduled on tainted nodes, typically reserved for specific purposes. |
[]Kubernetes core/v1.TopologySpreadConstraint | (Optional) TopologySpreadConstraints describes how a group of Pods ought to spread across topology domains. Scheduler will schedule Pods in a way which abides by the constraints. All topologySpreadConstraints are ANDed. |
Generated with gen-crd-api-reference-docs