You are viewing an older version of this section. View current production version.
Helm Chart for IBM Cloud Pak for Data
Introduction
Use these steps to deploy SingleStore DB (MemSQL) in a Kubernetes environment via the Helm chart for IBM Cloud Pak for Data®.
Cluster Admin Prerequisites
-
Determine the project (namespace) in which to deploy SingleStore DB. SingleStore suggests deploying in the same project where the IBM Cloud Pak for Data control plane is installed
-
Determine which
StorageClassto use.Avoid using a
StorageClasswith an NFS-based provisioner. Ideally, you should choose aStorageClassthat uses a block storage-based provisioner that supports volume expansion and theWaitForFirstConsumerbinding mode.While cluster admin privileges are required to query or create a
StorageClass, they are not required to use theStorageClassin the deployment. -
Run the following command to determine the
fsGroupto use for the deployment.oc get project <project-name> -o=jsonpath=\ '{.metadata.annotations.openshift\.io/sa\.scc\.supplemental-groups}{"\n"}'This command’s output will be similar to
1096160000/10000. Note that the actual numbers may differ. Copy the number before the slash (/) as this is thefsGroupID that will be required in a later step. -
To deploy the required CRD, save the following content in a file named
memsql-cluster-crd.yaml.apiVersion: apiextensions.k8s.io/v1beta1 kind: CustomResourceDefinition metadata: name: memsqlclusters.memsql.com spec: group: memsql.com names: kind: MemsqlCluster listKind: MemsqlClusterList plural: memsqlclusters singular: memsqlcluster shortNames: - memsql scope: Namespaced version: v1alpha1 subresources: status: {} additionalPrinterColumns: - name: Aggregators type: integer description: Number of MemSQL Aggregators JSONPath: .spec.aggregatorSpec.count - name: Leaves type: integer description: Number of MemSQL Leaves (per availability group) JSONPath: .spec.leafSpec.count - name: Redundancy Level type: integer description: Redundancy level of MemSQL Cluster JSONPath: .spec.redundancyLevel - name: Age type: date JSONPath: .metadata.creationTimestamp -
Run the following command to apply the CRD file.
oc apply -f memsql-cluster-crd.yaml
Deployment Prerequisites
-
Obtain a SingleStore license from the SingleStore Customer Portal.
-
Select the SingleStore DB images to use. Two Docker images are required for the deployment.
The node image is the SingleStore DB database engine, and can be found on Docker Hub.
The Operator image is used to manage the SingleStore DB engine deployment in Kubernetes environment, and can also be found on Docker Hub.
If you opt to deploy in an air-gapped environment (an environment with no outside connectivity), you must first pull these two images down and then upload them to your private Docker registry.
To do so, run the following commands for both the node image and the Operator image. Note that these commands may differ depending on the images selected.
docker pull memsql/node:centos-7.1.12-4ee69e2d18
docker tag docker pull memsql/node:centos-7.1.12-4ee69e2d18 \
<private_registry>/memsql/node:centos-7.1.12-4ee69e2d18
docker push <private_registry>/memsql/node:centos-7.1.12-4ee69e2d18
Deploy SingleStore DB/MemSQL
-
Run the following commands to add the SingleStore Helm chart for IBM Cloud Pak for Data.
helm repo add singlestoredb-ibmcloudpakfordata-charts https://helm.singlestore.com/ibmcloudpakfordata **** "singlestoredb-ibmcloudpakfordata-charts" has been added to your repositorieshelm repo list **** NAME URL singlestoredb-ibmcloudpakfordata-charts https://helm.singlestore.com/ibmcloudpakfordatahelm search repo singlestoredb-ibmcloudpakfordata-charts -o yaml **** - app_version: "" description: SingleStore DB for IBM Cloud Pak for Data name: singlestoredb-ibmcloudpakfordata-charts/singlestoredb-ibmcloudpakfordata version: 1.0.0The last command will list the Helm chart versions that
singlestoredb-ibmcloudpakfordata-chartsoffers. Select the desired chart version. -
Authenticate with the OpenShift API server.
oc login OpenShift_URL:port -
Switch to the project that you selected in Cluster Admin Prerequisites.
oc project <project-name> -
Create a
values-override.yamlfile to customize your deployment. Run the following command to see an example ofvalues-override.yamlfile.helm show readme \ singlestoredb-ibmcloudpakfordata-charts/singlestoredb-ibmcloudpakfordataUse the
StorageClassthat you selected in Cluster Admin Prerequisites.Substitute the
fsGroupvalue with the value you copied in Cluster Admin Prerequisites.In general, when creating the
values-override.yamlfile, you may want/need to customize the following configuration values:operatorImage nodeImageRepo nodeImageTag nodeImageVersion coresPerUnit memoryPerUnit memsqlCluster: # choose either license or licenseSecret, but not both license licenseSecret: name Key # choose either adminHashedPassword or adminHashedPasswordSecret, but not both adminHashedPassword adminHashedPasswordSecret: name key aggregatorSpec: Count height storageGB leafSpec: count: height storageGB -
Run the following command to deploy SingleStore DB.
helm install <deployment-name> singlestoredb-ibmcloudpakfordata-charts/singlestoredb-ibmcloudpakfordata \ [--version x.y.z] -f values-override.yamlNot that the version (
--version x.y.z) is optional. -
Wait for the deployment to complete and run the following commands. Note that
${CLUSTER_NAME}is the{{ .Values.memsqlCluster.name }}from the Helm chart.CLUSTER_NAME=$(helm get values -a -o \ json <deployment-name> | jq -r '.memsqlCluster.name')oc get memsqlcluster ${CLUSTER_NAME} -o=jsonpath='{.status.phase}{"\n"}'The SingleStore DB server deployment is complete when
Runningis displayed after running the above commands. -
After the deployment completes, run the following command to display the two SingleStore DB service endpoints that are created during the deployment.
oc get svc | grep ${CLUSTER_NAME}The
svc-${CLUSTER_NAME}-ddlandsvc-${CLUSTER_NAME}-dmlservice endpoints can be used to connect to SingleStore DB using a MySQL compatible client. Note thatsvc-${CLUSTER_NAME}-dmlonly exists if{{ .Values.memsqlCluster.aggregatorSpec.count }}is greater than1.The output will resemble the following (actual values will vary):
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE svc-memsql-cluster ClusterIP None <none> 3306/TCP 42h svc-memsql-cluster-ddl LoadBalancer 172.21.29.233 169.46.26.10 3306:32278/TCP 42h svc-memsql-cluster-dml LoadBalancer 172.21.6.77 169.46.26.11 3306:30922/TCP 42hYou may also obtain DDL and DML endpoints from the SingleStore DB cluster status using the following commands:
oc get memsqlcluster ${CLUSTER_NAME} -o jsonpath='{.status.ddlEndpoint}{"\n"}'oc get memsqlcluster ${CLUSTER_NAME} -o jsonpath='{.status.dmlEndpoint}{"\n"}'The output will resemble the following (actual values will vary):
169.46.26.10:3306 169.46.26.11:3306Refer to Data Definition Language (DDL) and Data Manipulation Language (DML) for more information.
Resources
-
Refer to the SingleStore DB (MemSQL) Operator Introduction for a general deployment guide in a Kubernetes environment.
-
Refer to the SingleStore DB (MemSQL) Operator Reference Overview for detailed configuration information.
-
SingleStore DB Data Definition Language (DDL) reference
-
SingleStore DB Data Manipulation Language (DML) reference