跳到主要内容

集群 API 参考


Packages:

apps.kubeblocks.io/v1alpha1

Resource Types:

BackupPolicyTemplate

BackupPolicyTemplate is the Schema for the BackupPolicyTemplates API (defined by provider)


FieldDescription
apiVersion
string
apps.kubeblocks.io/v1alpha1
kind
string
BackupPolicyTemplate
metadata
Kubernetes meta/v1.ObjectMeta
Refer to the Kubernetes API documentation for the fields of themetadata field.
spec
BackupPolicyTemplateSpec


clusterDefinitionRef
string

clusterDefinitionRef references ClusterDefinition name, this is an immutable attribute.


backupPolicies
[]BackupPolicy

backupPolicies is a list of backup policy template for the specified componentDefinition.


identifier
string
(Optional)

Identifier is a unique identifier for this BackupPolicyTemplate.
this identifier will be the suffix of the automatically generated backupPolicy name.
and must be added when multiple BackupPolicyTemplates exist,
otherwise the generated backupPolicy override will occur.


status
BackupPolicyTemplateStatus

Cluster

Cluster is the Schema for the clusters API.


FieldDescription
apiVersion
string
apps.kubeblocks.io/v1alpha1
kind
string
Cluster
metadata
Kubernetes meta/v1.ObjectMeta
Refer to the Kubernetes API documentation for the fields of themetadata field.
spec
ClusterSpec


clusterDefinitionRef
string

Cluster referencing ClusterDefinition name. This is an immutable attribute.


clusterVersionRef
string
(Optional)

Cluster referencing ClusterVersion name.


terminationPolicy
TerminationPolicyType

Cluster termination policy. Valid values are DoNotTerminate, Halt, Delete, WipeOut.
DoNotTerminate will block delete operation.
Halt will delete workload resources such as statefulset, deployment workloads but keep PVCs.
Delete is based on Halt and deletes PVCs.
WipeOut is based on Delete and wipe out all volume snapshots and snapshot data from backup storage location.


componentSpecs
[]ClusterComponentSpec

List of componentSpecs you want to replace in ClusterDefinition and ClusterVersion. It will replace the field in ClusterDefinition’s and ClusterVersion’s component if type is matching.


tenancy
TenancyType
(Optional)

tenancy describes how pods are distributed across node.
SharedNode means multiple pods may share the same node.
DedicatedNode means each pod runs on their own dedicated node.


availabilityPolicy
AvailabilityPolicyType
(Optional)

availabilityPolicy describes the availability policy, including zone, node, and none.


affinity
Affinity
(Optional)

affinity is a group of affinity scheduling rules.


tolerations
[]Kubernetes core/v1.Toleration
(Optional)

tolerations are attached to tolerate any taint that matches the triple key,value,effect using the matching operator operator.


replicas
int32
(Optional)

replicas specifies the replicas of the first componentSpec, if the replicas of the first componentSpec is specified, this value will be ignored.


resources
ClusterResources
(Optional)

resources specifies the resources of the first componentSpec, if the resources of the first componentSpec is specified, this value will be ignored.


storage
ClusterStorage
(Optional)

storage specifies the storage of the first componentSpec, if the storage of the first componentSpec is specified, this value will be ignored.


monitor
ClusterMonitor
(Optional)

monitor specifies the configuration of monitor


network
ClusterNetwork
(Optional)

network specifies the configuration of network


backup
ClusterBackup
(Optional)

cluster backup configuration.


status
ClusterStatus

ClusterDefinition

ClusterDefinition is the Schema for the clusterdefinitions API


FieldDescription
apiVersion
string
apps.kubeblocks.io/v1alpha1
kind
string
ClusterDefinition
metadata
Kubernetes meta/v1.ObjectMeta
Refer to the Kubernetes API documentation for the fields of themetadata field.
spec
ClusterDefinitionSpec


type
string
(Optional)

Cluster definition type defines well known application cluster type, e.g. mysql/redis/mongodb


componentDefs
[]ClusterComponentDefinition

componentDefs provides cluster components definitions.


connectionCredential
map[string]string
(Optional)

Connection credential template used for creating a connection credential
secret for cluster.apps.kubeblocks.io object.



Built-in objects are:
- $(RANDOM_PASSWD) - random 8 characters.
- $(UUID) - generate a random UUID v4 string.
- $(UUID_B64) - generate a random UUID v4 BASE64 encoded string.
- $(UUID_STR_B64) - generate a random UUID v4 string then BASE64 encoded.
- $(UUID_HEX) - generate a random UUID v4 HEX representation.
- $(HEADLESS_SVC_FQDN) - headless service FQDN placeholder, value pattern - $(CLUSTER_NAME)-$(1ST_COMP_NAME)-headless.$(NAMESPACE).svc,
where 1ST_COMP_NAME is the 1st component that provide ClusterDefinition.spec.componentDefs[].service attribute;
- $(SVC_FQDN) - service FQDN placeholder, value pattern - $(CLUSTER_NAME)-$(1ST_COMP_NAME).$(NAMESPACE).svc,
where 1ST_COMP_NAME is the 1st component that provide ClusterDefinition.spec.componentDefs[].service attribute;
- $(SVC_PORT_{PORT-NAME}) - a ServicePort’s port value with specified port name, i.e, a servicePort JSON struct:
{"name": "mysql", "targetPort": "mysqlContainerPort", "port": 3306}, and “$(SVC_PORT_mysql)” in the
connection credential value is 3306.


status
ClusterDefinitionStatus

ClusterVersion

ClusterVersion is the Schema for the ClusterVersions API


FieldDescription
apiVersion
string
apps.kubeblocks.io/v1alpha1
kind
string
ClusterVersion
metadata
Kubernetes meta/v1.ObjectMeta
Refer to the Kubernetes API documentation for the fields of themetadata field.
spec
ClusterVersionSpec


clusterDefinitionRef
string

ref ClusterDefinition.


componentVersions
[]ClusterComponentVersion

List of components’ containers versioning context, i.e., container image ID, container commands, args., and environments.


status
ClusterVersionStatus

ComponentClassDefinition

ComponentClassDefinition is the Schema for the componentclassdefinitions API


FieldDescription
apiVersion
string
apps.kubeblocks.io/v1alpha1
kind
string
ComponentClassDefinition
metadata
Kubernetes meta/v1.ObjectMeta
Refer to the Kubernetes API documentation for the fields of themetadata field.
spec
ComponentClassDefinitionSpec


groups
[]ComponentClassGroup
(Optional)

group defines a list of class series that conform to the same constraint.


status
ComponentClassDefinitionStatus

ComponentResourceConstraint

ComponentResourceConstraint is the Schema for the componentresourceconstraints API


FieldDescription
apiVersion
string
apps.kubeblocks.io/v1alpha1
kind
string
ComponentResourceConstraint
metadata
Kubernetes meta/v1.ObjectMeta
Refer to the Kubernetes API documentation for the fields of themetadata field.
spec
ComponentResourceConstraintSpec


rules
[]ResourceConstraintRule

Component resource constraint rules.


selector
[]ClusterResourceConstraintSelector
(Optional)

selector is used to bind the resource constraint to cluster definitions.


ConfigConstraint

ConfigConstraint is the Schema for the configconstraint API


FieldDescription
apiVersion
string
apps.kubeblocks.io/v1alpha1
kind
string
ConfigConstraint
metadata
Kubernetes meta/v1.ObjectMeta
Refer to the Kubernetes API documentation for the fields of themetadata field.
spec
ConfigConstraintSpec


reloadOptions
ReloadOptions
(Optional)

reloadOptions indicates whether the process supports reload.
if set, the controller will determine the behavior of the engine instance based on the configuration templates,
restart or reload depending on whether any parameters in the StaticParameters have been modified.


toolsImageSpec
ToolsImageSpec
(Optional)

toolConfig used to config init container.


downwardAPIOptions
[]DownwardAPIOption
(Optional)

downwardAPIOptions is used to watch pod fields.


scriptConfigs
[]ScriptConfig
(Optional)

scriptConfigs, list of ScriptConfig, witch these scripts can be used by volume trigger,downward trigger, or tool image


cfgSchemaTopLevelName
string
(Optional)

cfgSchemaTopLevelName is cue type name, which generates openapi schema.


configurationSchema
CustomParametersValidation
(Optional)

configurationSchema imposes restrictions on database parameter’s rule.


staticParameters
[]string
(Optional)

staticParameters, list of StaticParameter, modifications of them trigger a process restart.


dynamicParameters
[]string
(Optional)

dynamicParameters, list of DynamicParameter, modifications of them trigger a config dynamic reload without process restart.


immutableParameters
[]string
(Optional)

immutableParameters describes parameters that prohibit user from modification.


selector
Kubernetes meta/v1.LabelSelector

selector is used to match the label on the pod,
for example, a pod of the primary is match on the patroni cluster.


formatterConfig
FormatterConfig

formatterConfig describes the format of the configuration file, the controller
1. parses configuration file
2. analyzes the modified parameters
3. applies corresponding policies.


status
ConfigConstraintStatus

OpsRequest

OpsRequest is the Schema for the opsrequests API


FieldDescription
apiVersion
string
apps.kubeblocks.io/v1alpha1
kind
string
OpsRequest
metadata
Kubernetes meta/v1.ObjectMeta
Refer to the Kubernetes API documentation for the fields of themetadata field.
spec
OpsRequestSpec


clusterRef
string

clusterRef references clusterDefinition.


cancel
bool
(Optional)

cancel defines the action to cancel the Pending/Creating/Running opsRequest, supported types: [VerticalScaling, HorizontalScaling].
once cancel is set to true, this opsRequest will be canceled and modifying this property again will not take effect.


type
OpsType

type defines the operation type.


ttlSecondsAfterSucceed
int32
(Optional)

ttlSecondsAfterSucceed OpsRequest will be deleted after TTLSecondsAfterSucceed second when OpsRequest.status.phase is Succeed.


upgrade
Upgrade
(Optional)

upgrade specifies the cluster version by specifying clusterVersionRef.


horizontalScaling
[]HorizontalScaling
(Optional)

horizontalScaling defines what component need to horizontal scale the specified replicas.


volumeExpansion
[]VolumeExpansion
(Optional)

volumeExpansion defines what component and volumeClaimTemplate need to expand the specified storage.


restart
[]ComponentOps
(Optional)

restart the specified components.


switchover
[]Switchover
(Optional)

switchover the specified components.


verticalScaling
[]VerticalScaling
(Optional)

verticalScaling defines what component need to vertical scale the specified compute resources.


reconfigure
Reconfigure
(Optional)

reconfigure defines the variables that need to input when updating configuration.


expose
[]Expose
(Optional)

expose defines services the component needs to expose.


restoreFrom
RestoreFromSpec
(Optional)

cluster RestoreFrom backup or point in time


ttlSecondsBeforeAbort
int32
(Optional)

ttlSecondsBeforeAbort OpsRequest will wait at most TTLSecondsBeforeAbort seconds for start-conditions to be met.
If not specified, the default value is 0, which means that the start-conditions must be met immediately.


scriptSpec
ScriptSpec
(Optional)

scriptSpec defines the script to be executed.


status
OpsRequestStatus

AccessMode (string alias)

(Appears on:ConsensusMember, ConsensusMemberStatus)

AccessMode defines SVC access mode enums.


