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

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.