Setup and Deploy Vitess on Kubernetes (Minikube) for MySQL – Part II of III

vitess kubernetes mysqlIn this blog post, I’d like to share some experiences in setting up a Vitess environment for local tests and development on OSX/macOS. As previously, I have presented How To Test and Deploy Kubernetes Operator for MySQL(PXC) in OSX/macOS, this time I will be showing how to Run Vitess on Kubernetes.

Since running Kubernetes on a laptop is only experimental, I had faced several issues going through straight forward installation steps so I had to apply a few workarounds to the environment. This setup will have only minimum customization involved.

For a high-level overview of Vitess, please visit Part I of this series, Introduction to Vitess on Kubernetes for MySQL.

Housekeeping items needed during installation:

Installation and Configuration 

Minikube Installation 

One of the main challenges I’ve faced was that the latest Kubernetes version wasn’t compatible with the existing development. The issue is filed here in GitHub, hence we start with the previous version, not the default. 

Verify that the minikube is initialized and running.

Installation of etcd Operator  

The next item on the list is to get etcd operator running.  At this point, we’ll still need to clone etcd to local directory to have access to files. 

The issue reported here is a workaround to replace the deployment.yaml file.  Once that’s done we can proceed with the installation. 

Under /Users/[username]/Kubernetes/etcd-operator run;

If the above steps don’t work, alternatively you may install etcd-operator via helm

Installation of helm 

Another issue faced with Helm is it can’t find tiller.

Installation of Vitess Client

Get Vitess client installed using go:

Configuration of Vitess Cluster

Now we’re ready to launch our test cluster in Vitess which consists of the sample database schema. We will go over this in the next blog by creating a single keyspace and sharding across instances using Vitess. 

Here we face another issue even though our cluster is up and running. We aren’t able to access this environment from the laptop.  Under /Users/askdba/go/src/ there’s a script called which figures out the hostname and port number for this cluster, but it fails due to the above-mentioned issue

This script returns an error as follows:

To fix this, we’ll need to create a pod to access Kubernetes running inside minikube:

This allows us required access to the cluster.

Summary of issues:

Read Part I of this series: Introduction to Vitess on Kubernetes for MySQL – Part I

Read Part III of this series: Setup and Deploy Vitess on Kubernetes (Minikube) for MySQL – Part III



Share this post

Leave a Reply