Skip to main content

Configure

This topic describes the startup parameters and environment variables of ob-operator, and the methods for modifying them. You can change the behavior of ob-operator by modifying the startup parameters and environment variables.

Startup parameters

ParameterDescriptionDefault valueDeployment configuration
namespaceThe namespace listened to by ob-operator. If you do not specify this parameter, ob-operator listens to all namespaces.EmptyEmpty
manager-namespaceThe namespace where ob-operator runs.oceanbase-systemoceanbase-system
metrics-bind-addressThe service port that ob-operator uses to provide metrics for Prometheus.:8080127.0.0.1:8080
health-probe-bind-addressThe service port that ob-operator uses to bind the process health probe.:8081:8081
leader-electSpecifies whether to elect a leader if no leader exists when ob-operator starts.falsetrue
log-verbosityThe scope of log output. 0 specifies to output key information, 1 specifies to output debugging information, and 2 specifies to output traceability information.00

Environment variables

Environment variableDescriptionDeployment configuration
TELEMETRY_REPORT_HOSTThe data collection endpoint of telemetry.https://openwebapi.oceanbase.com
TELEMETRY_DEBUGSpecifies whether to enable DEBUG mode of telemetry. If you set the value to true, DEBUG mode is enabled.Empty
DISABLE_WEBHOOKSSpecifies whether to disable webhook verification. If you set the value to true, webhook verification is disabled.Empty
DISABLE_TELEMETRYSpecifies whether to disable the telemetry module. If you set the value to true, the telemetry module is disabled. The telemetry module collects and desensitizes the cluster environment and event information, and then it sends the information to OceanBase Database. OceanBase Database uses the information to improve ob-operator.Empty
OB_OPERATOR_DATABASE_CONNECTIONLRUCACHESIZEThe size of the database connection LRU cache. Default is 1000.Empty
OB_OPERATOR_RESOURCE_DEFAULTDISKEXPANDPERCENTThe default percentage to expand the disk. Default is 10.Empty
OB_OPERATOR_RESOURCE_DEFAULTLOGPERCENTThe default percentage of log disk usage. Default is 80.Empty
OB_OPERATOR_RESOURCE_INITIALDATADISKUSEPERCENTThe initial percentage of data disk usage. Default is 20.Empty
OB_OPERATOR_RESOURCE_DEFAULTDISKUSEPERCENTThe default percentage of disk usage. Default is 95.Empty
OB_OPERATOR_RESOURCE_DEFAULTMEMORYLIMITPERCENTThe default percentage of memory limit. Default is 90.Empty
OB_OPERATOR_RESOURCE_DEFAULTMEMORYLIMITSIZEThe default size of memory limit. Default is 0M.Empty
OB_OPERATOR_RESOURCE_DEFAULTDATAFILEMAXSIZEThe default maximum size of data file. Default is 0M.Empty
OB_OPERATOR_RESOURCE_DEFAULTDATAFILENEXTSIZEThe default next size of data file. Default is 1G.Empty
OB_OPERATOR_RESOURCE_MINMEMORYSIZEThe minimum memory size. Default is 8Gi.Empty
OB_OPERATOR_RESOURCE_MINDATADISKSIZEThe minimum data disk size. Default is 30Gi.Empty
OB_OPERATOR_RESOURCE_MINREDOLOGDISKSIZEThe minimum redo log disk size. Default is 30Gi.Empty
OB_OPERATOR_RESOURCE_MINLOGDISKSIZEThe minimum log disk size. Default is 10Gi.Empty
OB_OPERATOR_TIME_TENANTOPRETRYTIMESThe number of retries for tenant operations. Default is 9.Empty
OB_OPERATOR_TIME_TENANTOPRETRYGAPSECONDSThe gap in seconds between tenant operation retries. Default is 9.Empty
OB_OPERATOR_TIME_TASKMAXRETRYTIMESThe maximum number of retries for tasks. Default is 99.Empty
OB_OPERATOR_TIME_TASKRETRYBACKOFFTHRESHOLDThe threshold for task retry backoff. Default is 16.Empty
OB_OPERATOR_TIME_PROBECHECKPERIODSECONDSThe period in seconds for probe checks. Default is 2.Empty
OB_OPERATOR_TIME_PROBECHECKDELAYSECONDSThe delay in seconds for probe checks. Default is 5.Empty
OB_OPERATOR_TIME_GETCONNECTIONMAXRETRIESThe maximum retries for getting a connection. Default is 100.Empty
OB_OPERATOR_TIME_CHECKCONNECTIONINTERVALThe interval in seconds for checking connections. Default is 3.Empty
OB_OPERATOR_TIME_CHECKJOBINTERVALThe interval in seconds for checking jobs. Default is 3.Empty
OB_OPERATOR_TIME_CHECKJOBMAXRETRIESThe maximum retries for checking jobs. Default is 100.Empty
OB_OPERATOR_TIME_COMMONCHECKINTERVALThe interval in seconds for common checks. Default is 5.Empty
OB_OPERATOR_TIME_BOOTSTRAPTIMEOUTSECONDSThe timeout in seconds for bootstrapping. Default is 2100.Empty
OB_OPERATOR_TIME_LOCALITYCHANGETIMEOUTSECONDSThe timeout in seconds for locality changes. Default is 86400.Empty
OB_OPERATOR_TIME_DEFAULTSTATEWAITTIMEOUTThe default timeout in seconds for resource state change waiting. Default is 1800.Empty
OB_OPERATOR_TIME_TIMECONSUMINGSTATEWAITTIMEOUTThe timeout in seconds for time-consuming task resource state change waiting. Default is 3600.Empty
OB_OPERATOR_TIME_WAITFORJOBTIMEOUTSECONDSThe timeout in seconds for waiting for a job. Default is 7200.Empty
OB_OPERATOR_TIME_SERVERDELETETIMEOUTSECONDSThe timeout in seconds for server deletion. Default is 604800.Empty
OB_OPERATOR_TIME_TOLERATESERVERPODNOTREADYMINUTESThe minutes to tolerate server pod not ready. Default is 5.Empty
OB_OPERATOR_TIME_DEFAULTSQLTIMEOUTSECONDSThe default timeout in seconds for SQL execution. Default is 60.Empty
OB_OPERATOR_TIME_TENANTSQLTIMEOUTSECONDSThe timeout in seconds for tenant SQL execution. Default is 600.Empty
OB_OPERATOR_TIME_TENANTRESTORETIMEOUTSECONDSThe timeout in seconds for tenant restore. Default is 600.Empty
OB_OPERATOR_TIME_POLLINGJOBSLEEPTIMESECONDSThe sleep time in seconds for polling jobs. Default is 1.Empty