ValueDescription

"None"

"ReadWrite"

"Readonly"

AccountName (string alias)

(Appears on:SystemAccountConfig)

AccountName defines system account names.


ValueDescription

"kbadmin"

"kbdataprotection"

"kbmonitoring"

"kbprobe"

"kbreplicator"

Affinity

(Appears on:ClusterComponentSpec, ClusterSpec)

FieldDescription
podAntiAffinity
PodAntiAffinity
(Optional)

podAntiAffinity describes the anti-affinity level of pods within a component.
Preferred means try spread pods by TopologyKeys.
Required means must spread pods by TopologyKeys.


topologyKeys
[]string
(Optional)

topologyKey is the key of node labels.
Nodes that have a label with this key and identical values are considered to be in the same topology.
It’s used as the topology domain for pod anti-affinity and pod spread constraint.
Some well-known label keys, such as “kubernetes.io/hostname” and “topology.kubernetes.io/zone”
are often used as TopologyKey, as well as any other custom label key.


nodeLabels
map[string]string
(Optional)

nodeLabels describes that pods must be scheduled to the nodes with the specified node labels.


tenancy
TenancyType
(Optional)

tenancy describes how pods are distributed across node.
SharedNode means multiple pods may share the same node.
DedicatedNode means each pod runs on their own dedicated node.


AvailabilityPolicyType (string alias)

(Appears on:ClusterSpec)

AvailabilityPolicyType for cluster affinity policy.


ValueDescription

"node"

"none"

"zone"

BackupPolicy

(Appears on:BackupPolicyTemplateSpec)

FieldDescription
componentDefRef
string

componentDefRef references componentDef defined in ClusterDefinition spec. Need to
comply with IANA Service Naming rule.


retention
RetentionSpec
(Optional)

retention describe how long the Backup should be retained. if not set, will be retained forever.


schedule
Schedule
(Optional)

schedule policy for backup.


snapshot
SnapshotPolicy
(Optional)

the policy for snapshot backup.


datafile
CommonBackupPolicy
(Optional)

the policy for datafile backup.


logfile
CommonBackupPolicy
(Optional)

the policy for logfile backup.


BackupPolicyHook

(Appears on:SnapshotPolicy)

BackupPolicyHook defines for the database execute commands before and after backup.


FieldDescription
preCommands
[]string
(Optional)

pre backup to perform commands


postCommands
[]string
(Optional)

post backup to perform commands


image
string
(Optional)

exec command with image


containerName
string
(Optional)

which container can exec command


BackupPolicyTemplateSpec

(Appears on:BackupPolicyTemplate)

BackupPolicyTemplateSpec defines the desired state of BackupPolicyTemplate


FieldDescription
clusterDefinitionRef
string

clusterDefinitionRef references ClusterDefinition name, this is an immutable attribute.


backupPolicies
[]BackupPolicy

backupPolicies is a list of backup policy template for the specified componentDefinition.


identifier
string
(Optional)

Identifier is a unique identifier for this BackupPolicyTemplate.
this identifier will be the suffix of the automatically generated backupPolicy name.
and must be added when multiple BackupPolicyTemplates exist,
otherwise the generated backupPolicy override will occur.


BackupPolicyTemplateStatus

(Appears on:BackupPolicyTemplate)

BackupPolicyTemplateStatus defines the observed state of BackupPolicyTemplate


BackupRefSpec

(Appears on:RestoreFromSpec)

FieldDescription
ref
RefNamespaceName
(Optional)

specify a reference backup to restore


BackupStatusUpdate

(Appears on:BasePolicy)

FieldDescription
path
string
(Optional)

specify the json path of backup object for patch.
example: manifests.backupLog – means patch the backup json path of status.manifests.backupLog.


containerName
string
(Optional)

which container name that kubectl can execute.


script
string
(Optional)

the shell Script commands to collect backup status metadata.
The script must exist in the container of ContainerName and the output format must be set to JSON.
Note that outputting to stderr may cause the result format to not be in JSON.


useTargetPodServiceAccount
bool
(Optional)

useTargetPodServiceAccount defines whether this job requires the service account of the backup target pod.
if true, will use the service account of the backup target pod. otherwise, will use the system service account.


updateStage
BackupStatusUpdateStage

when to update the backup status, pre: before backup, post: after backup


BackupStatusUpdateStage (string alias)

(Appears on:BackupStatusUpdate)

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.


BasePolicy

(Appears on:CommonBackupPolicy, SnapshotPolicy)

FieldDescription
target
TargetInstance
(Optional)

target instance for backup.


backupsHistoryLimit
int32
(Optional)

the number of automatic backups to retain. Value must be non-negative integer.
0 means NO limit on the number of backups.


onFailAttempted
int32
(Optional)

count of backup stop retries on fail.


backupStatusUpdates
[]BackupStatusUpdate
(Optional)

define how to update metadata for backup status.


CPUConstraint

(Appears on:ResourceConstraintRule)

FieldDescription
max
Kubernetes resource.Quantity
(Optional)

The maximum count of vcpu cores, [Min, Max] defines a range for valid vcpu cores, and the value in this range
must be multiple times of Step. It’s useful to define a large number of valid values without defining them one by
one. Please see the documentation for Step for some examples.
If Slots is specified, Max, Min, and Step are ignored


min
Kubernetes resource.Quantity
(Optional)

The minimum count of vcpu cores, [Min, Max] defines a range for valid vcpu cores, and the value in this range
must be multiple times of Step. It’s useful to define a large number of valid values without defining them one by
one. Please see the documentation for Step for some examples.
If Slots is specified, Max, Min, and Step are ignored


step
Kubernetes resource.Quantity
(Optional)

The minimum granularity of vcpu cores, [Min, Max] defines a range for valid vcpu cores and the value in this range must be
multiple times of Step.
For example:
1. Min is 2, Max is 8, Step is 2, and the valid vcpu core is {2, 4, 6, 8}.
2. Min is 0.5, Max is 2, Step is 0.5, and the valid vcpu core is {0.5, 1, 1.5, 2}.


slots
[]Kubernetes resource.Quantity
(Optional)

The valid vcpu cores, it’s useful if you want to define valid vcpu cores explicitly.
If Slots is specified, Max, Min, and Step are ignored


CfgFileFormat (string alias)

(Appears on:FormatterConfig)

CfgFileFormat defines formatter of configuration files.


ValueDescription

"dotenv"

"hcl"

"ini"

"json"

"properties"

"props-plus"

"redis"

"toml"

"xml"

"yaml"

CfgReloadType (string alias)

CfgReloadType defines reload method.


ValueDescription

"http"

"sql"

"exec"

"tpl"

"signal"

ClassDefRef

(Appears on:ClusterComponentSpec, LastComponentConfiguration, VerticalScaling)

FieldDescription
name
string
(Optional)

Name refers to the name of the ComponentClassDefinition.


class
string

Class refers to the name of the class that is defined in the ComponentClassDefinition.


ClusterBackup

(Appears on:ClusterSpec)

FieldDescription
enabled
bool
(Optional)

enabled defines whether to enable automated backup.


retentionPeriod
string
(Optional)

retentionPeriod is a time string ending with the ’d’|’D’|‘h’|‘H’ character to describe how long
the Backup should be retained. if not set, will be retained forever.


method
github.com/apecloud/kubeblocks/apis/dataprotection/v1alpha1.BackupMethod

backup method, support: snapshot, backupTool.


cronExpression
string
(Optional)

the cron expression for schedule, the timezone is in UTC. see https://en.wikipedia.org/wiki/Cron.


startingDeadlineMinutes
int64
(Optional)

startingDeadlineMinutes defines the deadline in minutes for starting the backup job
if it misses scheduled time for any reason.


repoName
string
(Optional)

repoName is the name of the backupRepo, if not set, will use the default backupRepo.


pitrEnabled
bool
(Optional)

pitrEnabled defines whether to enable point-in-time recovery.


ClusterComponentDefinition

(Appears on:ClusterDefinitionSpec)

ClusterComponentDefinition provides a workload component specification template,
with attributes that strongly work with stateful workloads and day-2 operations
behaviors.


FieldDescription
name
string

A component definition name, this name could be used as default name of Cluster.spec.componentSpecs.name,
and so this name is need to conform with same validation rules as Cluster.spec.componentSpecs.name, that
is currently comply with IANA Service Naming rule. This name will apply to “apps.kubeblocks.io/component-name”
object label value.


description
string
(Optional)

The description of component definition.


workloadType
WorkloadType

workloadType defines type of the workload.
Stateless is a stateless workload type used to describe stateless applications.
Stateful is a stateful workload type used to describe common stateful applications.
Consensus is a stateful workload type used to describe applications based on consensus protocols, common consensus protocols such as raft and paxos.
Replication is a stateful workload type used to describe applications based on the primary-secondary data replication protocol.


characterType
string
(Optional)

characterType defines well-known database component name, such as mongos(mongodb), proxy(redis), mariadb(mysql)
KubeBlocks will generate proper monitor configs for well-known characterType when builtIn is true.


configSpecs
[]ComponentConfigSpec
(Optional)

The configSpec field provided by provider, and
finally this configTemplateRefs will be rendered into the user’s own configuration file according to the user’s cluster.


scriptSpecs
[]ComponentTemplateSpec
(Optional)

The scriptSpec field provided by provider, and
finally this configTemplateRefs will be rendered into the user’s own configuration file according to the user’s cluster.


probes
ClusterDefinitionProbes
(Optional)

probes setting for healthy checks.


monitor
MonitorConfig
(Optional)

monitor is monitoring config which provided by provider.


logConfigs
[]LogConfig
(Optional)

logConfigs is detail log file config which provided by provider.


podSpec
Kubernetes core/v1.PodSpec
(Optional)

podSpec define pod spec template of the cluster component.


service
ServiceSpec
(Optional)

service defines the behavior of a service spec.
provide read-write service when WorkloadType is Consensus.


statelessSpec
StatelessSetSpec
(Optional)

statelessSpec defines stateless related spec if workloadType is Stateless.


statefulSpec
StatefulSetSpec
(Optional)

statefulSpec defines stateful related spec if workloadType is Stateful.


consensusSpec
ConsensusSetSpec
(Optional)

consensusSpec defines consensus related spec if workloadType is Consensus, required if workloadType is Consensus.


replicationSpec
ReplicationSetSpec
(Optional)

replicationSpec defines replication related spec if workloadType is Replication.


horizontalScalePolicy
HorizontalScalePolicy
(Optional)

horizontalScalePolicy controls the behavior of horizontal scale.


systemAccounts
SystemAccountSpec
(Optional)

Statement to create system account.


volumeTypes
[]VolumeTypeSpec
(Optional)

volumeTypes is 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:
name: data, type: data means that the volume named data is used to store data.
name: binlog, type: log means that the volume named binlog is used to store log.



NOTE:
When volumeTypes is not defined, the backup function will not be supported,
even if a persistent volume has been specified.


customLabelSpecs
[]CustomLabelSpec
(Optional)

customLabelSpecs is used for custom label tags which you want to add to the component resources.


switchoverSpec
SwitchoverSpec
(Optional)

switchoverSpec 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.


volumeProtectionSpec
VolumeProtectionSpec
(Optional)
componentDefRef
[]ComponentDefRef
(Optional)

componentDefRef is 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.


