Deployment of TiDB on Self-Managed K8s Fails During Initialization with TidbInitializer

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: 自托管k8s上部署TiDB,最后使用TidbInitializer初始化TiDB的时候,初始化失败

| username: TiDBer_AzxZlinQ

[TiDB Usage Environment]
System: CentOS Linux release 7.5.1804 (Core) Kernel Version: 4.4.161-1.el7.elrepo.x86_64

[TiDB Version]
v6.5.0

[Reproduction Path]
Kubernetes 上的 TiDB 集群环境需求 | PingCAP 文档中心 Self-hosted Kubernetes Step 5: Initialize TiDB Cluster

[Encountered Issue: Phenomenon and Impact]
Initialization failed when using TidbInitializer to initialize TiDB

[Resource Configuration]

[Attachments: Screenshots/Logs/Monitoring]

  1. Cluster deployment information:

  2. Log information from pod/tidb-cluster-demo-tidb-initializer-8plz9 waitercontainer:

  3. From the second image, it can be seen that the required tidb-cluster-demo-tidb:4000 for initialization has not been created

  4. Related configuration files:
    crd.yaml (1.8 MB)
    tidb-initializer.yaml (538 bytes)
    tidb-cluster.yaml (36.4 KB)
    local-volume-provisioner.yaml (2.9 KB)

| username: yiduoyunQ | Original post link

TiFlash and Pump haven’t been created, sts is 0, please confirm the reason first.

| username: TiDBer_AzxZlinQ | Original post link

Thank you very much, I will first investigate the cause. :rofl:

| username: TiDBer_AzxZlinQ | Original post link

Hello, the issue of TiFlash and Pump not being created has been resolved.

Deployment information is as follows:

However, the previous initialization failure issue still exists. Unable to connect to tidb-cluster-demo-tidb:4000 (I suspect this is a service).
Partial information from k -n tidb-cluster describe pod/tidb-cluster-demo-tidb-initializer-wc9zf is as follows:

Below is the error information from the wait container in the Init Containers of pod/tidb-cluster-demo-tidb-initializer-wc9zf:

Please help take a look, thank you very much. :smiling_face_with_three_hearts:

| username: TiDBer_AzxZlinQ | Original post link

I found another issue. Not only was the service for tidb-cluster-demo-tidb not created, but the pod for tidb-cluster-demo-tidb was also not created. Below is my tidb-cluster.yaml file, where I have already set up tidb and also configured tidb.service.

| username: yiduoyunQ | Original post link

Check where the operator’s logs are stuck.

| username: TiDBer_AzxZlinQ | Original post link

:joy: :joy: Sorry, how do I check the operator logs? I only found this document 运维 - 查看日志 - 《TiDB in Kubernetes 用户文档 v1.2》 - 书栈网 · BookStack

| username: yiduoyunQ | Original post link

kubectl -n {ns} logs -f tidb-controller-manager-xxxx

| username: TiDBer_AzxZlinQ | Original post link

Thank you very much. The TiDB pod and service have been created.

Now there are still some issues with pod/tidb-cluster-demo-tidb-initializer-s7mks. Below is part of the information from the describe command.

Entering the container: mysql-client in pod/tidb-cluster-demo-tidb-initializer-s7mks, the error is shown below.

Below is tidb-initializer.yaml

| username: yiduoyunQ | Original post link

Access denied, refer to Kubernetes 上的集群初始化配置 | PingCAP 文档中心 for configuration.

| username: TiDBer_AzxZlinQ | Original post link

It was set up according to this document. Previously, I set up tidb-secret and encountered the same error, so I deleted tidb-secret. Now I’m logging in without a password.