Scale your Cluster

How to scale Hydrolix with Kubernetes

Basic Scaling

Altering the Scale of your cluster is most easily achieved through Kubernetes using the edit command. Hydrolix has both Stateful and Stateless components and editing of these components need to take this into account.

Stateful components

ServiceDescription
postgresCore
redpandaIngest
prometheusReporting and Control

Stateless Components

ServiceDescriptionServiceDescription
alter-peerAlter Jobsquery-headQuery
batch-headIngestquery-peerQuery
batch-peerIngestreaperData Lifecycle
decayData Lifecyclestream-headIngest
intake-apiIngeststream-peerIngest
kafka-peerIngestturbine-apiQuery
keycloakCoretraefikCore
merge-headMergeversionCore
merge-peerMergezookeeperCore
operatorKubernetes Operator
kubectl edit hydrolixcluster --namespace="$HDX_KUBERNETES_NAMESPACE"

🚧

Stateful Persistent Volume changes

You can only increase persistent volume storage, decreasing the PVC size will not work

Advanced and Pre-defined scaling options

Hydrolix provides the ability through Kubernetes to define your own scale as well as for the user to use some pre-defined scaling options.

To either use these options or define your own configuration, you can use the hkt tool to give you a basic template for services. For example :

hkt hydrolix-cluster --scale-profile prod > hydrolixcluster.yaml

The output will look similar to the following:

apiVersion: hydrolix.io/v1
kind: HydrolixCluster
metadata:
  name: hdxcli-xxxyyyy
  namespace: hdxcli-xxxyyyy
spec:
  admin_email: [email protected]
  kubernetes_namespace: hdxcli-xxxyyyy
  hydrolix_url: https://host.hydrolix.net
  env:
    EMAIL_PASSWORD: XXXXXXYYYYYYYYZZZZZZZZ
  kubernets_profile: gcp  
  db_bucket_region: us-central1
  scale_profile: prod

The file can then be edited with your favourite text editor, adding and changing the components you require. For example altering the number of batch and alter-peers to 5 each.

.....
spec:
  .....
  db_bucket_region: us-central1
  scale:
    alter-peer:
        replicas: 5
    batch-peer:
        replicas: 5
    .....

Once ready the configuration is applied as follows:

kubectl apply -f hydrolixcluster.yaml

📘

Services with PVC Storage.

Some of the Services Hydrolix uses need to maintain state in order to provide a good level of High Availability and redundancy. The postgres, redpanda services use PVC storage and so when setting storage manually you should specify storage using the data_storage key.

Note PVC changes are also significant changes, and we recommend talking to us before making them.

❗️

Don't forget to apply your changes

kubectl apply -f hydrolixcluster.yaml

Predefined Scale

Hydrolix provides a shortcut to specify predefined scaling options. The scale for each setting is specified in the latter half of this page and can be found here - Predefined Scaling Profiles.

To specify the options they are placed in the top-level spec of your hydrolixcluster.yaml using the scale-profile key. The options available are:

  • prod - a fully resilient production deployment (1-4 TB/day)

  • mega - a fully resilient large scale production deployment (10-50 TB/day)

An example is shown below.

apiVersion: hydrolix.io/v1
kind: HydrolixCluster
metadata:
  name: hdxcli-xxxyyyy
  namespace: hdxcli-xxxyyyy
spec:
  admin_email: [email protected]
  kubernetes_namespace: hdxcli-xxxyyyy
  kubernets_profile: gcp
  env:
    EMAIL_PASSWORD: 
  hydrolix_url: https://host.hydrolix.net
  db_bucket_region: us-central1
  scale_profile: prod  <--- For the Prod Profile

Scale Profiles

📘

More Information

More information on Scale Profiles found here

Turn off everything

If you want to turn everything off you can do that by adding the following into the top level spec:
scale_off : true

.....
  kubernets_profile: gcp
  hydrolix_url: https://host.hydrolix.net
  env:
    EMAIL_PASSWORD: 
  db_bucket_region: us-central1
  scale_off : true  <--- To Turn everything off.

This will turn all stateless components off that can be turned off. This should be used with care.

Configuring Query Peer Pools

Hydrolix has the capability to create pools of services for specific workloads. Each Pool has a ring-fenced capacity so that a workload will not be affected by other processes or users querying data or ingesting data.

For example a query-pool can be created for a subset of users that is accessible only by them, with another pool being used by everyone else or a specific pool of kafka servers can be used for the ingesting of server logs, but another Kafka pool used for performance logs.

By having this capability it allows independent access and scaling of workload components without the need to overprovision a single architecture. In addition with query server components, Role Based Performance Control is also possible - so users can have access to different levels of performance based on their role within a company.

To create a pool you need to specify the pool name in the hydrolixcluster.yaml configuration file:

apiVersion: v1
items:
- apiVersion: hydrolix.io/v1
  kind: HydrolixCluster
  spec:
    pools:
    - name: demo-pool
      replicas: 1
      service: query-peer
      cpu: "1.0"

In the pool configuration you can specify the scale similarly to the scale configuration