Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs/aws: update AWS deploy docs after testing #491

Merged
merged 7 commits into from
May 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions deploy/aliyun/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ $ terraform apply

`terraform apply` will take 5 to 10 minutes to create the whole stack, once complete, basic cluster information will be printed:

> **Note:** You can use the `terraform output` command to get this information again.

```
Apply complete! Resources: 3 added, 0 changed, 1 destroyed.

Expand Down
23 changes: 17 additions & 6 deletions deploy/aws/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/#install-kubectl) >= 1.11
* [helm](https://github.com/helm/helm/blob/master/docs/install.md#installing-the-helm-client) >= 2.9.0
* [jq](https://stedolan.github.io/jq/download/)
* [aws-iam-authenticator](https://github.com/kubernetes-sigs/aws-iam-authenticator#4-set-up-kubectl-to-use-authentication-tokens-provided-by-aws-iam-authenticator-for-kubernetes)
* [aws-iam-authenticator](https://github.com/kubernetes-sigs/aws-iam-authenticator) installed in `PATH`

## Configure awscli

Expand All @@ -20,26 +20,29 @@ The default setup will create a new VPC and a t2.micro instance as bastion machi
* 2 c4.4xlarge instances for TiDB
* 1 c5.xlarge instance for monitor

You can change default values in `variables.tf` (like the cluster name and versions) as needed. The default value of `cluster_name` is `my-cluster`.

``` shell
$ git clone https://github.com/pingcap/tidb-operator
$ git clone --depth=1 https://github.com/pingcap/tidb-operator
$ cd tidb-operator/deploy/aws
$ terraform init
$ terraform apply
```

After `terraform apply` is executed successfully, you can access the `monitor_endpoint` using your web browser.
It might take 10 minutes or more for the process to finish. After `terraform apply` is executed successfully, some basic information is printed to the console. You can access the `monitor_endpoint` using your web browser.

> **Note:** You can use the `terraform output` command to get that information again.

To access TiDB cluster, use the following command to first ssh into the bastion machine, and then connect it via MySQL client:

``` shell
ssh -i credentials/k8s-prod-my-cluster.pem ec2-user@<bastion_ip>
ssh -i credentials/k8s-prod-<cluster_name>.pem ec2-user@<bastion_ip>
mysql -h <tidb_dns> -P <tidb_port> -u root
```

If the DNS name is not resolvable, be patient and wait a few minutes.

You can interact with the EKS cluster using `kubectl` and `helm` with the kubeconfig file `credentials/kubeconfig_<cluster_name>`. The default `cluster_name` is `my-cluster`, you can change it in the variables.tf.
You can interact with the EKS cluster using `kubectl` and `helm` with the kubeconfig file `credentials/kubeconfig_<cluster_name>`.

``` shell
# By specifying --kubeconfig argument
Expand All @@ -52,7 +55,15 @@ kubectl get po -n tidb
helm ls
```

> **NOTE:** You have to manually delete the EBS volumes after running `terraform destroy` if you don't need the data on the volumes any more.
# Destory

It may take some while to finish destroying the cluster.

```shell
$ terraform destroy
```

> **Note:** You have to manually delete the EBS volumes in AWS console after running `terraform destroy` if you do not need the data on the volumes anymore.

## Upgrade TiDB cluster

Expand Down
2 changes: 2 additions & 0 deletions docs/aws-eks-tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ summary: Tutorial for deploying TiDB on Kubernetes via AWS EKS.
category: operations
---

> **Note:** This documentation is outdated and might not work, so it is recommended to see the latest version in the [deploy directory](/deploy/aws/README.md).

# Deploy TiDB, a distributed MySQL compatible database, on Kubernetes via AWS EKS

## Requirements:
Expand Down