Scaling and Upgrading a Hazelcast Deployment

To scale an existing Hazelcast deployment, there are two options:

  • Modify the yaml definition you used to deploy Hazelcast cluster by updating clusterSize field and re-apply it again:

    Assuming the following is the existing configuration:

    apiVersion: hazelcast.com/v1alpha1
    kind: Hazelcast
    metadata:
      name: hazelcast-sample
    spec:
      clusterSize: 3

    and you want to scale your deployment to five replicas, you need to apply the following:

    apiVersion: hazelcast.com/v1alpha1
    kind: Hazelcast
    metadata:
      name: hazelcast-sample
    spec:
      clusterSize: 5
  • To scale an existing Hazelcast deployment, use the following command:

    kubectl scale hazelcast <name> --replicas <replica-count>

    Example:

    kubectl scale hazelcast hazelcast-sample --replicas 5

Upgrading

Before upgrading, we recommend that you to read Rolling Upgrades information.

To upgrade your existing deployment to a newer version, you need to update spec.version field and re-apply. For example:

Assuming the following is the existing configuration:

apiVersion: hazelcast.com/v1alpha1
kind: Hazelcast
metadata:
  name: hazelcast-sample
spec:
  clusterSize: 3
  repository: 'docker.io/hazelcast/hazelcast'
  version: '5.2.4-slim'

and you want to upgrade your Hazelcast version to 5.3.5, you need to apply the following:

apiVersion: hazelcast.com/v1alpha1
kind: Hazelcast
metadata:
  name: hazelcast-sample
spec:
  clusterSize: 3
  repository: 'docker.io/hazelcast/hazelcast'
  version: '5.3.5-slim'