-
Notifications
You must be signed in to change notification settings - Fork 203
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Suggest helm 3.0 but not k8s 1.16 Signed-off-by: Morgan Tocker <[email protected]>
- Loading branch information
Showing
1 changed file
with
54 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ aliases: ['/docs/tutorials/kubernetes/','/user-guide/sharding-kubernetes.html'] | |
This tutorial demonstrates how Vitess can be used with Minikube to deploy Vitess clusters. | ||
|
||
{{< warning >}} | ||
Kubernetes 1.16 is not yet supported. We are working on fixing this in [issue #5411](https://github.com/vitessio/vitess/issues/5411), and recommend that you use an older version of minikube (v1.2.0) until it is fixed. | ||
Kubernetes 1.16 is not yet supported. We are working on fixing this in [issue #5411](https://github.com/vitessio/vitess/issues/5411). | ||
{{< /warning >}} | ||
|
||
|
||
|
@@ -17,18 +17,22 @@ Kubernetes 1.16 is not yet supported. We are working on fixing this in [issue #5 | |
Before we get started, let’s get a few things out of the way: | ||
|
||
1. [Install Minikube](https://kubernetes.io/docs/tasks/tools/install-minikube/) | ||
Start a Minikube engine: `minikube start --cpus=4 --memory=5000`. Note the additional resource requirements. In order to go through all the use cases, many vttablet and MySQL instances will be launched. These require more resources than the defaults used by Minikube. | ||
2. [Install kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) and ensure it is in your `$PATH`. | ||
3. [Install etcd operator](https://github.com/coreos/etcd-operator/blob/master/doc/user/install_guide.md): | ||
Start a Minikube engine: `minikube start --kubernetes-version v1.15.0 --cpus=4 --memory=5000`. Note the additional resource requirements. In order to go through all the use cases, many vttablet and MySQL instances will be launched. These require more resources than the defaults used by Minikube. | ||
2. [Install kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) and ensure it is in your `PATH`. For example on Linux: | ||
``` | ||
curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.15.0/bin/linux/amd64/kubectl | ||
``` | ||
3. [Install Helm 3.0](https://helm.sh/docs/intro/install/). | ||
4. [Install etcd-operator](https://github.com/coreos/etcd-operator/): | ||
``` | ||
git clone [email protected]:coreos/etcd-operator.git | ||
cd etcd-operator | ||
example/rbac/create_role.sh | ||
kubectl create -f example/deployment.yaml | ||
``` | ||
4. [Install Helm 3.0](https://helm.sh/docs/intro/install/) | ||
5. Install the MySQL client locally. For example, on Ubuntu: `apt-get install mysql-client` | ||
6. Install vtctlclient locally: | ||
|
||
4. Install the MySQL client locally. For example, on Ubuntu: `apt-get install mysql-client` | ||
5. Install vtctlclient locally: | ||
* Install go 1.12+ | ||
* `go get vitess.io/vitess/go/cmd/vtctlclient` | ||
* vtctlclient will be installed at `$GOBIN` or `$GOPATH/bin/` | ||
|
@@ -57,36 +61,51 @@ This will bring up the initial Vitess cluster with a single keyspace. | |
Once successful, you should see the following state: | ||
|
||
``` sh | ||
~/...vitess/helm/vitess/templates> kubectl get pods,jobs | ||
NAME READY STATUS RESTARTS AGE | ||
po/etcd-global-2cwwqfkf8d 1/1 Running 0 14m | ||
po/etcd-operator-9db58db94-25crx 1/1 Running 0 15m | ||
po/etcd-zone1-btv8p7pxsg 1/1 Running 0 14m | ||
po/vtctld-55c47c8b6c-5v82t 1/1 Running 1 14m | ||
po/vtgate-zone1-569f7b64b4-zkxgp 1/1 Running 2 14m | ||
po/zone1-commerce-0-rdonly-0 6/6 Running 0 14m | ||
po/zone1-commerce-0-replica-0 6/6 Running 0 14m | ||
po/zone1-commerce-0-replica-1 6/6 Running 0 14m | ||
$ kubectl get pods,jobs | ||
NAME READY STATUS RESTARTS AGE | ||
pod/commerce-apply-schema-initial-5twrs 0/1 Completed 0 2m21s | ||
pod/commerce-apply-vschema-initial-z87rp 0/1 Completed 0 2m21s | ||
pod/etcd-1578351858-0 1/1 Running 0 7m21s | ||
pod/etcd-global-mvbkhllcwz 1/1 Running 0 2m21s | ||
pod/etcd-operator-866875d5dc-czhmf 1/1 Running 0 4m57s | ||
pod/etcd-zone1-x8khdmnbhk 1/1 Running 0 2m21s | ||
pod/vtctld-66487b49f5-wdb68 1/1 Running 2 2m21s | ||
pod/vtgate-zone1-5999cbcd49-x22f9 1/1 Running 2 2m21s | ||
pod/zone1-commerce-0-init-shard-master-9chrk 0/1 Completed 0 2m21s | ||
pod/zone1-commerce-0-rdonly-0 5/6 Running 0 2m21s | ||
pod/zone1-commerce-0-replica-0 5/6 Running 0 2m21s | ||
pod/zone1-commerce-0-replica-1 6/6 Running 0 2m21s | ||
|
||
NAME DESIRED SUCCESSFUL AGE | ||
jobs/commerce-apply-schema-initial 1 1 14m | ||
jobs/commerce-apply-vschema-initial 1 1 14m | ||
jobs/zone1-commerce-0-init-shard-master 1 1 14m | ||
NAME COMPLETIONS DURATION AGE | ||
job.batch/commerce-apply-schema-initial 1/1 106s 2m21s | ||
job.batch/commerce-apply-vschema-initial 1/1 101s 2m21s | ||
job.batch/zone1-commerce-0-init-shard-master 1/1 104s 2m21s | ||
``` | ||
|
||
If you have installed the the MySQL client, you should now be able to connect to the cluster using the following command: | ||
|
||
``` sh | ||
~/...vitess/examples/helm> ./kmysql.sh | ||
mysql> show tables; | ||
+--------------------+ | ||
| Tables_in_commerce | | ||
+--------------------+ | ||
| corder | | ||
| customer | | ||
| product | | ||
+--------------------+ | ||
3 rows in set (0.01 sec) | ||
``` | ||
$ ./kmysql.sh | ||
SHOW DATAWelcome to the MySQL monitor. Commands end with ; or \g. | ||
Your MySQL connection id is 2 | ||
Server version: 5.7.9-Vitess Percona Server (GPL), Release 29, Revision 11ad961 | ||
Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved. | ||
Oracle is a registered trademark of Oracle Corporation and/or its | ||
affiliates. Other names may be trademarks of their respective | ||
owners. | ||
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. | ||
vitess> SHOW DATABASES; | ||
+-----------+ | ||
| Databases | | ||
+-----------+ | ||
| commerce | | ||
+-----------+ | ||
1 row in set (0.00 sec) | ||
``` | ||
|
||
You can also browse to the vtctld console using the following command (Ubuntu): | ||
|
@@ -215,7 +234,7 @@ Notice that we are using keyspace `commerce/0` to select data from our tables. | |
For subsequent commands, it will be convenient to capture the name of the release and save into a variable: | ||
|
||
``` sh | ||
export release=$(helm ls -q) | ||
export release=$(helm ls -q | tail -n1) | ||
``` | ||
|
||
For a vertical split, we first need to create a special `served_from` keyspace. This keyspace starts off as an alias for the `commerce` keyspace. Any queries sent to this keyspace will be redirected to `commerce`. Once this is created, we can vertically split tables into the new keyspace without having to make the app aware of this change: | ||
|
@@ -238,6 +257,7 @@ This creates an entry into the topology indicating that any requests to master, | |
A successful completion of this job should show up as: | ||
|
||
``` sh | ||
$ kubectl get jobs | ||
NAME DESIRED SUCCESSFUL AGE | ||
jobs/vtctlclient-create-customer-ks 1 1 10s | ||
``` | ||
|
@@ -305,6 +325,7 @@ The move in the VSchema should not make a difference yet because any queries sen | |
Upon completion of this step, there must be six running vttablet pods, and the following new jobs must have completed successfully: | ||
|
||
``` sh | ||
$ kubectl get jobs | ||
NAME DESIRED SUCCESSFUL AGE | ||
jobs/commerce-apply-vschema-vsplit 1 1 5m | ||
jobs/customer-apply-vschema-vsplit 1 1 5m | ||
|