pingcap / tidb-operator

TiDB operator creates and manages TiDB clusters running in Kubernetes.
https://docs.pingcap.com/tidb-in-kubernetes/
Apache License 2.0
1.22k stars 489 forks source link

Allow users to read azure blob storage credentials from both env and secret at the same time. #4835

Open charleszheng44 opened 1 year ago

charleszheng44 commented 1 year ago

Feature Request

Is your feature request related to a problem? Please describe: Users need to set up TiDB clusters across multiple environments. Some settings, e.g., AZURE_STORAGE_ACCOUNT can be shared across different envs, while some of them, e.g., AZURE_CLIENT_ID, AZURE_CLIENT_SECRET and AZURE_TENANT_ID, have to be environment-specific. The current implementation only allows TiDB to read settings from one source, i.e., envs or kubernetes secrets, which makes it hard to manage several TiDB clusters in different environments,

Describe the feature you'd like: Allow users to read azure blob storage credentials from both env and secret at the same time. e.g., read AZURE_STORAGE_ACCOUNT from env, while get AZURE_CLIENT_ID, AZURE_CLIENT_SECRET and AZURE_TENANT_ID from the secret

Describe alternatives you've considered: Change the implementation in the file: https://github.com/pingcap/tidb-operator/blob/ec8974c534d6beeedc68a9106b82ec45fbab3d90/pkg/backup/util/util.go#L310-L317

Read the envs first, and overwrite parameters set in secret.

Teachability, Documentation, Adoption, Migration Strategy:

charleszheng44 commented 1 year ago

@csuzhangxc @azurezyq