With the arrival of the cloud, organizations face new opportunities – and new challenges. Chief among them is how to take the greatest advantage of public and private cloud resources without being locked into a specific cloud or being barred from access to existing infrastructure. Container solutions such as Docker offer part of the solution, making it much easier to develop, deploy, and manage software. In our webinar, product manager Micah Bahti describes how to take advantage of the next step: Using Kubernetes, and the MemSQL Kubernetes Operator, to manage containers across public clouds and existing infrastructure.
Until recently, however, Kubernetes didn’t manage stateful services. Recently, that support has been added, and MemSQL has stepped into a leading position. Ahead of other widely used database platforms, MemSQL has developed and made available a Kubernetes Operator. The Operator was announced at Red Hat Summit early in May. You can easily get the Operator, for either Open Shift or open source Kubernetes.
You can use the Operator, currently in beta, to easily deploy and manage MemSQL clusters. Like Kubernetes itself, the Operator works smoothly across operating systems, platforms, clouds, and privately held infrastructure.
Note: As stated above, the MemSQL Kubernetes operator is currently in beta. It will reach general availability in the coming months.
You can also use the Operator with MemSQL on small deployments, including free instances of MemSQL. It scales smoothly to large databases as well; MemSQL scales to databases in the petabytes.
Deploying and Installing Kubernetes for MemSQL
Deploying and installing Kubernetes for MemSQL is very similar to using Kubernetes with other, stateless software. First, find the needed components. They’re available in the OpenShift container catalog and on Docker Hub.
To start deployment, load the image of the MemSQL Kubernetes Operator and the configuration files into your Kubernetes cluster.
Then, edit the YAML file, memsql-cluster.yaml, to define the attributes of your cluster. The most important is the size of the cluster, in gigabytes. One of the advantages of Kubernetes is that it’s very easy to change this later, quickly and at no cost. For other attributes, the minimum configuration for production should be:
- 1 leaf unit @ height 1
- 3 aggregator units @ height 0.5
- redundancyLevel = 2
Note: You can’t downsize a cluster below the amount of data in it. For instance, if you create a 2GB cluster, then put 1.1GB of data in it, telling Kubernetes to downsize the cluster to 1GB will result in an error message.
Finally, create the cluster, and manage it using kubectl. You can connect to the cluster with mysql.
Benefits of Using MemSQL with Kubernetes
Because MemSQL offers fast, scalable SQL, the combination of the MemSQL database and the Kubernetes Operator gives you the ability to use a single relational database for transactions and analytics, without the need to move data. MemSQL easily ingests data from a range of sources and supports analytics platforms such as Looker, PowerBI, and Tableau.
When you use MemSQL with Kubernetes, you get complete freedom to deploy or redeploy across physical or cloud infrastructure, as needed. Installation and deployment take minutes, not days or weeks; scaling is elastic; upgrades happen smoothly online. You can upgrade supporting hardware or software, with no effect on your MemSQL cluster.