Skip to content

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

@qchenzi

Description

@qchenzi

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.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions