Singlestore deployment in Kubernetes

I am trying to setup MemSQL on Kubernetes for some POC and just following the document below.

SingleStore Blog.

Pod logs,

2021-01-06 20:01:38.945756 Initializing MemSQL Cluster in a Box

2021-01-06 20:01:38.945845 Creating…

2021-01-06 20:01:39.344994 Done.

2021-01-06 20:01:39.345069 Configuring…

2021-01-06 20:01:40.290380 Done.

2021-01-06 20:01:40.290517 Bootstrapping…

2021-01-06 20:01:45.668365 Done.

2021-01-06 20:01:45.668436 Configuring Toolbox…

2021-01-06 20:01:45.680564 Done.

Successful initialization!

To start the cluster:

docker start (CONTAINER_NAME)

To stop the cluster (must be started):

docker stop (CONTAINER_NAME)

To remove the cluster (all data will be deleted):

docker rm (CONTAINER_NAME)

Do we need to explicitly start?

Env —>

env:

    # 'Y' means keep running after cluster init

    - name: START_AFTER_INIT

      value: 'Y'

Hi udayabaski, without the START_AFTER_INIT in the deployment yaml SingleStore will initialize and then immediately stop. I would recommend setting this to ‘Y’ in the deployment unless you are specifically debugging something where you don’t need SingleStore running.

Hi, I am setting START_AFTER_INIT to ‘Y’ as per the documentation. But, still it is not starting.

And this is what I see in the pod logs.

2021-01-06 20:01:38.945756 Initializing MemSQL Cluster in a Box

2021-01-06 20:01:38.945845 Creating…

2021-01-06 20:01:39.344994 Done.

2021-01-06 20:01:39.345069 Configuring…

2021-01-06 20:01:40.290380 Done.

2021-01-06 20:01:40.290517 Bootstrapping…

2021-01-06 20:01:45.668365 Done.

2021-01-06 20:01:45.668436 Configuring Toolbox…

2021-01-06 20:01:45.680564 Done.

Successful initialization!

To start the cluster:

docker start (CONTAINER_NAME)

To stop the cluster (must be started):

docker stop (CONTAINER_NAME)

To remove the cluster (all data will be deleted):

docker rm (CONTAINER_NAME)

Please confirm that you are defining START_AFTER_INIT inside the container using the -e flag:

docker run -i --init \
  --name memsql-ciab \
  -e LICENSE_KEY=$LICENSE \
  -e START_AFTER_INIT=Y \
  -p 3306:3306 -p 8080:8080 \
  memsql/cluster-in-a-box

Also if you want to run the container in the background use -d instead of -i

Please read the post. I am trying to deploy into Kubernetes based on the doc SingleStore Blog.

Deployment.yaml file for your reference,

# A deployment ensures pod(s) are restarted on failure
apiVersion: apps/v1
kind: Deployment
metadata:
  name: memsql
spec:
  replicas: 1 # only create one pod (container)
  selector:
    matchLabels:
      app: memsql
  template:
    # Here's the definition of the pod:
    metadata:
      # The service finds all pods with matching metadata
      labels:
        app: memsql
    spec:
      containers:
      - name: memsql
        resources:
          limits:
            cpu: "4"
            memory: 16Gi
          requests:
            cpu: "1"
            memory: 2Gi
        # Cluster-in-a-box image is pulled from Docker Hub
        image: docker/cluster-in-a-box:latest
        ports:
        - containerPort: 3306 # MemSQL db
        - containerPort: 8080 # MemSQL Studio
        env:
        # 'Y' means keep running after cluster init
        - name: START_AFTER_INIT
          value: 'Y'
        # TODO: set to your desired password
          name: ROOT_PASSWORD
          value: 'Password'
        # TODO: paste your license key from portal.memsql.com here:
        - name: LICENSE_KEY
          value: <LICENSE_KEY>

Which version of the cluster-in-a-box image did you pull? Can you test the code I pasted above using your docker image to verify that it is working as expected? Easier to debug without Kubernetes getting in the way.

I just verified that the latest version of the docker image works as expected. Note you also need -e ROOT_PASSWORD="testing"

I am using the latest docker image. cluster-in-a-box:latest. It works with the below docker command, but not with the yaml file provided in your documentation. Could be the issue with the way we set the env variable

docker run -i --init
–name memsql-ciab
-e LICENSE_KEY=LICENSE
-e ROOT_PASSWORD=Password
-e START_AFTER_INIT=Y
-p 3306:3306 -p 8080:8080
docker/cluster-in-a-box

My bad, there was some special char and works now after removing the special char. Sorry for the confusion.

No worries! Happens to the best of us :slight_smile:

If you have any other issues don’t hesitate to reach out! Enjoy SingleStore.