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
| Parameter | Description | Default value | Deployment configuration |
|---|---|---|---|
| namespace | The namespace listened to by ob-operator. If you do not specify this parameter, ob-operator listens to all namespaces. | Empty | Empty |
| manager-namespace | The namespace where ob-operator runs. | oceanbase-system | oceanbase-system |
| metrics-bind-address | The service port that ob-operator uses to provide metrics for Prometheus. | :8080 | 127.0.0.1:8080 |
| health-probe-bind-address | The service port that ob-operator uses to bind the process health probe. | :8081 | :8081 |
| leader-elect | Specifies whether to elect a leader if no leader exists when ob-operator starts. | false | true |
| log-verbosity | The scope of log output. 0 specifies to output key information, 1 specifies to output debugging information, and 2 specifies to output traceability information. | 0 | 0 |
Environment variables
| Environment variable | Description | Deployment configuration |
|---|---|---|
| TELEMETRY_REPORT_HOST | The data collection endpoint of telemetry. | https://openwebapi.oceanbase.com |
| TELEMETRY_DEBUG | Specifies whether to enable DEBUG mode of telemetry. If you set the value to true, DEBUG mode is enabled. | Empty |
| DISABLE_WEBHOOKS | Specifies whether to disable webhook verification. If you set the value to true, webhook verification is disabled. | Empty |
| DISABLE_TELEMETRY | Specifies 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_CONNECTIONLRUCACHESIZE | The size of the database connection LRU cache. Default is 1000. | Empty |
| OB_OPERATOR_RESOURCE_DEFAULTDISKEXPANDPERCENT | The default percentage to expand the disk. Default is 10. | Empty |
| OB_OPERATOR_RESOURCE_DEFAULTLOGPERCENT | The default percentage of log disk usage. Default is 80. | Empty |
| OB_OPERATOR_RESOURCE_INITIALDATADISKUSEPERCENT | The initial percentage of data disk usage. Default is 20. | Empty |
| OB_OPERATOR_RESOURCE_DEFAULTDISKUSEPERCENT | The default percentage of disk usage. Default is 95. | Empty |
| OB_OPERATOR_RESOURCE_DEFAULTMEMORYLIMITPERCENT | The default percentage of memory limit. Default is 90. | Empty |
| OB_OPERATOR_RESOURCE_DEFAULTMEMORYLIMITSIZE | The default size of memory limit. Default is 0M. | Empty |
| OB_OPERATOR_RESOURCE_DEFAULTDATAFILEMAXSIZE | The default maximum size of data file. Default is 0M. | Empty |
| OB_OPERATOR_RESOURCE_DEFAULTDATAFILENEXTSIZE | The default next size of data file. Default is 1G. | Empty |
| OB_OPERATOR_RESOURCE_MINMEMORYSIZE | The minimum memory size. Default is 8Gi. | Empty |
| OB_OPERATOR_RESOURCE_MINDATADISKSIZE | The minimum data disk size. Default is 30Gi. | Empty |
| OB_OPERATOR_RESOURCE_MINREDOLOGDISKSIZE | The minimum redo log disk size. Default is 30Gi. | Empty |
| OB_OPERATOR_RESOURCE_MINLOGDISKSIZE | The minimum log disk size. Default is 10Gi. | Empty |
| OB_OPERATOR_TIME_TENANTOPRETRYTIMES | The number of retries for tenant operations. Default is 9. | Empty |
| OB_OPERATOR_TIME_TENANTOPRETRYGAPSECONDS | The gap in seconds between tenant operation retries. Default is 9. | Empty |
| OB_OPERATOR_TIME_TASKMAXRETRYTIMES | The maximum number of retries for tasks. Default is 99. | Empty |
| OB_OPERATOR_TIME_TASKRETRYBACKOFFTHRESHOLD | The threshold for task retry backoff. Default is 16. | Empty |
| OB_OPERATOR_TIME_PROBECHECKPERIODSECONDS | The period in seconds for probe checks. Default is 2. | Empty |
| OB_OPERATOR_TIME_PROBECHECKDELAYSECONDS | The delay in seconds for probe checks. Default is 5. | Empty |
| OB_OPERATOR_TIME_GETCONNECTIONMAXRETRIES | The maximum retries for getting a connection. Default is 100. | Empty |
| OB_OPERATOR_TIME_CHECKCONNECTIONINTERVAL | The interval in seconds for checking connections. Default is 3. | Empty |
| OB_OPERATOR_TIME_CHECKJOBINTERVAL | The interval in seconds for checking jobs. Default is 3. | Empty |
| OB_OPERATOR_TIME_CHECKJOBMAXRETRIES | The maximum retries for checking jobs. Default is 100. | Empty |
| OB_OPERATOR_TIME_COMMONCHECKINTERVAL | The interval in seconds for common checks. Default is 5. | Empty |
| OB_OPERATOR_TIME_BOOTSTRAPTIMEOUTSECONDS | The timeout in seconds for bootstrapping. Default is 2100. | Empty |
| OB_OPERATOR_TIME_LOCALITYCHANGETIMEOUTSECONDS | The timeout in seconds for locality changes. Default is 86400. | Empty |
| OB_OPERATOR_TIME_DEFAULTSTATEWAITTIMEOUT | The default timeout in seconds for resource state change waiting. Default is 1800. | Empty |
| OB_OPERATOR_TIME_TIMECONSUMINGSTATEWAITTIMEOUT | The timeout in seconds for time-consuming task resource state change waiting. Default is 3600. | Empty |
| OB_OPERATOR_TIME_WAITFORJOBTIMEOUTSECONDS | The timeout in seconds for waiting for a job. Default is 7200. | Empty |
| OB_OPERATOR_TIME_SERVERDELETETIMEOUTSECONDS | The timeout in seconds for server deletion. Default is 604800. | Empty |
| OB_OPERATOR_TIME_TOLERATESERVERPODNOTREADYMINUTES | The minutes to tolerate server pod not ready. Default is 5. | Empty |
| OB_OPERATOR_TIME_DEFAULTSQLTIMEOUTSECONDS | The default timeout in seconds for SQL execution. Default is 60. | Empty |
| OB_OPERATOR_TIME_TENANTSQLTIMEOUTSECONDS | The timeout in seconds for tenant SQL execution. Default is 600. | Empty |
| OB_OPERATOR_TIME_TENANTRESTORETIMEOUTSECONDS | The timeout in seconds for tenant restore. Default is 600. | Empty |
| OB_OPERATOR_TIME_POLLINGJOBSLEEPTIMESECONDS | The 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.