Now that your various object definition files are created, you will use
kubectl to do the actual object creation and cluster deployment.
Install the RBAC resources.
kubectl create -f rbac.yaml
Install the MemSQL Cluster cluster resource definition.
kubectl create -f memsql-cluster-crd.yaml
Deploy the MemSQL Operator.
kubectl create -f deployment.yaml
Verify the deployment was successful by checking the status of the pods in your Kube cluster. You should see the MemSQL Operator with a status of
kubectl get pods
Finally, create the MemSQL cluster.
kubectl create -f memsql-cluster.yaml
After a couple minutes, run
kubectl get podsagain to verify the aggregator and leaf nodes all started and have a status of
kubectl get pods
If you see no pods are in the
Runningstate, then run
kubectl get statefulsetsto see if the statefulsets are running. If you need to debug an inoperable cluster, check the Operator logs by running
kubectl logs deployment memsql-operatorand then look at the various objects to see what is failing.
Accessing your cluster
The MemSQL Operator creates two services intended for access by clients and database users:
- One created service has “DML” in its name. Use the DML endpoint (load balancer amongst other aggregators) for read/write workloads.
- The other created service has “DDL” in its name. Use the DDL endpoint for creating tables.
To connect to the MemSQL cluster, run the following from a machine that can access the Kubernetes cluster. Use the
admin database user with the password you defined when creating the
memsql-cluster.yaml definition file.
mysql -u admin -h <hostname> -P <port> -p<password>
Scaling and managing your cluster
Currently, the MemSQL Operator supports scaling and changing the following parts of the
Deleting your cluster
To delete the MemSQL cluster, run the following:
kubectl delete -f memsql-cluster.yaml