Difficulty: Beginner
Estimated Time: 60 minutes

Vitess Playground

Step 1 of 2

Step 1 - Deploy

Prepare the Environment

First Start the minikube service to get a working kubernetes environment minikube start --extra-config=apiserver.service-node-port-range=1024-65535

Next deploy the manifests for the Planetscale Vitess operator

kubectl create -f operator.yaml

Deploy a stand alone mysql deployment

kubectl create -f mysql-deployment.yaml

Load the following sample schema into the mysql server

cat <<EOF |  mysql -h 127.0.0.1 -u mysql_user -pmysql_password commerce
create table product(
    sku varbinary(128),
    description varbinary(128),
    price bigint,
    primary key(sku)
);
create table customer(
    customer_id bigint not null auto_increment,
    email varbinary(128),
    primary key(customer_id)
);
create table corder(
    order_id bigint not null auto_increment,
    customer_id bigint,
    sku varbinary(128),
    price bigint,
    primary key(order_id)
);
EOF

Finally Load some sample data into the cluster

cat <<EOF | mysql -h 127.0.0.1 -u mysql_user -pmysql_password commerce
INSERT INTO product (sku,description,price) VALUES ("pen","A Pen",130),("paper","Some Paper",20),("chicken","A whole Chicken",100);
INSERT INTO customer (email) VALUES ("[email protected]"),("[email protected]"),("[email protected]");
INSERT INTO corder (customer_id, sku, price) VALUES (1,"pen",130);
EOF