ClusterComponentPhase (string alias)

(Appears on:ClusterComponentStatus, OpsRequestComponentStatus)

ClusterComponentPhase defines the Cluster CR .status.components.phase


ValueDescription

"Abnormal"

"Creating"

"Failed"

"Running"

"Updating"

Abnormal is a sub-state of failed, where one or more workload pods is not in “Running” phase.


"Stopped"

ClusterComponentService

(Appears on:ClusterComponentSpec, Expose, LastComponentConfiguration)

FieldDescription
name
string

Service name


serviceType
Kubernetes core/v1.ServiceType
(Optional)

serviceType determines how the Service is exposed. Valid
options are ClusterIP, NodePort, and LoadBalancer.
“ClusterIP” allocates a cluster-internal IP address for load-balancing
to endpoints. Endpoints are determined by the selector or if that is not
specified, they are determined by manual construction of an Endpoints object or
EndpointSlice objects. If clusterIP is “None”, no virtual IP is
allocated and the endpoints are published as a set of endpoints rather
than a virtual IP.
“NodePort” builds on ClusterIP and allocates a port on every node which
routes to the same endpoints as the clusterIP.
“LoadBalancer” builds on NodePort and creates an external load-balancer
(if supported in the current cloud) which routes to the same endpoints
as the clusterIP.
More info: https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types.


annotations
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.


ClusterComponentSpec

(Appears on:ClusterSpec)

ClusterComponentSpec defines the cluster component spec.


FieldDescription
name
string

name defines cluster’s component name, this name is also part of Service DNS name, so this name will
comply with IANA Service Naming rule.


componentDefRef
string

componentDefRef references componentDef defined in ClusterDefinition spec. Need to
comply with IANA Service Naming rule.


classDefRef
ClassDefRef
(Optional)

classDefRef references the class defined in ComponentClassDefinition.


monitor
bool
(Optional)

monitor is a switch to enable monitoring and is set as false by default.
KubeBlocks provides an extension mechanism to support component level monitoring,
which will scrape metrics auto or manually from servers in component and export
metrics to Time Series Database.


enabledLogs
[]string
(Optional)

enabledLogs indicates which log file takes effect in the database cluster.
element is the log type which is defined in cluster definition logConfig.name,
and will set relative variables about this log type in database kernel.


replicas
int32

Component replicas. The default value is used in ClusterDefinition spec if not specified.


affinity
Affinity
(Optional)

affinity describes affinities specified by users.


tolerations
[]Kubernetes core/v1.Toleration
(Optional)

Component tolerations will override ClusterSpec.Tolerations if specified.


resources
Kubernetes core/v1.ResourceRequirements
(Optional)

Resources requests and limits of workload.


volumeClaimTemplates
[]ClusterComponentVolumeClaimTemplate
(Optional)

volumeClaimTemplates information for statefulset.spec.volumeClaimTemplates.


services
[]ClusterComponentService
(Optional)

Services expose endpoints that can be accessed by clients.


switchPolicy
ClusterSwitchPolicy
(Optional)

switchPolicy defines the strategy for switchover and failover when workloadType is Replication.


tls
bool
(Optional)

Enables or disables TLS certs.


issuer
Issuer
(Optional)

issuer defines provider context for TLS certs.
required when TLS enabled


serviceAccountName
string
(Optional)

serviceAccountName is the name of the ServiceAccount that running component depends on.


noCreatePDB
bool
(Optional)

noCreatePDB defines the PodDisruptionBudget creation behavior and is set to true if creation of PodDisruptionBudget
for this component is not needed. It defaults to false.


ClusterComponentStatus

(Appears on:ClusterStatus)

ClusterComponentStatus records components status.


FieldDescription
phase
ClusterComponentPhase

phase describes the phase of the component and the detail information of the phases are as following:
Running: the component is running. [terminal state]
Stopped: the component is stopped, as no running pod. [terminal state]
Failed: the component is unavailable, i.e. all pods are not ready for Stateless/Stateful component and
Leader/Primary pod is not ready for Consensus/Replication component. [terminal state]
Abnormal: the component is running but part of its pods are not ready.
Leader/Primary pod is ready for Consensus/Replication component. [terminal state]
Creating: the component has entered creating process.
Updating: the component has entered updating process, triggered by Spec. updated.


message
ComponentMessageMap
(Optional)

message records the component details message in current phase.
Keys are podName or deployName or statefulSetName. The format is ObjectKind/Name.


podsReady
bool
(Optional)

podsReady checks if all pods of the component are ready.


podsReadyTime
Kubernetes meta/v1.Time
(Optional)

podsReadyTime what time point of all component pods are ready,
this time is the ready time of the last component pod.


consensusSetStatus
ConsensusSetStatus
(Optional)

consensusSetStatus specifies the mapping of role and pod name.


replicationSetStatus
ReplicationSetStatus
(Optional)

replicationSetStatus specifies the mapping of role and pod name.


ClusterComponentVersion

(Appears on:ClusterVersionSpec)

ClusterComponentVersion is an application version component spec.


FieldDescription
componentDefRef
string

componentDefRef reference one of the cluster component definition names in ClusterDefinition API (spec.componentDefs.name).


configSpecs
[]ComponentConfigSpec
(Optional)

configSpecs defines a configuration extension mechanism to handle configuration differences between versions,
the configTemplateRefs field, together with configTemplateRefs in the ClusterDefinition,
determines the final configuration file.


systemAccountSpec
SystemAccountShortSpec
(Optional)

systemAccountSpec define image for the component to connect database or engines.
It overrides image and env attributes defined in ClusterDefinition.spec.componentDefs.systemAccountSpec.cmdExecutorConfig.
To clean default envs settings, set SystemAccountSpec.CmdExecutorConfig.Env to empty list.


versionsContext
VersionsContext

versionContext defines containers images’ context for component versions,
this value replaces ClusterDefinition.spec.componentDefs.podSpec.[initContainers | containers]


switchoverSpec
SwitchoverShortSpec
(Optional)

switchoverSpec defines images for the component to do switchover.
It overrides image and env attributes defined in ClusterDefinition.spec.componentDefs.SwitchoverSpec.CommandExecutorEnvItem.


ClusterComponentVolumeClaimTemplate

(Appears on:ClusterComponentSpec)

FieldDescription
name
string

Reference ClusterDefinition.spec.componentDefs.containers.volumeMounts.name.


spec
PersistentVolumeClaimSpec
(Optional)

spec defines the desired characteristics of a volume requested by a pod author.




accessModes
[]Kubernetes core/v1.PersistentVolumeAccessMode
(Optional)

accessModes contains the desired access modes the volume should have.
More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1.


resources
Kubernetes core/v1.ResourceRequirements
(Optional)

resources represents the minimum resources the volume should have.
If RecoverVolumeExpansionFailure feature is enabled users are allowed to specify resource requirements
that are lower than previous value but must still be higher than capacity recorded in the
status field of the claim.
More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources.


storageClassName
string
(Optional)

storageClassName is the name of the StorageClass required by the claim.
More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1.


ClusterDefinitionProbe

(Appears on:ClusterDefinitionProbes)

FieldDescription
periodSeconds
int32

How often (in seconds) to perform the probe.


timeoutSeconds
int32

Number of seconds after which the probe times out. Defaults to 1 second.


failureThreshold
int32

Minimum consecutive failures for the probe to be considered failed after having succeeded.


commands
ClusterDefinitionProbeCMDs
(Optional)

commands used to execute for probe.


ClusterDefinitionProbeCMDs

(Appears on:ClusterDefinitionProbe)

FieldDescription
writes
[]string
(Optional)

Write check executed on probe sidecar, used to check workload’s allow write access.


queries
[]string
(Optional)

Read check executed on probe sidecar, used to check workload’s readonly access.


ClusterDefinitionProbes

(Appears on:ClusterComponentDefinition)

FieldDescription
runningProbe
ClusterDefinitionProbe
(Optional)

Probe for DB running check.


statusProbe
ClusterDefinitionProbe
(Optional)

Probe for DB status check.


roleProbe
ClusterDefinitionProbe
(Optional)

Probe for DB role changed check.


roleProbeTimeoutAfterPodsReady
int32
(Optional)

roleProbeTimeoutAfterPodsReady(in seconds), when all pods of the component are ready,
it will detect whether 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


FieldDescription
type
string
(Optional)

Cluster definition type defines well known application cluster type, e.g. mysql/redis/mongodb


componentDefs
[]ClusterComponentDefinition

componentDefs provides cluster components definitions.


connectionCredential
map[string]string
(Optional)

Connection credential template used for creating a connection credential
secret for cluster.apps.kubeblocks.io object.



Built-in objects are:
- $(RANDOM_PASSWD) - random 8 characters.
- $(UUID) - generate a random UUID v4 string.
- $(UUID_B64) - generate a random UUID v4 BASE64 encoded string.
- $(UUID_STR_B64) - generate a random UUID v4 string then BASE64 encoded.
- $(UUID_HEX) - generate a random UUID v4 HEX representation.
- $(HEADLESS_SVC_FQDN) - headless service FQDN placeholder, value pattern - $(CLUSTER_NAME)-$(1ST_COMP_NAME)-headless.$(NAMESPACE).svc,
where 1ST_COMP_NAME is the 1st component that provide ClusterDefinition.spec.componentDefs[].service attribute;
- $(SVC_FQDN) - service FQDN placeholder, value pattern - $(CLUSTER_NAME)-$(1ST_COMP_NAME).$(NAMESPACE).svc,
where 1ST_COMP_NAME is the 1st component that provide ClusterDefinition.spec.componentDefs[].service attribute;
- $(SVC_PORT_{PORT-NAME}) - a ServicePort’s port value with specified port name, i.e, a servicePort JSON struct:
{"name": "mysql", "targetPort": "mysqlContainerPort", "port": 3306}, and “$(SVC_PORT_mysql)” in the
connection credential value is 3306.


ClusterDefinitionStatus

(Appears on:ClusterDefinition)

ClusterDefinitionStatus defines the observed state of ClusterDefinition


FieldDescription
phase
Phase

