MemSQL Kubernets deployment failed on "WATCH_NAMESPACE must be set"

Trying to deploy the memsql cluster using Kubernetes using the official document, I can successfully start the memsql-operator, but the master node instance running fail on the error:

|2020/02/10 23:44:50 main.go:54|{cmd}|Go Version: go1.11.5||
|—|—|—|—|
|2020/02/10 23:44:50 main.go:55|{cmd}|Go OS/Arch: linux/amd64||
|2020/02/10 23:44:50 main.go:56|{cmd}|Version of operator-sdk: v0.2.1||
|2020/02/10 23:44:50 main.go:57|{cmd}|Commit Hash: de65d489||
|2020/02/10 23:44:50 main.go:59|{cmd}|Options:||
|2020/02/10 23:44:50 main.go:60|{cmd}|–cores-per-unit: 8.000000||
|2020/02/10 23:44:50 main.go:61|{cmd}|–memory-per-unit: 32.000000||
|2020/02/10 23:44:50 main.go:62|{cmd}|–overpack-factor: 0.000000||
|2020/02/10 23:44:50 main.go:63|{cmd}|–extra-cidrs: []||
|2020/02/10 23:44:50 main.go:64|{cmd}|–external-dns-domain-name: {false }||
|2020/02/10 23:44:50 main.go:65|{cmd}|–external-dns-ttl: {false 0}||
|2020/02/10 23:44:50 main.go:66|{cmd}|–ssl-secret-name: ||
|2020/02/10 23:44:50 main.go:67|{cmd}|–merge-service-annotations: false||
|2020/02/10 23:44:50 main.go:47|{cmd}|Failed to get watch namespace|error: “WATCH_NAMESPACE must be set”|

This is while according to the official document, I have defined the variable WATCH_NAMESPACE on the file deploymet.yaml

Could anyone help me with this?

1 Like

Hi Soheil, can you share the deployment.yaml configuration file you are using? Please make sure to remove your license and password before sharing.

Hi and thank for your reply
Here is my deployment.yaml, according to the documentation
The license and pass are set on the file memsql-cluster.yaml

apiVersion: apps/v1
kind: Deployment
metadata:
  name: memsql-operator
spec:
  replicas: 1
  selector:
    matchLabels:
      name: memsql-operator
  template:
    metadata:
      labels:
	name: memsql-operator
    spec:
      serviceAccountName: memsql-operator
      containers:
        - name: memsql-operator
          image: "memsql/operator"
          imagePullPolicy: Always
          args: [
            # Cause the operator to merge rather than replace annotations on services
            "--merge-service-annotations",
            # Allow the process inside the container to have read/write access to the `/var/lib/memsql` volume.
            "--fs-group-id", "5555"
          ]
          env:
            - name: WATCH_NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
            - name: POD_NAME
              valueFrom:
                fieldRef:
                        fieldPath: metadata.name
            - name: OPERATOR_NAME
              value: "memsql-operator"

I have 3 node Kubernetes cluster, one master and 2 slave
The memsql-operator image has been already pulled on the slaves