Deploy TiDB in General Kubernetes

    1. Create :

      Note

      A is a virtual cluster backed by the same physical cluster. You can give it a name that is easy to memorize, such as the same name as cluster_name.

    2. Deploy the TiDB cluster:

      1. kubectl apply -f ${cluster_name} -n ${namespace}

      Deploy a TiDB Cluster - 图2Note

      If the server does not have an external network, you need to download the Docker image used by the TiDB cluster on a machine with Internet access and upload it to the server, and then use docker load to install the Docker image on the server.

      To deploy a TiDB cluster, you need the following Docker images (assuming the version of the TiDB cluster is v5.4.0):

      Next, download all these images with the following command:

      1. docker pull pingcap/pd:v5.4.0
      2. docker pull pingcap/tidb:v5.4.0
      3. docker pull pingcap/tidb-binlog:v5.4.0
      4. docker pull pingcap/ticdc:v5.4.0
      5. docker pull pingcap/tidb-monitor-reloader:v1.0.1
      6. docker pull pingcap/tidb-monitor-initializer:v5.4.0
      7. docker pull grafana/grafana:6.0.1
      8. docker pull prom/prometheus:v2.18.1
      9. docker pull busybox:1.26.2
      10. docker save -o tikv-v5.4.0.tar pingcap/tikv:v5.4.0
      11. docker save -o tidb-v5.4.0.tar pingcap/tidb:v5.4.0
      12. docker save -o tidb-binlog-v5.4.0.tar pingcap/tidb-binlog:v5.4.0
      13. docker save -o tiflash-v5.4.0.tar pingcap/tiflash:v5.4.0
      14. docker save -o tidb-monitor-reloader-v1.0.1.tar pingcap/tidb-monitor-reloader:v1.0.1
      15. docker save -o tidb-monitor-initializer-v5.4.0.tar pingcap/tidb-monitor-initializer:v5.4.0
      16. docker save -o grafana-6.0.1.tar grafana/grafana:6.0.1
      17. docker save -o prometheus-v2.18.1.tar prom/prometheus:v2.18.1
      18. docker save -o busybox-1.26.2.tar busybox:1.26.2

      Next, upload these Docker images to the server, and execute docker load to install these Docker images on the server:

    Different clusters can be in the same or different namespace, which is based on your actual needs.

    Note

    If you need to deploy a TiDB cluster on ARM64 machines, refer to Deploy a TiDB Cluster on ARM64 Machines.

    If you want to initialize your cluster after deployment, refer to .

    Deploy a TiDB Cluster - 图4Note