ob-operator icon indicating copy to clipboard operation
ob-operator copied to clipboard

[Feature]: Support for Setting Tenant Variables via ObTenant CR in ob-operator

Open qchenzi opened this issue 4 months ago • 0 comments

In OceanBase, users often modify tenant variables by executing SET commands within the tenant environment. Currently, the ob-operator does not support setting these tenant variables directly in the ObTenant Custom Resource (CR). This limitation means that users cannot leverage the ob-operator's reconciliation functions to manage and apply tenant variable changes automatically. For instance, to modify the sql_mode variable for a tenant, users must manually execute the command, rather than specifying it in the ObTenant CR.

Proposal:

Add support in ob-operator to allow users to specify tenant variables directly within the ObTenant CR. The ob-operator should detect these specifications and reconcile the tenant's variables accordingly, applying any changes automatically.

Use Case:

A user wants to set the sql_mode variable for a tenant. Instead of logging into the tenant and executing:

SET sql_mode = 'STRICT_TRANS_TABLES';

the user can specify this variable in the ObTenant CR:

apiVersion: oceanbase.com/v1
kind: ObTenant
metadata:
  name: my-tenant
spec:
  variables:
    sql_mode: 'STRICT_TRANS_TABLES'

The ob-operator would detect this change and apply the variable to the tenant automatically during the reconciliation process.

Conclusion: Implementing this feature would enhance the ob-operator's functionality by allowing users to manage tenant variables declaratively. It would align the operator more closely with Kubernetes principles of declarative configuration and automation, improving the overall user experience.

qchenzi avatar Sep 27 '24 09:09 qchenzi