title | summary | category | aliases | |
---|---|---|---|---|
Deploy TiDB on General Kubernetes |
Learn how to deploy a TiDB cluster on general Kubernetes. |
how-to |
|
This document describes how to deploy a TiDB cluster on general Kubernetes.
- Meet prerequisites.
- Complete deploying TiDB Operator.
Before you deploy TiDB cluster, you should configure the TiDB cluster. Refer to Configure a TiDB Cluster in Kubernetes
After you configure TiDB cluster, deploy the TiDB cluster by the following steps:
-
Create
Namespace
:{{< copyable "shell-regular" >}}
kubectl create namespace ${namespace}
Note:
A
namespace
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 ascluster_name
. -
Deploy the TiDB cluster:
{{< copyable "shell-regular" >}}
kubectl apply -f ${cluster_name} -n ${namespace}
Note:
It is recommended to organize configurations for a TiDB cluster under a directory of
cluster_name
and save it as${cluster_name}/tidb-cluster.yaml
. -
View the Pod status:
{{< copyable "shell-regular" >}}
kubectl get po -n ${namespace} -l app.kubernetes.io/instance=${cluster_name}
You can use TiDB Operator to deploy and manage multiple TiDB clusters in a single Kubernetes cluster by repeating the above procedure and replacing cluster_name
with a different name.
Different clusters can be in the same or different namespace
, which is based on your actual needs.
If you want to initialize your cluster after deployment, refer to Initialize a TiDB Cluster in Kubernetes.