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

en: improve GKE cloud shell docs #527

Merged
merged 2 commits into from
Jul 13, 2020
Merged
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
26 changes: 9 additions & 17 deletions en/deploy-tidb-from-kubernetes-gke.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,25 +98,17 @@ If you see `Ready` for all nodes, congratulations! You've set up your first Kube
TiDB Operator uses [Custom Resource Definition (CRD)](https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/#customresourcedefinitions) to extend Kubernetes. Therefore, to use TiDB Operator, you must first create the `TidbCluster` CRD.

```shell
kubectl apply -f https://raw.githubusercontent.com/pingcap/tidb-operator/master/manifests/crd.yaml && \
kubectl apply -f https://raw.githubusercontent.com/pingcap/tidb-operator/v1.1.2/manifests/crd.yaml && \
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

install the same version as the tidb-operator

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like this very much, because it means we have to remember to update this every time we have a new release.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, we should update this but the tutorial still work even if we forget

kubectl get crd tidbclusters.pingcap.com
```

After the `TidbCluster` CRD is created, install TiDB Operator in your Kubernetes cluster.

1. Install TiDB Operator:

```shell
kubectl create namespace tidb-admin
helm install --namespace tidb-admin tidb-operator pingcap/tidb-operator --version v1.1.0
kubectl get po -n tidb-admin -l app.kubernetes.io/name=tidb-operator
```

2. Create the `pd-ssd` StorageClass:

``` shell
kubectl apply -f https://raw.githubusercontent.com/pingcap/tidb-operator/master/manifests/gke/persistent-disk.yaml
```
```shell
kubectl create namespace tidb-admin
helm install --namespace tidb-admin tidb-operator pingcap/tidb-operator --version v1.1.2
kubectl get po -n tidb-admin -l app.kubernetes.io/name=tidb-operator
```
Copy link
Contributor Author

@cofyc cofyc Jul 2, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need to install pd-ssd storage class anymore, because we use the default storage class (gce-pd in gke) in our examples, e.g.

$ kubectl get sc
NAME                 PROVISIONER            AGE
standard (default)   kubernetes.io/gce-pd   17m


## Deploy the TiDB cluster

Expand Down Expand Up @@ -201,15 +193,15 @@ kubectl -n demo edit tc basic

## Access the Grafana dashboard

To access the Grafana dashboards, you can forward a port from the Cloud Shell to the Grafana service in Kubernetes. (Cloud Shell already uses port 3000 so we use port 3003 in this example instead.)
To access the Grafana dashboards, you can forward a port from the Cloud Shell to the Grafana service in Kubernetes. (Cloud Shell already uses port 3000 so we use port 8080 in this example instead.)

To do so, use the following command:

```shell
kubectl -n demo port-forward svc/basic-grafana 3003:3000 &>/tmp/pf3003.log &
kubectl -n demo port-forward svc/basic-grafana 8080:3000 &>/tmp/pf8080.log &
```

Open this URL to view the Grafana dashboard: <https://ssh.cloud.google.com/devshell/proxy?port=3003> . (Alternatively, in Cloud Shell, click on the Web Preview button and enter 3003 for the port. If not using Cloud Shell, point a browser to `localhost:3000`.
Open this URL to view the Grafana dashboard: <https://ssh.cloud.google.com/devshell/proxy?port=8080> . (Alternatively, in Cloud Shell, click the Web Preview button on the upper right corner and change the port to 8080 if necessary. If not using Cloud Shell, point a browser to `localhost:8080`.
Copy link
Contributor Author

@cofyc cofyc Jul 2, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found the current cloud shell does not allow users to specify arbitrary port now. Instead, it provides a few common ports. I choose the port 8080 as the 3003 is not on the list.

image


The default username and password are both "admin".

Expand Down