vitess-gh/examples/operator
Matt Lord 652b0da1b8
Release of v15.0.3 (#12767)
* Release notes for 15.0.3

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Release commit for 15.0.3

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Rename directory

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Update changelog/15.0/15.0.3/release_notes.md

Signed-off-by: Florent Poinsard <35779988+frouioui@users.noreply.github.com>

---------

Signed-off-by: Matt Lord <mattalord@gmail.com>
Signed-off-by: Florent Poinsard <35779988+frouioui@users.noreply.github.com>
Co-authored-by: Florent Poinsard <35779988+frouioui@users.noreply.github.com>
2023-03-30 17:37:29 +02:00
..
101_initial_cluster.yaml Release of v15.0.3 (#12767) 2023-03-30 17:37:29 +02:00
201_customer_tablets.yaml Release of v15.0.3 (#12767) 2023-03-30 17:37:29 +02:00
302_new_shards.yaml Release of v15.0.3 (#12767) 2023-03-30 17:37:29 +02:00
306_down_shard_0.yaml Release of v15.0.3 (#12767) 2023-03-30 17:37:29 +02:00
README.md Fix VTop Example (#10687) 2022-07-25 14:50:42 -07:00
create_commerce_schema.sql
create_commerce_seq.sql
create_customer_sharded.sql
delete_commerce_data.sql Fix VTop Example (#10687) 2022-07-25 14:50:42 -07:00
drop_all_commerce_tables.sql Fix VTop Example (#10687) 2022-07-25 14:50:42 -07:00
drop_commerce_tables.sql
operator.yaml Release of v15.0.3 (#12767) 2023-03-30 17:37:29 +02:00
pf.sh Fix VTop Example (#10687) 2022-07-25 14:50:42 -07:00
vschema_commerce_initial.json
vschema_commerce_seq.json
vschema_customer_sharded.json

README.md

Instructions

# Start minikube
minikube start --cpus=8 --memory=11000 --disk-size=50g --kubernetes-version=v1.19.5

# Install Operator
kubectl apply -f operator.yaml

# Bring up initial cluster and commerce keyspace
# NOTE: If you are using MySQL 8, update the images section to use mysql80 images
# Example:
#  images:
#    vtctld: vitess/lite:mysql80
#    vtadmin: vitess/vtadmin:latest
#    vtgate: vitess/lite:mysql80
#    vttablet: vitess/lite:mysql80
#    vtbackup: vitess/lite:mysql80
#    vtorc: vitess/lite:mysql80
#    mysqld:
#      mysql80Compatible: vitess/lite:mysql80

kubectl apply -f 101_initial_cluster.yaml

# Port-forward vtctld, vtgate and vtadmin and apply schema and vschema
# VTAdmin's UI will be available at http://localhost:14000/
./pf.sh &
alias mysql="mysql -h 127.0.0.1 -P 15306 -u user"
alias vtctlclient="vtctlclient --server localhost:15999 --alsologtostderr"
vtctlclient ApplySchema -- --sql="$(cat create_commerce_schema.sql)" commerce
vtctlclient ApplyVSchema -- --vschema="$(cat vschema_commerce_initial.json)" commerce

# Insert and verify data
mysql < ../common/insert_commerce_data.sql
mysql --table < ../common/select_commerce_data.sql

# Bring up customer keyspace
kubectl apply -f 201_customer_tablets.yaml

# Initiate move tables
vtctlclient MoveTables -- --source commerce --tables 'customer,corder' Create customer.commerce2customer

# Validate
vtctlclient VDiff customer.commerce2customer

# Cut-over
vtctlclient MoveTables -- --tablet_types=rdonly,replica SwitchTraffic customer.commerce2customer
vtctlclient MoveTables -- --tablet_types=primary SwitchTraffic customer.commerce2customer

# Clean-up
vtctlclient MoveTables Complete customer.commerce2customer

# Prepare for resharding
vtctlclient ApplySchema -- --sql="$(cat create_commerce_seq.sql)" commerce
vtctlclient ApplyVSchema -- --vschema="$(cat vschema_commerce_seq.json)" commerce
vtctlclient ApplySchema -- --sql="$(cat create_customer_sharded.sql)" customer
vtctlclient ApplyVSchema -- --vschema="$(cat vschema_customer_sharded.json)" customer
kubectl apply -f 302_new_shards.yaml

# Reshard
vtctlclient Reshard -- --source_shards '-' --target_shards '-80,80-' Create customer.cust2cust

# Validate
vtctlclient VDiff customer.cust2cust

# Cut-over
vtctlclient Reshard -- --tablet_types=rdonly,replica SwitchTraffic customer.cust2cust
vtctlclient Reshard -- --tablet_types=primary SwitchTraffic customer.cust2cust

# Down shard 0
vtctlclient Reshard Complete customer.cust2cust
kubectl apply -f 306_down_shard_0.yaml

# Down cluster
kubectl delete -f 101_initial_cluster.yaml