Advanced Service Configuration

The serviceSpec section is an optional section that provides advanced configuration controls over the services that are allocated to handle DDL and DML queries.

In addition to objectMetaOverrides, you can specify the following options in this section:

  • type determines how the service is exposed. Valid options are ClusterIP, NodePort, or LoadBalancer. Default is LoadBalancer.

  • maLoadBalancerIP is a static IP address for the DDL Service (svc-<cluster-name>-ddl), which routes traffic to the Master Aggregator (MA).

  • caLoadBalancerIP is a static IP address for the DML Service (svc-<cluster-name>-dml), which routes traffic to child aggregators. Without this field, the DML Service is assigned a dynamic address.

  • loadBalancerIP is a deprecated, equivalent form of maLoadBalancerIP, when set alone, the Operator applies it to the DDL Service only. SingleStore recommends using maLoadBalancerIP and caLoadBalancerIP in new configurations.

  • loadBalancerSourceRanges specifies the list of CIDR blocks to add to the load balancer.

  • externalTrafficPolicy specifies if the service routes external network traffic to either node-local or cluster-wide endpoints. Valid options are Local or Cluster. Default is Cluster.

  • headless specifies whether the service is a headless service or not. A headless service keeps track of its selected pods, but otherwise does not enable any network functionality.

If you need to specify these values, add the following section to the sdb-cluster.yaml file as shown below.

serviceSpec:
type: "LoadBalancer"
maLoadBalancerIP: "1.2.3.4"
caLoadBalancerIP: "1.2.3.5"
loadBalancerSourceRanges: [ "0.0.0.0/0" ]
externalTrafficPolicy: "Cluster"
headless: false
objectMetaOverrides:
labels:
custom: label
annotations:
custom: annotations

Note

To pin a static IP on the DDL Service only (and keep the DML Service on a dynamic address), set maLoadBalancerIP and remove caLoadBalancerIP. To pin static IPs on both Services, set both fields.

Refer to the Kubernetes documentation for more information about these attributes.

By default, the nodes are assigned public IPs. You must add annotations for the nodes to be assigned private IPs.

Note

If you configure Disaster Recovery and your source and target clusters are located in different Kubernetes clusters, you must use an externally accessible service type (LoadBalancer or NodePort). ClusterIP cannot be used for cross-cluster replication because it is accessible only within a single Kubernetes cluster.

As of Operator 1.2.4, service creation can be disabled by setting the disableDDLAndDMLService field to true in serviceSpec. This will ignore all other fields in serviceSpec, will not create new services, and will delete those services that were already created.

serviceSpec:
disableDDLAndDMLService: true

Example: Service Configuration with Replication

apiVersion: memsql.com/v1alpha1
kind: MemsqlCluster
metadata:
name: sdb-cluster
spec:
license: <license_key>
adminHashedPassword: "<hashed_password>"
serviceSpec:
type: LoadBalancer
externalTrafficPolicy: Cluster
replicationSpec:
enable: true
connectivity: viaHost
nodeImage:
repository: singlestore/node
tag: alma-8.7.10-28804d3b1b
redundancyLevel: 2
aggregatorSpec:
count: 2
cores: 8
memoryMB: 32768
storageGB: 256
leafSpec:
count: 2
cores: 8
memoryMB: 32768
storageGB: 512

By default, nodes are assigned public IPs. To assign private IPs, add the appropriate annotations to your Kubernetes service or node configuration.

Last modified:

Was this article helpful?