Skip to main content

sdb-operator.yaml

Create a deployment definition file using the template below.

The --cluster-id argument must match the name of the SingleStoreDB custom resource as defined in the sdb-cluster.yaml ("sdb-cluster" by default). This value can be edited as long as these values match, so that the Operator knows which custom resource to manage.

apiVersion: apps/v1
kind: Deployment
metadata:
  name: sdb-operator
  labels:
    app.kubernetes.io/component: operator
spec:
  replicas: 1
  selector:
    matchLabels:
      name: sdb-operator
  template:
    metadata:
      labels:
        name: sdb-operator
    spec:
      serviceAccountName: sdb-operator
      containers:
        - name: sdb-operator
          image: operator_image_tag
          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",
            "--cluster-id", "sdb-cluster"          ]
          env:
            - name: WATCH_NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
            - name: POD_NAME
              valueFrom:
                fieldRef:
                  fieldPath: metadata.name
            - name: OPERATOR_NAME
              value: "sdb-operator"

You must edit this file and replace operator_image_tag with the either the local singlestore/operator Docker image you pulled down (such as "sdb-operator"), or add in an imagePullSecrets section under the spec section and reference a Kubernetes Secret that you can create via kubectl apply.

Refer to the Kubernetes documentation for more information on imagePullPolicy and creating Secrets.