This lab deploys a TiDB cluster on an AWS EKS. The deployment process is automated with Pulumi, which is a popular infrastructure as code (IaC) framework.
Why using cloud platform (AWS)?
Cloud computing is the delivery of computing services—including servers, storage, databases, networking, software, analytics, and intelligence—over the internet ("the cloud") to offer faster innovation, flexible resources, and economies of scale, as your business needs change.
Why Kubernetes (EKS)?
Kubernetes offers automating deployment, scaling, and management of containerized applications. Adopting Kubernetes ultimately accelerates business and saves costs under relatively high application workload.
Amazon EKS is a managed Kubernetes service that makes it easy for you to run Kubernetes on AWS.
Why Operator?
Operators are software extensions to Kubernetes that use custom resources to manage applications and their components.
At first, there is Kubernetes, which is capable of scaling and being usable in extremely diverse contexts and applications. To do more complex things, capability of Kubernetes must be extended and more sophisticated automations must be created, suited to individual applications and their specific domain of action. This is where the Operators come in.
Why TiDB?
TiDB is an open-source distributed SQL database that supports HTAP workloads. It provides users with a one-stop database solution, and helps improve scalability, availability and reliability for users' data storage systems.
Why TiDB on EKS?
When deploying TiDB clusters on AWS EKS, users can gain all features provided by TiDB, while leverage the benefits of operating TiDB clusters on managed Kubernetes services.
Why IaC (Pulumi)
Infrastructure as code (IaC) means using code to define and manage modern cloud infrastructure. IaC has many benefits, such as:
- Version control
- Testing
- Use of IDEs
- DevOps
- Understand basic usage of Kubernetes
- Understand basic usage of AWS Kubernetes service (EKS)
- Understand the fundamentals of operator pattern
- Learn to deploy TiDB clusters on Kubernetes with TiDB Operator
- Understand basic usage of TiDB cluster
- Automate deployment process with Pulumi IaC framework
-
An AWS account
-
kubectl
: the standard Kubernetes command line interface -
Node.js 16. Use nvm to install Node.js 16:
$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash $ nvm install 16
-
VPN for connecting to AWS API and GitHub
Create a new GitHub repository base on this template
- Clone the newly created repository
- In the root directory of the repository, run
make install
to install the dependencies
- (30 min) Create an EKS cluster
1-create-an-eks-cluster
- (10 min) Deploy TiDB with TiDB
Operator
2-deploy-tidb-with-tidb-operator
- (10 min) Explore TiDB basic usage
3-explore-tidb-basic-usage
- (10 min) Scale up TiDB cluster with TiDB
Operator
4-scale-up-tidb-cluster-with-tidb-operator
- Bonus: Config the TiDB slow-log threshold in cluster config and update the cluster with Pulumi code
- Cleanup: Destroy the EKS cluster
1-create-an-eks-cluster
This lab will incur charges under the aws account, described in detail at:
- New EKS cluster control plane, 1 cluster x 0.10 USD per hour
- Two EKS worker EC2
t2.medium
instances, 2 instances * 0.0464 USD per hour - 4 EBS of size 1 GiB, with negligible cost
Total 0.1928 USD per hour.