ClusterDefinition phase, valid values are empty, Available, ‘Unavailable`.
Available is ClusterDefinition become available, and can be referenced for co-related objects.


message
string
(Optional)

Extra message in current phase


observedGeneration
int64
(Optional)

observedGeneration is the most recent generation observed for this
ClusterDefinition. It corresponds to the ClusterDefinition’s generation, which is
updated on mutation by the API Server.


ClusterMonitor

(Appears on:ClusterSpec)

FieldDescription
monitoringInterval
Kubernetes api utils intstr.IntOrString
(Optional)

monitoringInterval specifies interval of monitoring, no monitor if set to 0


ClusterNetwork

(Appears on:ClusterSpec)

FieldDescription
hostNetworkAccessible
bool
(Optional)

hostNetworkAccessible specifies whether host network is accessible. It defaults to false


publiclyAccessible
bool
(Optional)

publiclyAccessible specifies whether it is publicly accessible. It defaults to false


ClusterPhase (string alias)

(Appears on:ClusterStatus, OpsRequestBehaviour)

ClusterPhase defines the Cluster CR .status.phase


ValueDescription

"Abnormal"

"Creating"

Abnormal is a sub-state of failed, where one of the cluster components has “Failed” or “Abnormal” status phase.


"Failed"

"Running"

REVIEW/TODO: AbnormalClusterPhase provides hybrid, consider remove it if possible


"Updating"

"Stopped"

ClusterResourceConstraintSelector

(Appears on:ComponentResourceConstraintSpec)

FieldDescription
clusterDefRef
string

clusterDefRef is the name of the cluster definition.


components
[]ComponentResourceConstraintSelector

selector is used to bind the resource constraint to components.


ClusterResources

(Appears on:ClusterSpec)

FieldDescription
cpu
Kubernetes resource.Quantity
(Optional)

cpu resource needed, more info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/


memory
Kubernetes resource.Quantity
(Optional)

memory resource needed, more info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/


ClusterSpec

(Appears on:Cluster)

ClusterSpec defines the desired state of Cluster.


FieldDescription
clusterDefinitionRef
string

Cluster referencing ClusterDefinition name. This is an immutable attribute.


clusterVersionRef
string
(Optional)

Cluster referencing ClusterVersion name.


terminationPolicy
TerminationPolicyType

Cluster termination policy. Valid values are DoNotTerminate, Halt, Delete, WipeOut.
DoNotTerminate will block delete operation.
Halt will delete workload resources such as statefulset, deployment workloads but keep PVCs.
Delete is based on Halt and deletes PVCs.
WipeOut is based on Delete and wipe out all volume snapshots and snapshot data from backup storage location.


componentSpecs
[]ClusterComponentSpec

List of componentSpecs you want to replace in ClusterDefinition and ClusterVersion. It will replace the field in ClusterDefinition’s and ClusterVersion’s component if type is matching.


tenancy
TenancyType
(Optional)

tenancy describes how pods are distributed across node.
SharedNode means multiple pods may share the same node.
DedicatedNode means each pod runs on their own dedicated node.


availabilityPolicy
AvailabilityPolicyType
(Optional)

availabilityPolicy describes the availability policy, including zone, node, and none.


affinity
Affinity
(Optional)

affinity is a group of affinity scheduling rules.


tolerations
[]Kubernetes core/v1.Toleration
(Optional)

tolerations are attached to tolerate any taint that matches the triple key,value,effect using the matching operator operator.


replicas
int32
(Optional)

replicas specifies the replicas of the first componentSpec, if the replicas of the first componentSpec is specified, this value will be ignored.


resources
ClusterResources
(Optional)

resources specifies the resources of the first componentSpec, if the resources of the first componentSpec is specified, this value will be ignored.


storage
ClusterStorage
(Optional)

storage specifies the storage of the first componentSpec, if the storage of the first componentSpec is specified, this value will be ignored.


monitor
ClusterMonitor
(Optional)

monitor specifies the configuration of monitor


network
ClusterNetwork
(Optional)

network specifies the configuration of network


backup
ClusterBackup
(Optional)

cluster backup configuration.


ClusterStatus

(Appears on:Cluster)

ClusterStatus defines the observed state of Cluster.


FieldDescription
observedGeneration
int64
(Optional)

observedGeneration is the most recent generation observed for this
Cluster. It corresponds to the Cluster’s generation, which is
updated on mutation by the API Server.


phase
ClusterPhase
(Optional)

phase describes the phase of the Cluster, the detail information of the phases are as following:
Running: cluster is running, all its components are available. [terminal state]
Stopped: cluster has stopped, all its components are stopped. [terminal state]
Failed: cluster is unavailable. [terminal state]
Abnormal: Cluster is still running, but part of its components are Abnormal/Failed. [terminal state]
Creating: Cluster has entered creating process.
Updating: Cluster has entered updating process, triggered by Spec. updated.


message
string
(Optional)

message describes cluster details message in current phase.


components
map[string]github.com/apecloud/kubeblocks/apis/apps/v1alpha1.ClusterComponentStatus
(Optional)

components record the current status information of all components of the cluster.


clusterDefGeneration
int64
(Optional)

clusterDefGeneration represents the generation number of ClusterDefinition referenced.


conditions
[]Kubernetes meta/v1.Condition
(Optional)

Describe current state of cluster API Resource, like warning.


ClusterStorage

(Appears on:ClusterSpec)

FieldDescription
size
Kubernetes resource.Quantity
(Optional)

storage size needed, more info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/


ClusterSwitchPolicy

(Appears on:ClusterComponentSpec)

FieldDescription
type
SwitchPolicyType
(Optional)

clusterSwitchPolicy defines type of the switchPolicy when workloadType is Replication.
MaximumAvailability: [WIP] when the primary is active, do switch if the synchronization delay = 0 in the user-defined lagProbe data delay detection logic, otherwise do not switch. The primary is down, switch immediately. It will be available in future versions.
MaximumDataProtection: [WIP] when the primary is active, do switch if synchronization delay = 0 in the user-defined lagProbe data lag detection logic, otherwise do not switch. If the primary is down, if it can be judged that the primary and secondary data are consistent, then do the switch, otherwise do not switch. It will be available in future versions.
Noop: KubeBlocks will not perform high-availability switching on components. Users need to implement HA by themselves or integrate open source HA solution.


ClusterVersionSpec

(Appears on:ClusterVersion)

ClusterVersionSpec defines the desired state of ClusterVersion


FieldDescription
clusterDefinitionRef
string

ref ClusterDefinition.


componentVersions
[]ClusterComponentVersion

List of components’ containers versioning context, i.e., container image ID, container commands, args., and environments.


ClusterVersionStatus

(Appears on:ClusterVersion)

ClusterVersionStatus defines the observed state of ClusterVersion


FieldDescription
phase
Phase
(Optional)

phase - in list of [Available,Unavailable]


message
string
(Optional)

A human readable message indicating details about why the ClusterVersion is in this phase.


observedGeneration
int64
(Optional)

generation number


clusterDefGeneration
int64
(Optional)

clusterDefGeneration represents the generation number of ClusterDefinition referenced.


CmdExecutorConfig

(Appears on:SwitchoverAction, SystemAccountSpec)

CmdExecutorConfig specifies how to perform creation and deletion statements.


FieldDescription
CommandExecutorEnvItem
CommandExecutorEnvItem

(Members of CommandExecutorEnvItem are embedded into this type.)

CommandExecutorItem
CommandExecutorItem

(Members of CommandExecutorItem are embedded into this type.)

CommandExecutorEnvItem

(Appears on:CmdExecutorConfig, SwitchoverShortSpec, SystemAccountShortSpec)

FieldDescription
image
string

image for Connector when executing the command.


env
[]Kubernetes core/v1.EnvVar
(Optional)

envs is a list of environment variables.


CommandExecutorItem

(Appears on:CmdExecutorConfig)

FieldDescription
command
[]string

command to perform statements.


args
[]string
(Optional)

args is used to perform statements.


CommonBackupPolicy

(Appears on:BackupPolicy)

FieldDescription
BasePolicy
BasePolicy

(Members of BasePolicy are embedded into this type.)

backupToolName
string

which backup tool to perform database backup, only support one tool.


ComponentClass

(Appears on:ComponentClassDefinitionStatus, ComponentClassSeries)

FieldDescription
name
string
(Optional)

name is the class name


args
[]string
(Optional)

args are variable’s value


cpu
Kubernetes resource.Quantity
(Optional)

the CPU of the class


memory
Kubernetes resource.Quantity
(Optional)

the memory of the class


ComponentClassDefinitionSpec

(Appears on:ComponentClassDefinition)

ComponentClassDefinitionSpec defines the desired state of ComponentClassDefinition


FieldDescription
groups
[]ComponentClassGroup
(Optional)

group defines a list of class series that conform to the same constraint.


ComponentClassDefinitionStatus

(Appears on:ComponentClassDefinition)

ComponentClassDefinitionStatus defines the observed state of ComponentClassDefinition


FieldDescription
observedGeneration
int64
(Optional)

observedGeneration is the most recent generation observed for this
ComponentClassDefinition. It corresponds to the ComponentClassDefinition’s generation, which is
updated on mutation by the API Server.


classes
[]ComponentClass

classes is the list of classes that have been observed for this ComponentClassDefinition


ComponentClassGroup

(Appears on:ComponentClassDefinitionSpec)

FieldDescription
template
string
(Optional)

template is a class definition template that uses the Go template syntax and allows for variable declaration.
When defining a class in Series, specifying the variable’s value is sufficient, as the complete class
definition will be generated through rendering the template.



For example:
template: |
cpu: “{{ or .cpu 1 }}”
memory: “{{ or .memory 4 }}Gi”


vars
[]string
(Optional)

vars defines the variables declared in the template and will be used to generating the complete class definition by
render the template.


series
[]ComponentClassSeries
(Optional)

series is a series of class definitions.


ComponentClassSeries

(Appears on:ComponentClassGroup)

FieldDescription
namingTemplate
string
(Optional)

namingTemplate is a template that uses the Go template syntax and allows for referencing variables defined
in ComponentClassGroup.Template. This enables dynamic generation of class names.
For example:
name: “general-{{ .cpu }}c{{ .memory }}g”


classes
[]ComponentClass
(Optional)

classes are definitions of classes that come in two forms. In the first form, only ComponentClass.Args
need to be defined, and the complete class definition is generated by rendering the ComponentClassGroup.Template
and Name. In the second form, the Name, CPU and Memory must be defined.


ComponentConfigSpec

(Appears on:ClusterComponentDefinition, ClusterComponentVersion)

FieldDescription
ComponentTemplateSpec
ComponentTemplateSpec

(Members of ComponentTemplateSpec are embedded into this type.)

keys
[]string
(Optional)

Specify a list of keys.
If empty, ConfigConstraint takes effect for all keys in configmap.


lazyRenderedConfigSpec
LazyRenderedTemplateSpec
(Optional)

lazyRenderedConfigSpec is optional: specify the secondary rendered config spec.


constraintRef
string
(Optional)

Specify the name of the referenced the configuration constraints object.


asEnvFrom
[]string
(Optional)

asEnvFrom is optional: the list of containers will be injected into EnvFrom.


ComponentDefRef

(Appears on:ClusterComponentDefinition)

ComponentDefRef is used to select the component and its fields to be referenced.


FieldDescription
componentDefName
string

componentDefName is the name of the componentDef to select.


failurePolicy
FailurePolicyType
(Optional)

failurePolicy is the failure policy of the component.
If failed to find the component, the failure policy will be used.


componentRefEnv
[]ComponentRefEnv
(Optional)

componentRefEnv specifies a list of values to be injected as env variables to each component.


ComponentMessageMap (map[string]string alias)

(Appears on:ClusterComponentStatus)

ComponentNameSet (map[string]struct alias)

ComponentOps

(Appears on:Expose, HorizontalScaling, OpsRequestSpec, Reconfigure, ScriptSpec, Switchover, VerticalScaling, VolumeExpansion)

ComponentOps defines the common variables of component scope operations.


FieldDescription
componentName
string

componentName cluster component name.


ComponentRefEnv

(Appears on:ComponentDefRef)

ComponentRefEnv specifies name and value of an env.


FieldDescription
name
string

name is the name of the env to be injected, and it must be a C identifier.


value
string
(Optional)

value is the value of the env to be injected.


valueFrom
ComponentValueFrom
(Optional)

valueFrom specifies the source of the env to be injected.


ComponentResourceConstraintSelector

(Appears on:ClusterResourceConstraintSelector)

FieldDescription
componentDefRef
string

componentDefRef is the name of the component definition in the cluster definition.


rules
[]string

rules are the constraint rules that will be applied to the component.


ComponentResourceConstraintSpec

(Appears on:ComponentResourceConstraint)

ComponentResourceConstraintSpec defines the desired state of ComponentResourceConstraint


FieldDescription
rules
[]ResourceConstraintRule

Component resource constraint rules.


selector
[]ClusterResourceConstraintSelector
(Optional)

selector is used to bind the resource constraint to cluster definitions.


ComponentResourceKey (string alias)

ComponentResourceKey defines the resource key of component, such as pod/pvc.


ValueDescription

"pods"

ComponentTemplateSpec

(Appears on:ClusterComponentDefinition, ComponentConfigSpec)

FieldDescription
name
string

Specify the name of configuration template.


templateRef
string

Specify the name of the referenced the configuration template ConfigMap object.


namespace
string
(Optional)

Specify the namespace of the referenced the configuration template ConfigMap object.
An empty namespace is equivalent to the “default” namespace.


volumeName
string

volumeName is the volume name of PodTemplate, which 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.


defaultMode
int32
(Optional)

defaultMode is optional: mode bits used to set permissions on created files by default.
Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511.
YAML accepts both octal and decimal values, JSON requires decimal values for mode bits.
Defaults to 0644.
Directories within the path are not affected by this setting.
This might be in conflict with other options that affect the file
mode, like fsGroup, and the result can be other mode bits set.


ComponentValueFrom

(Appears on:ComponentRefEnv)

FieldDescription
type
ComponentValueFromType

type is the type of the source to select. There are three types: FieldRef, ServiceRef, HeadlessServiceRef.


fieldPath
string
(Optional)

fieldRef is the jsonpath of the source to select when type is FieldRef.
there are two objects registered in the jsonpath: componentDef and components.
componentDef is the component definition object specified in componentRef.componentDefName.
components is the component list objects referring to the component definition object.


format
string
(Optional)

format is the format of each headless service address.
there are three builtin variables can be used as placerholder: $POD_ORDINAL, $POD_FQDN, $POD_NAME
$POD_ORDINAL is the ordinal of the pod.
$POD_FQDN is the fully qualified domain name of the pod.
$POD_NAME is the name of the pod


joinWith
string
(Optional)

joinWith is the string to join the values of headless service addresses.


ComponentValueFromType (string alias)

(Appears on:ComponentValueFrom)

ComponentValueFromType specifies the type of component value from.


ValueDescription

"FieldRef"

"HeadlessServiceRef"

"ServiceRef"

ConfigConstraintPhase (string alias)

(Appears on:ConfigConstraintStatus)

ConfigConstraintPhase defines the ConfigConstraint CR .status.phase


ValueDescription

"Available"

"Deleting"

"Unavailable"

ConfigConstraintSpec

(Appears on:ConfigConstraint)

ConfigConstraintSpec defines the desired state of ConfigConstraint


FieldDescription
reloadOptions
ReloadOptions
(Optional)

reloadOptions indicates whether the process supports reload.
if set, the controller will determine the behavior of the engine instance based on the configuration templates,
restart or reload depending on whether any parameters in the StaticParameters have been modified.


toolsImageSpec
ToolsImageSpec
(Optional)

toolConfig used to config init container.


downwardAPIOptions
[]DownwardAPIOption
(Optional)

downwardAPIOptions is used to watch pod fields.


scriptConfigs
[]ScriptConfig
(Optional)

scriptConfigs, list of ScriptConfig, witch these scripts can be used by volume trigger,downward trigger, or tool image


cfgSchemaTopLevelName
string
(Optional)

cfgSchemaTopLevelName is cue type name, which generates openapi schema.


configurationSchema
CustomParametersValidation
(Optional)

configurationSchema imposes restrictions on database parameter’s rule.


staticParameters
[]string
(Optional)

staticParameters, list of StaticParameter, modifications of them trigger a process restart.


dynamicParameters
[]string
(Optional)

dynamicParameters, list of DynamicParameter, modifications of them trigger a config dynamic reload without process restart.


immutableParameters
[]string
(Optional)

immutableParameters describes parameters that prohibit user from modification.


selector
Kubernetes meta/v1.LabelSelector

selector is used to match the label on the pod,
for example, a pod of the primary is match on the patroni cluster.


formatterConfig
FormatterConfig

formatterConfig describes the format of the configuration file, the controller
1. parses configuration file
2. analyzes the modified parameters
3. applies corresponding policies.


ConfigConstraintStatus

(Appears on:ConfigConstraint)

ConfigConstraintStatus defines the observed state of ConfigConstraint.


FieldDescription
phase
ConfigConstraintPhase
(Optional)

phase is status of configuration template, when set to CCAvailablePhase, it can be referenced by ClusterDefinition or ClusterVersion.


message
string
(Optional)

message field describes the reasons of abnormal status.


observedGeneration
int64
(Optional)

observedGeneration is the latest generation observed for this
ClusterDefinition. It refers to the ConfigConstraint’s generation, which is
updated by the API Server.


Configuration

(Appears on:Reconfigure)

FieldDescription
name
string

name is a config template name.


policy
UpgradePolicy
(Optional)

policy defines the upgrade policy.


keys
[]ParameterConfig

keys is used to set the parameters to be updated.


ConfigurationStatus

(Appears on:ReconfiguringStatus)

FieldDescription
name
string

name is a config template name.


updatePolicy
UpgradePolicy
(Optional)

updatePolicy describes the policy of reconfiguring.


status
string
(Optional)

status describes the current state of the reconfiguring state machine.


succeedCount
int32
(Optional)

succeedCount describes the number of successful reconfiguring.


expectedCount
int32
(Optional)

expectedCount describes the number of expected reconfiguring.


lastStatus
string
(Optional)

lastStatus describes the last status for the reconfiguring controller.


lastAppliedConfiguration
map[string]string
(Optional)

LastAppliedConfiguration describes the last configuration.


updatedParameters
UpdatedParameters
(Optional)

updatedParameters describes the updated parameters.


ConnectionCredentialKey

(Appears on:TargetInstance)

FieldDescription
passwordKey
string
(Optional)

the key of password in the ConnectionCredential secret.
if not set, the default key is “password”.


usernameKey
string
(Optional)

the key of username in the ConnectionCredential secret.
if not set, the default key is “username”.


ConsensusMember

(Appears on:ConsensusSetSpec)

FieldDescription
name
string

name, role name.


accessMode
AccessMode

accessMode, what service this member capable.


replicas
int32
(Optional)

replicas, number of Pods of this role.
default 1 for Leader
default 0 for Learner
default Cluster.spec.componentSpec[*].Replicas - Leader.Replicas - Learner.Replicas for Followers


ConsensusMemberStatus

(Appears on:ConsensusSetStatus)

FieldDescription
name
string

Defines the role name.


accessMode
AccessMode

accessMode defines what service this pod provides.


pod
string

Pod name.


ConsensusSetSpec

(Appears on:ClusterComponentDefinition)

FieldDescription
StatefulSetSpec
StatefulSetSpec

(Members of StatefulSetSpec are embedded into this type.)

leader
ConsensusMember

leader, one single leader.


followers
[]ConsensusMember
(Optional)

followers, has voting right but not Leader.


learner
ConsensusMember
(Optional)

learner, no voting right.


ConsensusSetStatus

(Appears on:ClusterComponentStatus)

FieldDescription
leader
ConsensusMemberStatus

Leader status.


followers
[]ConsensusMemberStatus
(Optional)

Followers status.


learner
ConsensusMemberStatus
(Optional)

Learner status.


CustomLabelSpec

(Appears on:ClusterComponentDefinition)

FieldDescription
key
string

key name of label


value
string

value of label


resources
[]GVKResource

resources defines the resources to be labeled.


CustomParametersValidation

(Appears on:ConfigConstraintSpec)

FieldDescription
schema
Kubernetes api extensions v1.JSONSchemaProps

schema provides a way for providers to validate the changed parameters through json.


cue
string
(Optional)

cue that to let provider verify user configuration through cue language.


DownwardAPIOption

(Appears on:ConfigConstraintSpec)

FieldDescription
name
string

Specify the name of the field.


mountPoint
string

mountPoint is the mount point of the scripts file.


items
[]Kubernetes core/v1.DownwardAPIVolumeFile

Items is a list of downward API volume file


command
[]string
(Optional)

command used to execute for downwrad api.


ExporterConfig

(Appears on:MonitorConfig)

FieldDescription
scrapePort
Kubernetes api utils intstr.IntOrString

scrapePort is exporter port for Time Series Database to scrape metrics.


scrapePath
string
(Optional)

scrapePath is exporter url path for Time Series Database to scrape metrics.


Expose

(Appears on:OpsRequestSpec)

FieldDescription
ComponentOps
ComponentOps

(Members of ComponentOps are embedded into this type.)

services
[]ClusterComponentService

Setting the list of services to be exposed.


FailurePolicyType (string alias)

(Appears on:ComponentDefRef)

FailurePolicyType specifies the type of failure policy


ValueDescription

"Fail"

ReportError means that an error will be reported.


"Ignore"

Ignore means that an error will be ignored but logged.


FormatterConfig

(Appears on:ConfigConstraintSpec)

FieldDescription
FormatterOptions
FormatterOptions

(Members of FormatterOptions are embedded into this type.)

(Optional)

The FormatterOptions represents the special options of configuration file.
This is optional for now. If not specified.


format
CfgFileFormat

The configuration file format. Valid values are ini, xml, yaml, json,
hcl, dotenv, properties and toml.



ini: a configuration file that consists of a text-based content with a structure and syntax comprising key–value pairs for properties, reference wiki: https://en.wikipedia.org/wiki/INI_file
xml: reference wiki: https://en.wikipedia.org/wiki/XML
yaml: a configuration file support for complex data types and structures.
json: reference wiki: https://en.wikipedia.org/wiki/JSON
hcl: : The HashiCorp Configuration Language (HCL) is a configuration language authored by HashiCorp, reference url: https://www.linode.com/docs/guides/introduction-to-hcl/
dotenv: this was a plain text file with simple key–value pairs, reference wiki: https://en.wikipedia.org/wiki/Configuration_file#MS-DOS
properties: a file extension mainly used in Java, reference wiki: https://en.wikipedia.org/wiki/.properties
toml: reference wiki: https://en.wikipedia.org/wiki/TOML
props-plus: a file extension mainly used in Java, support CamelCase(e.g: brokerMaxConnectionsPerIp)


FormatterOptions

(Appears on:FormatterConfig)

FormatterOptions represents the special options of configuration file.
Only one of its members may be specified.


FieldDescription
iniConfig
IniConfig
(Optional)

iniConfig represents the ini options.


GVKResource

(Appears on:CustomLabelSpec)

FieldDescription
gvk
string

gvk is Group/Version/Kind, for example “v1/Pod”, “apps/v1/StatefulSet”, etc.
when the gvk resource filtered by the selector already exists, if there is no corresponding custom label, it will be added, and if label already exists, it will be updated.


selector
map[string]string
(Optional)

selector is a label query over a set of resources.


HScaleDataClonePolicyType (string alias)

(Appears on:HorizontalScalePolicy)

HScaleDataClonePolicyType defines data clone policy when horizontal scaling.


ValueDescription

"CloneVolume"

"Snapshot"

"None"

HorizontalScalePolicy

(Appears on:ClusterComponentDefinition)

FieldDescription
type
HScaleDataClonePolicyType
(Optional)

type controls what kind of data synchronization do when component scale out.
Policy is in enum of {None, CloneVolume}. The default policy is None.
None: Default policy, create empty volume and no data clone.
CloneVolume: Do data clone to newly scaled pods. Prefer to use volume snapshot first,
and will try backup tool if volume snapshot is not enabled, finally
report error if both above cannot work.
Snapshot: Deprecated, alias for CloneVolume.


backupPolicyTemplateName
string
(Optional)

BackupPolicyTemplateName reference the backup policy template.


volumeMountsName
string
(Optional)

volumeMountsName defines which volumeMount of the container to do backup,
only work if Type is not None
if not specified, the 1st volumeMount will be chosen


HorizontalScaling

(Appears on:OpsRequestSpec)

HorizontalScaling defines the variables of horizontal scaling operation


FieldDescription
ComponentOps
ComponentOps

(Members of ComponentOps are embedded into this type.)

replicas
int32

replicas for the workloads.


IniConfig

(Appears on:FormatterOptions)

FieldDescription
sectionName
string
(Optional)

sectionName describes ini section.


Issuer

(Appears on:ClusterComponentSpec)

Issuer defines Tls certs issuer


FieldDescription
name
IssuerName

Name of issuer.
Options supported:
- KubeBlocks - Certificates signed by KubeBlocks Operator.
- UserProvided - User provided own CA-signed certificates.


secretRef
TLSSecretRef
(Optional)

secretRef. TLS certs Secret reference
required when from is UserProvided


IssuerName (string alias)

(Appears on:Issuer)

IssuerName defines Tls certs issuer name


ValueDescription

"KubeBlocks"

IssuerKubeBlocks Certificates signed by KubeBlocks Operator.


"UserProvided"

IssuerUserProvided User provided own CA-signed certificates.


KBAccountType (byte alias)

KBAccountType is used for bitwise operation.


ValueDescription

0

LastComponentConfiguration

(Appears on:LastConfiguration)

FieldDescription
replicas
int32
(Optional)

replicas are the last replicas of the component.


ResourceRequirements
Kubernetes core/v1.ResourceRequirements

(Members of ResourceRequirements are embedded into this type.)

(Optional)

the last resources of the component.


classDefRef
ClassDefRef
(Optional)

classDefRef reference class defined in ComponentClassDefinition.


volumeClaimTemplates
[]OpsRequestVolumeClaimTemplate
(Optional)

volumeClaimTemplates records the last volumeClaimTemplates of the component.


services
[]ClusterComponentService
(Optional)

services records the last services of the component.


targetResources
map[github.com/apecloud/kubeblocks/apis/apps/v1alpha1.ComponentResourceKey][]string
(Optional)

targetResources records the affecting target resources information for the component.
resource key is in list of [pods].


LastConfiguration

(Appears on:OpsRequestStatus)

FieldDescription
clusterVersionRef
string
(Optional)

clusterVersionRef references ClusterVersion name.


components
map[string]github.com/apecloud/kubeblocks/apis/apps/v1alpha1.LastComponentConfiguration
(Optional)

components records last configuration of the component.


LazyRenderedTemplateSpec

(Appears on:ComponentConfigSpec)

FieldDescription
templateRef
string

Specify the name of the referenced the configuration template ConfigMap object.


namespace
string
(Optional)

Specify the namespace of the referenced the configuration template ConfigMap object.
An empty namespace is equivalent to the “default” namespace.


policy
MergedPolicy
(Optional)

policy defines how to merge external imported templates into component templates.


LetterCase (string alias)

(Appears on:PasswordConfig)

LetterCase defines cases to use in password generation.


ValueDescription

"LowerCases"

"MixedCases"

"UpperCases"

LogConfig

(Appears on:ClusterComponentDefinition)

FieldDescription
name
string

name log type name, such as slow for MySQL slow log file.


filePathPattern
string

filePathPattern log file path pattern which indicate how to find this file
corresponding to variable (log path) in database kernel. please don’t set this casually.


MemoryConstraint

(Appears on:ResourceConstraintRule)

FieldDescription
sizePerCPU
Kubernetes resource.Quantity
(Optional)

The size of memory per vcpu core.
For example: 1Gi, 200Mi.
If SizePerCPU is specified, MinPerCPU and MaxPerCPU are ignore.


maxPerCPU
Kubernetes resource.Quantity
(Optional)

The maximum size of memory per vcpu core, [MinPerCPU, MaxPerCPU] defines a range for valid memory size per vcpu core.
It is useful on GCP as the ratio between the CPU and memory may be a range.
If SizePerCPU is specified, MinPerCPU and MaxPerCPU are ignored.
Reference: https://cloud.google.com/compute/docs/general-purpose-machines#custom_machine_types


minPerCPU
Kubernetes resource.Quantity
(Optional)

The minimum size of memory per vcpu core, [MinPerCPU, MaxPerCPU] defines a range for valid memory size per vcpu core.
It is useful on GCP as the ratio between the CPU and memory may be a range.
If SizePerCPU is specified, MinPerCPU and MaxPerCPU are ignored.
Reference: https://cloud.google.com/compute/docs/general-purpose-machines#custom_machine_types


MergedPolicy (string alias)

(Appears on:LazyRenderedTemplateSpec)

MergedPolicy defines how to merge external imported templates into component templates.


ValueDescription

"none"

"add"

"patch"

"replace"

MonitorConfig

(Appears on:ClusterComponentDefinition)

FieldDescription
builtIn
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
ExporterConfig
(Optional)

exporterConfig provided by provider, which specify necessary information to Time Series Database.
exporterConfig is valid when builtIn is false.


OpsPhase (string alias)

(Appears on:OpsRequestStatus)

OpsPhase defines opsRequest phase.


ValueDescription

"Cancelled"

"Cancelling"

"Creating"

"Failed"

"Pending"

"Running"

"Succeed"

OpsRecorder

FieldDescription
name
string

name OpsRequest name


type
OpsType

clusterPhase the cluster phase when the OpsRequest is running


OpsRequestBehaviour

FieldDescription
FromClusterPhases
[]ClusterPhase
ToClusterPhase
ClusterPhase
ProcessingReasonInClusterCondition
string

OpsRequestComponentStatus

(Appears on:OpsRequestStatus)

FieldDescription
phase
ClusterComponentPhase
(Optional)

phase describes the component phase, reference Cluster.status.component.phase.


lastFailedTime
Kubernetes meta/v1.Time
(Optional)

lastFailedTime is the last time the component phase transitioned to Failed or Abnormal.


progressDetails
[]ProgressStatusDetail
(Optional)

progressDetails describes the progress details of the component for this operation.


workloadType
WorkloadType
(Optional)

workloadType references workload type of component in ClusterDefinition.


reason
string
(Optional)

reason describes the reason for the component phase.


message
string
(Optional)

message is a human-readable message indicating details about this operation.


OpsRequestSpec

(Appears on:OpsRequest)

OpsRequestSpec defines the desired state of OpsRequest


FieldDescription
clusterRef
string

clusterRef references clusterDefinition.


cancel
bool
(Optional)

cancel defines the action to cancel the Pending/Creating/Running opsRequest, supported types: [VerticalScaling, HorizontalScaling].
once cancel is set to true, this opsRequest will be canceled and modifying this property again will not take effect.


type
OpsType

type defines the operation type.


ttlSecondsAfterSucceed
int32
(Optional)

ttlSecondsAfterSucceed OpsRequest will be deleted after TTLSecondsAfterSucceed second when OpsRequest.status.phase is Succeed.


upgrade
Upgrade
(Optional)

upgrade specifies the cluster version by specifying clusterVersionRef.


horizontalScaling
[]HorizontalScaling
(Optional)

horizontalScaling defines what component need to horizontal scale the specified replicas.


volumeExpansion
[]VolumeExpansion
(Optional)

volumeExpansion defines what component and volumeClaimTemplate need to expand the specified storage.


restart
[]ComponentOps
(Optional)

restart the specified components.


switchover
[]Switchover
(Optional)

switchover the specified components.


verticalScaling
[]VerticalScaling
(Optional)

verticalScaling defines what component need to vertical scale the specified compute resources.


reconfigure
Reconfigure
(Optional)

reconfigure defines the variables that need to input when updating configuration.


expose
[]Expose
(Optional)

expose defines services the component needs to expose.


restoreFrom
RestoreFromSpec
(Optional)

cluster RestoreFrom backup or point in time


ttlSecondsBeforeAbort
int32
(Optional)

ttlSecondsBeforeAbort OpsRequest will wait at most TTLSecondsBeforeAbort seconds for start-conditions to be met.
If not specified, the default value is 0, which means that the start-conditions must be met immediately.


scriptSpec
ScriptSpec
(Optional)

scriptSpec defines the script to be executed.


OpsRequestStatus

(Appears on:OpsRequest)

OpsRequestStatus defines the observed state of OpsRequest


FieldDescription
clusterGeneration
int64
(Optional)

ClusterGeneration records the cluster generation after handling the opsRequest action.


phase
OpsPhase

phase describes OpsRequest phase.


progress
string
lastConfiguration
LastConfiguration
(Optional)

lastConfiguration records the last configuration before this operation take effected.


components
map[string]github.com/apecloud/kubeblocks/apis/apps/v1alpha1.OpsRequestComponentStatus
(Optional)

components defines the recorded the status information of changed components for operation request.


startTimestamp
Kubernetes meta/v1.Time
(Optional)

startTimestamp The time when the OpsRequest started processing.


completionTimestamp
Kubernetes meta/v1.Time
(Optional)

completionTimestamp defines the OpsRequest completion time.


cancelTimestamp
Kubernetes meta/v1.Time
(Optional)

CancelTimestamp defines cancel time.


reconfiguringStatus
ReconfiguringStatus
(Optional)

reconfiguringStatus defines the status information of reconfiguring.


conditions
[]Kubernetes meta/v1.Condition
(Optional)

conditions describes opsRequest detail status.


OpsRequestVolumeClaimTemplate

(Appears on:LastComponentConfiguration, VolumeExpansion)

FieldDescription
storage
Kubernetes resource.Quantity

Request storage size.


name
string

name references volumeClaimTemplate name from cluster components.


OpsType (string alias)

(Appears on:OpsRecorder, OpsRequestSpec)

OpsType defines operation types.


ValueDescription

"DataScript"

"Expose"

StartType the start operation will start the pods which is deleted in stop operation.


"HorizontalScaling"

"Reconfiguring"

"Restart"

"Start"

StopType the stop operation will delete all pods in a cluster concurrently.


"Stop"

RestartType the restart operation is a special case of the rolling update operation.


"Switchover"

"Upgrade"

"VerticalScaling"

"VolumeExpansion"

ParameterConfig

(Appears on:Configuration)

FieldDescription
key
string

key indicates the key name of ConfigMap.


parameters
[]ParameterPair
(Optional)

Setting the list of parameters for a single configuration file.
update specified the parameters.


fileContent
string
(Optional)

fileContent indicates the configuration file content.
update whole file.


ParameterPair

(Appears on:ParameterConfig)

FieldDescription
key
string

key is name of the parameter to be updated.


value
string
(Optional)

parameter values to be updated.
if set nil, the parameter defined by the key field will be deleted from the configuration file.


PasswordConfig

(Appears on:SystemAccountSpec)

PasswordConfig helps provide to customize complexity of password generation pattern.


FieldDescription
length
int32
(Optional)

length defines the length of password.


numDigits
int32
(Optional)

numDigits defines number of digits.


numSymbols
int32
(Optional)

numSymbols defines number of symbols.


letterCase
LetterCase
(Optional)

letterCase defines to use lower-cases, upper-cases or mixed-cases of letters.


PersistentVolumeClaimSpec

(Appears on:ClusterComponentVolumeClaimTemplate)

FieldDescription
accessModes
[]Kubernetes core/v1.PersistentVolumeAccessMode
(Optional)

accessModes contains the desired access modes the volume should have.
More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1.


resources
Kubernetes core/v1.ResourceRequirements
(Optional)

resources represents the minimum resources the volume should have.
If RecoverVolumeExpansionFailure feature is enabled users are allowed to specify resource requirements
that are lower than previous value but must still be higher than capacity recorded in the
status field of the claim.
More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources.


storageClassName
string
(Optional)

storageClassName is the name of the StorageClass required by the claim.
More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1.


Phase (string alias)

(Appears on:ClusterDefinitionStatus, ClusterVersionStatus)

Phase defines the ClusterDefinition and ClusterVersion CR .status.phase


ValueDescription

"Available"

"Unavailable"

PodAntiAffinity (string alias)

(Appears on:Affinity)

PodAntiAffinity defines pod anti-affinity strategy.


ValueDescription

"Preferred"

"Required"

PointInTimeRefSpec

(Appears on:RestoreFromSpec)

FieldDescription
time
Kubernetes meta/v1.Time
(Optional)

specify the time point to restore, with UTC as the time zone.


ref
RefNamespaceName
(Optional)

specify a reference source cluster to restore


ProgressStatus (string alias)

(Appears on:ProgressStatusDetail)

ProgressStatus defines the status of the opsRequest progress.


ValueDescription

"Failed"

"Pending"

"Processing"

"Succeed"

ProgressStatusDetail

(Appears on:OpsRequestComponentStatus)

FieldDescription
group
string
(Optional)

group describes which group the current object belongs to.
if the objects of a component belong to the same group, we can ignore it.


objectKey
string

objectKey is the unique key of the object.


status
ProgressStatus

status describes the state of processing the object.


message
string
(Optional)

message is a human readable message indicating details about the object condition.


startTime
Kubernetes meta/v1.Time
(Optional)

startTime is the start time of object processing.


endTime
Kubernetes meta/v1.Time
(Optional)

endTime is the completion time of object processing.


ProtectedVolume

(Appears on:VolumeProtectionSpec)

FieldDescription
name
string
(Optional)

Name of volume to protect.


highWatermark
int
(Optional)

Volume specified high watermark threshold, 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.


FieldDescription
type
ProvisionPolicyType

type defines the way to provision an account, either CreateByStmt or ReferToExisting.


scope
ProvisionScope

scope is the scope to provision account, and the scope could be AnyPods or AllPods.


statements
ProvisionStatements
(Optional)

statements will be used when Type is CreateByStmt.


secretRef
ProvisionSecretRef
(Optional)

secretRef will be used when Type is ReferToExisting.


ProvisionPolicyType (string alias)

(Appears on:ProvisionPolicy)

ProvisionPolicyType defines the policy for creating accounts.


ValueDescription

"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 (within component) of provision.


ValueDescription

"AllPods"

AllPods will create accounts for all pods belong to the component.


"AnyPods"

AndyPods will only create accounts on one pod.


ProvisionSecretRef

(Appears on:ProvisionPolicy)

ProvisionSecretRef defines the information of secret referred to.


FieldDescription
name
string

name refers to the name of the secret.


namespace
string

namespace refers to the namespace of the secret.


ProvisionStatements

(Appears on:ProvisionPolicy)

ProvisionStatements defines the statements used to create accounts.


FieldDescription
creation
string

creation specifies statement how to create this account with required privileges.


update
string
(Optional)

update specifies statement how to update account’s password.


deletion
string
(Optional)

deletion specifies statement how to delete this account.
Used in combination with CreateionStatement to delete the account before create it.
For instance, one usually uses drop user if exists statement followed by create user statement to create an account.
Deprecated: this field is deprecated, use update instead.


Reconfigure

(Appears on:OpsRequestSpec)

Reconfigure defines the variables that need to input when updating configuration.


FieldDescription
ComponentOps
ComponentOps

(Members of ComponentOps are embedded into this type.)

configurations
[]Configuration

configurations defines which components perform the operation.


ReconfiguringStatus

(Appears on:OpsRequestStatus)

FieldDescription
configurationStatus
[]ConfigurationStatus

configurationStatus describes the status of the component reconfiguring.


RefNamespaceName

(Appears on:BackupRefSpec, PointInTimeRefSpec)

FieldDescription
name
string
(Optional)

specified the name


namespace
string
(Optional)

specified the namespace


ReloadOptions

(Appears on:ConfigConstraintSpec)

ReloadOptions defines reload options
Only one of its members may be specified.


FieldDescription
unixSignalTrigger
UnixSignalTrigger
(Optional)

unixSignalTrigger used to reload by sending a signal.


shellTrigger
ShellTrigger
(Optional)

shellTrigger performs the reload command.


tplScriptTrigger
TPLScriptTrigger
(Optional)

goTplTrigger performs the reload command.


ReplicationMemberStatus

(Appears on:ReplicationSetStatus)

FieldDescription
pod
string

Pod name.


ReplicationSetSpec

(Appears on:ClusterComponentDefinition)

FieldDescription
StatefulSetSpec
StatefulSetSpec

(Members of StatefulSetSpec are embedded into this type.)

ReplicationSetStatus

(Appears on:ClusterComponentStatus)

FieldDescription
primary
ReplicationMemberStatus

Primary status.


secondaries
[]ReplicationMemberStatus
(Optional)

Secondaries status.


ResourceConstraintRule

(Appears on:ComponentResourceConstraintSpec)

FieldDescription
name
string

The name of the constraint.


cpu
CPUConstraint

The constraint for vcpu cores.


memory
MemoryConstraint

The constraint for memory size.


storage
StorageConstraint
(Optional)

The constraint for storage size.


RestoreFromSpec

(Appears on:OpsRequestSpec)

FieldDescription
backup
[]BackupRefSpec
(Optional)

use the backup name and component name for restore, support for multiple components’ recovery.


pointInTime
PointInTimeRefSpec
(Optional)

specified the point in time to recovery


RetentionSpec

(Appears on:BackupPolicy)

FieldDescription
ttl
string
(Optional)

ttl is a time string ending with the ’d’|’D’|‘h’|‘H’ character to describe how long
the Backup should be retained. if not set, will be retained forever.


Schedule

(Appears on:BackupPolicy)

FieldDescription
startingDeadlineMinutes
int64
(Optional)

startingDeadlineMinutes defines the deadline in minutes for starting the backup job
if it misses scheduled time for any reason.


snapshot
SchedulePolicy
(Optional)

schedule policy for snapshot backup.


datafile
SchedulePolicy
(Optional)

schedule policy for datafile backup.


logfile
SchedulePolicy
(Optional)

schedule policy for logfile backup.


SchedulePolicy

(Appears on:Schedule)

FieldDescription
cronExpression
string

the cron expression for schedule, the timezone is in UTC. see https://en.wikipedia.org/wiki/Cron.


enable
bool

enable or disable the schedule.


ScriptConfig

(Appears on:ConfigConstraintSpec, TPLScriptTrigger)

FieldDescription
scriptConfigMapRef
string

scriptConfigMapRef used to execute for reload.


namespace
string
(Optional)

Specify the namespace of the referenced the tpl script ConfigMap object.
An empty namespace is equivalent to the “default” namespace.


ScriptFrom

(Appears on:ScriptSpec)

ScriptFrom defines the script to be executed from configMap or secret.


FieldDescription
configMapRef
[]Kubernetes core/v1.ConfigMapKeySelector
(Optional)

configMapRef defines the configMap to be executed.


secretRef
[]Kubernetes core/v1.SecretKeySelector
(Optional)

secretRef defines the secret to be executed.


ScriptSecret

(Appears on:ScriptSpec)

ScriptSecret defines the secret to be used to execute the script.


FieldDescription
name
string

name is the name of the secret.


usernameKey
string
(Optional)

usernameKey field is used to specify the username of the secret.


passwordKey
string
(Optional)

passwordKey field is used to specify the password of the secret.


ScriptSpec

(Appears on:OpsRequestSpec)

ScriptSpec defines the script to be executed. It is not a general purpose script executor.
It is designed to execute the script to perform some specific operations, such as create database, create user, etc.
It is applicable for engines, such as MySQL, PostgreSQL, Redis, MongoDB, etc.


FieldDescription
ComponentOps
ComponentOps

(Members of ComponentOps are embedded into this type.)

image
string
(Optional)

exec command with image, by default use the image of kubeblocks-datascript.


secret
ScriptSecret
(Optional)

secret defines the secret to be used to execute the script.
If not specified, the default cluster root credential secret will be used.


script
[]string
(Optional)

script defines the script to be executed.


scriptFrom
ScriptFrom
(Optional)

scriptFrom defines the script to be executed from configMap or secret.


ScriptSpecSelector

(Appears on:SwitchoverAction)

FieldDescription
name
string

ScriptSpec name of the referent, refer to componentDefs[x].scriptSpecs[y].Name.


ServicePort

(Appears on:ServiceSpec)

FieldDescription
name
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.


protocol
Kubernetes core/v1.Protocol
(Optional)

The IP protocol for this port. Supports “TCP”, “UDP”, and “SCTP”.
Default is TCP.


appProtocol
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.


port
int32

The port that will be exposed by this service.


targetPort
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.
If this is a string, it will be looked up as a named port in the
target Pod’s container ports. If this is not specified, the value
of the ‘port’ field is used (an identity map).
This field is ignored for services with clusterIP=None, and should be
omitted or set equal to the ‘port’ field.
More info: https://kubernetes.io/docs/concepts/services-networking/service/#defining-a-service


ServiceSpec

(Appears on:ClusterComponentDefinition)

FieldDescription
ports
[]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


ShellTrigger

(Appears on:ReloadOptions)

FieldDescription
command
[]string

command used to execute for reload.


sync
bool
(Optional)

Specify synchronize updates parameters to the config manager.


SignalType (string alias)

(Appears on:UnixSignalTrigger)

SignalType defines which signals are valid.


ValueDescription

"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"

SnapshotPolicy

(Appears on:BackupPolicy)

FieldDescription
BasePolicy
BasePolicy

(Members of BasePolicy are embedded into this type.)

hooks
BackupPolicyHook
(Optional)

execute hook commands for backup.


StatefulSetSpec

(Appears on:ClusterComponentDefinition, ConsensusSetSpec, ReplicationSetSpec)

FieldDescription
updateStrategy
UpdateStrategy
(Optional)

updateStrategy, Pods update strategy.
In case of workloadType=Consensus the update strategy will be following:



serial: update Pods one by one that guarantee minimum component unavailable time.
Learner -> Follower(with AccessMode=none) -> Follower(with AccessMode=readonly) -> Follower(with AccessMode=readWrite) -> Leader
bestEffortParallel: update Pods in parallel that guarantee minimum component un-writable time.
Learner, Follower(minority) in parallel -> Follower(majority) -> Leader, keep majority online all the time.
parallel: force parallel


llPodManagementPolicy
Kubernetes apps/v1.PodManagementPolicyType
(Optional)

llPodManagementPolicy is the low-level controls how pods are created during initial scale up,
when replacing pods on nodes, or when scaling down.
OrderedReady policy specify where pods are created in increasing order (pod-0, then
pod-1, etc) and the controller will wait until each pod is ready before
continuing. When scaling down, the pods are removed in the opposite order.
Parallel policy specify create pods in parallel
to match the desired scale without waiting, and on scale down will delete
all pods at once.


llUpdateStrategy
Kubernetes apps/v1.StatefulSetUpdateStrategy
(Optional)

llUpdateStrategy indicates the low-level StatefulSetUpdateStrategy that will be
employed to update Pods in the StatefulSet when a revision is made to
Template. Will ignore updateStrategy attribute if provided.


StatefulSetWorkload

StatefulSetWorkload interface


StatelessSetSpec

(Appears on:ClusterComponentDefinition)

FieldDescription
updateStrategy
Kubernetes apps/v1.DeploymentStrategy
(Optional)

updateStrategy defines the underlying deployment strategy to use to replace existing pods with new ones.


StorageConstraint

(Appears on:ResourceConstraintRule)

FieldDescription
min
Kubernetes resource.Quantity
(Optional)

The minimum size of storage.


max
Kubernetes resource.Quantity
(Optional)

The maximum size of storage.


SwitchPolicyType (string alias)

(Appears on:ClusterSwitchPolicy)

SwitchPolicyType defines switchPolicy type.
Currently, only Noop is supported. MaximumAvailability and MaximumDataProtection will be supported in the future.


ValueDescription

"MaximumAvailability"

"MaximumDataProtection"

"Noop"

SwitchStepRole (string alias)

SwitchStepRole defines the role to execute the switch command.


ValueDescription

"NewPrimary"

"OldPrimary"

"Secondaries"

Switchover

(Appears on:OpsRequestSpec)

FieldDescription
ComponentOps
ComponentOps

(Members of ComponentOps are embedded into this type.)

instanceName
string

instanceName is used to specify the candidate primary or leader instanceName for switchover.
If instanceName is set to “”, it means that no specific primary or leader is specified for the switchover,
and the switchoverAction defined in clusterDefinition.componentDefs[x].switchoverSpec.withoutCandidate will be executed,
It is required that clusterDefinition.componentDefs[x].switchoverSpec.withoutCandidate is not empty.
If instanceName is set to a valid instanceName other than “
”, it means that a specific candidate primary or leader is specified for the switchover.
the value of instanceName can be obtained using kbcli cluster list-instances, any other value is invalid.
In this case, the switchoverAction defined in clusterDefinition.componentDefs[x].switchoverSpec.withCandidate will be executed,
and it is required that clusterDefinition.componentDefs[x].switchoverSpec.withCandidate is not empty.


SwitchoverAction

(Appears on:SwitchoverSpec)

FieldDescription
cmdExecutorConfig
CmdExecutorConfig

cmdExecutorConfig is the executor configuration of the switchover command.


scriptSpecSelectors
[]ScriptSpecSelector
(Optional)

scriptSpecSelectors defines the selector of the scriptSpecs that need to be referenced.
Once ScriptSpecSelectors is defined, the scripts defined in scriptSpecs can be referenced in the SwitchoverAction.CmdExecutorConfig.


SwitchoverShortSpec

(Appears on:ClusterComponentVersion)

SwitchoverShortSpec is a short version of SwitchoverSpec, with only CommandExecutorEnvItem field.


FieldDescription
cmdExecutorConfig
CommandExecutorEnvItem

CmdExecutorConfig is the command executor config.


SwitchoverSpec

(Appears on:ClusterComponentDefinition)

FieldDescription
withCandidate
SwitchoverAction
(Optional)

withCandidate corresponds to the switchover of the specified candidate primary or leader instance.


withoutCandidate
SwitchoverAction
(Optional)

withoutCandidate corresponds to a switchover that does not specify a candidate primary or leader instance.


SystemAccountConfig

(Appears on:SystemAccountSpec)

SystemAccountConfig specifies how to create and delete system accounts.


FieldDescription
name
AccountName

name is the name of a system account.


provisionPolicy
ProvisionPolicy

provisionPolicy defines how to create account.


SystemAccountShortSpec

(Appears on:ClusterComponentVersion)

SystemAccountShortSpec is a short version of SystemAccountSpec, with only CmdExecutorConfig field.


FieldDescription
cmdExecutorConfig
CommandExecutorEnvItem

cmdExecutorConfig configs how to get client SDK and perform statements.


SystemAccountSpec

(Appears on:ClusterComponentDefinition)

SystemAccountSpec specifies information to create system accounts.


FieldDescription
cmdExecutorConfig
CmdExecutorConfig

cmdExecutorConfig configs how to get client SDK and perform statements.


passwordConfig
PasswordConfig

passwordConfig defines the pattern to generate password.


accounts
[]SystemAccountConfig

accounts defines system account config settings.


TLSSecretRef

(Appears on:Issuer)

TLSSecretRef defines Secret contains Tls certs


FieldDescription
name
string

Name of the Secret


ca
string

CA cert key in Secret


cert
string

Cert key in Secret


key
string

Key of TLS private key in Secret


TPLScriptTrigger

(Appears on:ReloadOptions)

FieldDescription
ScriptConfig
ScriptConfig

(Members of ScriptConfig are embedded into this type.)

sync
bool
(Optional)

Specify synchronize updates parameters to the config manager.


TargetInstance

(Appears on:BasePolicy)

FieldDescription
role
string
(Optional)

select instance of corresponding role for backup, role are:
- the name of Leader/Follower/Leaner for Consensus component.
- primary or secondary for Replication component.
finally, invalid role of the component will be ignored.
such as if workload type is Replication and component’s replicas is 1,
the secondary role is invalid. and it also will be ignored when component is Stateful/Stateless.
the role will be transformed to a role LabelSelector for BackupPolicy’s target attribute.


account
string
(Optional)

refer to spec.componentDef.systemAccounts.accounts[*].name in ClusterDefinition.
the secret created by this account will be used to connect the database.
if not set, the secret created by spec.ConnectionCredential of the ClusterDefinition will be used.
it will be transformed to a secret for BackupPolicy’s target secret.


connectionCredentialKey
ConnectionCredentialKey

connectionCredentialKey defines connection credential key in secret
which created by spec.ConnectionCredential of the ClusterDefinition.
it will be ignored when “account” is set.


TenancyType (string alias)

(Appears on:Affinity, ClusterSpec)

TenancyType for cluster tenant resources.


ValueDescription

"DedicatedNode"

"SharedNode"

TerminationPolicyType (string alias)

(Appears on:ClusterSpec)

TerminationPolicyType defines termination policy types.


ValueDescription

"Delete"

"DoNotTerminate"

"Halt"

"WipeOut"

ToolConfig

(Appears on:ToolsImageSpec)

FieldDescription
name
string

Specify the name of initContainer. Must be a DNS_LABEL name.


image
string
(Optional)

tools Container image name.


command
[]string

exec used to execute for init containers.


ToolsImageSpec

(Appears on:ConfigConstraintSpec)

FieldDescription
mountPoint
string

mountPoint is the mount point of the scripts file.


toolConfigs
[]ToolConfig
(Optional)

toolConfig used to config init container.


UnixSignalTrigger

(Appears on:ReloadOptions)

FieldDescription
signal
SignalType

signal is valid for unix signal.
e.g: SIGHUP
url: ../../pkg/configuration/configmap/handler.go:allUnixSignals


processName
string

processName is process name, sends unix signal to proc.


UpdateStrategy (string alias)

(Appears on:StatefulSetSpec)

UpdateStrategy defines Cluster Component update strategy.


ValueDescription

"BestEffortParallel"

"Parallel"

"Serial"

UpdatedParameters

(Appears on:ConfigurationStatus)

FieldDescription
addedKeys
map[string]string
(Optional)

addedKeys describes the key added.


deletedKeys
map[string]string
(Optional)

deletedKeys describes the key deleted.


updatedKeys
map[string]string
(Optional)

updatedKeys describes the key updated.


Upgrade

(Appears on:OpsRequestSpec)

Upgrade defines the variables of upgrade operation.


FieldDescription
clusterVersionRef
string

clusterVersionRef references ClusterVersion name.


UpgradePolicy (string alias)

(Appears on:Configuration, ConfigurationStatus)

UpgradePolicy defines the policy of reconfiguring.


ValueDescription

"autoReload"

"none"

"simple"

"operatorSyncUpdate"

"parallel"

"rolling"

VersionsContext

(Appears on:ClusterComponentVersion)

FieldDescription
initContainers
[]Kubernetes core/v1.Container
(Optional)

Provide ClusterDefinition.spec.componentDefs.podSpec.initContainers override
values, typical scenarios are application container image updates.


containers
[]Kubernetes core/v1.Container
(Optional)

Provide ClusterDefinition.spec.componentDefs.podSpec.containers override
values, typical scenarios are application container image updates.


VerticalScaling

(Appears on:OpsRequestSpec)

VerticalScaling defines the variables that need to input when scaling compute resources.


FieldDescription
ComponentOps
ComponentOps

(Members of ComponentOps are embedded into this type.)

ResourceRequirements
Kubernetes core/v1.ResourceRequirements

(Members of ResourceRequirements are embedded into this type.)

resources specifies the computing resource size of verticalScaling.


classDefRef
ClassDefRef
(Optional)

classDefRef reference class defined in ComponentClassDefinition.


VolumeExpansion

(Appears on:OpsRequestSpec)

VolumeExpansion defines the variables of volume expansion operation.


FieldDescription
ComponentOps
ComponentOps

(Members of ComponentOps are embedded into this type.)

volumeClaimTemplates
[]OpsRequestVolumeClaimTemplate

volumeClaimTemplates specifies the storage size and volumeClaimTemplate name.


VolumeProtectionSpec

(Appears on:ClusterComponentDefinition)

FieldDescription
highWatermark
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.


volumes
[]ProtectedVolume
(Optional)

Volumes to protect.


VolumeType (string alias)

(Appears on:VolumeTypeSpec)

VolumeType defines volume type for backup data or log.


ValueDescription

"data"

"log"

VolumeTypeSpec

(Appears on:ClusterComponentDefinition)

FieldDescription
name
string

name definition is the same as the name of the VolumeMounts field in PodSpec.Container,
similar to the relations of Volumes[].name and VolumesMounts[].name in Pod.Spec.


type
VolumeType
(Optional)

type is in enum of {data, log}.
VolumeTypeData: the volume is for the persistent data storage.
VolumeTypeLog: the volume is for the persistent log storage.


WorkloadType (string alias)

(Appears on:ClusterComponentDefinition, OpsRequestComponentStatus)

WorkloadType defines ClusterDefinition’s component workload type.


ValueDescription

"Consensus"

"Replication"

"Stateful"

"Stateless"


Generated with gen-crd-api-reference-docs