How To Test and Deploy Kubernetes Operator for MySQL(PXC) in OSX/macOS?

March 19, 2019
Author
Alkin Tezuysal
Share this Post:

kubernetes on mac osxIn this blog post, I’m going to show you how to test Kubernetes locally on OSX/macOS. Testing Kubernetes without having access to a cloud operator in a local lab is not as easy as it sounds. I’d like to share some of my experiences in this adventure. For those who have already experienced in Virtualbox & Vagrant combination, I can tell you that it doesn’t work. Since Kubernetes will require virtualization, setting another virtual environment within another VirtualBox has several issues. After trying to bring up a cluster for a day or two, I gave up my traditional lab and figured out that Kubernetes has an alternate solution called minikube.

Installation

If your OSX/macOS doesn’t have brew I strongly recommend installing it. My OSX/macOS version at the time of this post was macOS 10.14.3 (18D109).

Once minikube is installed, we’ll need to start the virtual environment that is required to run our operator.

I’m starting my minikube environment with 4Gb memory since our Percona Xtradb(PXC) Cluster will have 3 MySQL nodes + 1 ProxySQL pod.

We’re now ready to install Install Percona XtraDB Cluster on Kubernetes.

Setup

Clone and download Kubernetes Operator for MySQL.

Here we have to make the following modifications for this operator to work on OSX/macOS.

 

    1. Reduce memory allocation for each pod.

 

    1. Reduce CPU usage for each pod.

 

    1. Change the topology type (because we want to run all PXC instances on one node).

 

 

We’re now ready to deploy our PXC via the operator.

Here we’re ready to monitor the progress of our deployment.

If any of the nodes is having difficulty passing any STATUS to Running state

In order to connect to this cluster, we’ll need to deploy a client shell access.

 

A few things to remember:

 

 

    • Secrets for this setup are under deploy/secrets.yaml, you can decode via

 

 

 

 

    • To reconnect shell

 

 

 

 

    • To redeploy the pod delete first and repeat above steps without configuration changes

 

 

 

 

    • To stop and delete minikube virtual environment

 

 

 

 

References

 

 

 

 

 

 

Credits

 

 

 


Photo by frank mckenna on Unsplash

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments

Far
Enough.

Said no pioneer ever.
MySQL, PostgreSQL, InnoDB, MariaDB, MongoDB and Kubernetes are trademarks for their respective owners.
© 2026 Percona All Rights Reserved