Open dragonly opened 3 years ago
There may be a potential derived issue: when the user re-generate all certs, the tidb-controller-manager
must be restarted to read the new certs.
It seems that the tidb-controller-manager found no secrets and just returns a plain http pd client, which absolutely cannot connect to pd, thus the tc creating progress is stuck.
Since no secret found, no matter it return a HTTP client or just return error here, the creating of other components will be blocked, what do you expect to handle here?
There may be a potential derived issue: when the user re-generate all certs, the tidb-controller-manager must be restarted to read the new certs.
Please check the code carefully, a new TLS client is created each time after getting the secret from Kubernetes, so no need to restart tidb-controller-manager after certs rotated.
Since no secret found, no matter it return a HTTP client or just return error here, the creating of other components will be blocked, what do you expect to handle here?
I expect an error is directly returned, but not an unusable client instance, which can make debugging easier.
Please check the code carefully, a new TLS client is created each time after getting the secret from Kubernetes, so no need to restart tidb-controller-manager after certs rotated.
Yes, I misunderstood this. I is actually OK. 😂
Since no secret found, no matter it return a HTTP client or just return error here, the creating of other components will be blocked, what do you expect to handle here?
I expect an error is directly returned, but not an unusable client instance, which can make debugging easier.
This makes sense, we can optimize the logic here.
Bug Report
What version of Kubernetes are you using?
1.18.4
What version of TiDB Operator are you using?
master branch (commit #9305cf8d)
What's the status of the TiDB cluster pods?
What did you do?
Ref: https://docs.pingcap.com/tidb-in-kubernetes/stable/enable-tls-between-components
deploy a
TidbCluster
as followsWhat did you expect to see? TiDB cluster up and running.
What did you see instead? Only pd is up, and
tidb-controller-manager
has the following logIt seems that the
tidb-controller-manager
found no secrets and just returns a plain http pd client, which absolutely cannot connect to pd, thus the tc creating progress is stuck.