Skip to content

Instantly share code, notes, and snippets.

@jawabuu
jawabuu / vitess-automigrate.sh
Last active April 3, 2023 10:24
Migrate your existing mysql database into Vitess automatically
#!/usr/bin/env bash
## This installs the Vitess Operator
kubectl kustomize github.com/planetscale/vitess-operator.git/deploy?ref=v2.8.2 | kubectl apply -f -
## This creates your Vitess Cluster
kubectl apply -f vitess-cluster.yml
## Edit vitess-cluster.yml to match your existing db variables and your desired vitess cluster variables.
## In VitessCluster update;
## externalDatastore.user: externalDatastore.host externalDatastore.port & externalDatastore.database
## In the example-cluster-config Secret update;
## external_users.json with your existing mysql user & password