Modify the configuration

Open the configuration file named operator.yaml in the deploy/ directory and find the Deployment resource named oceanbase-controller-manager. Then, find the container named manager in the containers list, and modify the startup parameters and environment variables. The following sample code snippet is taken from the operator.yaml configuration file as an example.

      # Original configuration
containers:
- args:
- --health-probe-bind-address=:8081
- --metrics-bind-address=:8080
- --leader-elect
- --manager-namespace=oceanbase-system
- --log-verbosity=0
command:
- /manager
env:
- name: TELEMETRY_REPORT_HOST
value: https://openwebapi.oceanbase.com

Example: Increase the log output

To increase the log output of ob-operator, set the log-verbosity parameter to 1 or 2. The larger the value, the more logs are recorded.

      # Modified configuration
containers:
- args:
- --health-probe-bind-address=:8081
- --metrics-bind-address=:8080
- --leader-elect
- --manager-namespace=oceanbase-system
- --log-verbosity=2 # Set the value of log output to 2.
command:
- /manager
env:
- name: TELEMETRY_REPORT_HOST
value: https://openwebapi.oceanbase.com

Example: Specify a resource namespace

      # Modified configuration
containers:
- args:
- --health-probe-bind-address=:8081
- --metrics-bind-address=:8080
- --leader-elect
- --manager-namespace=oceanbase-system
- --log-verbosity=0
- --namespace=oceanbase # Specify that ob-operator listens only to resources in the oceanbase namespace.
command:
- /manager
env:
- name: TELEMETRY_REPORT_HOST
value: https://openwebapi.oceanbase.com

Apply the modified configuration to the cluster

After you modify the configuration file, you can run the kubectl apply -f deploy/operator.yaml command to apply the configuration file to the cluster. You can use the same method to configure environment variables.