Generic Configuration
A generic, step-by-step guide to deploying and managing GridGain server nodes on Kubernetes using a StatefulSet, covering configuration, licensing, probes, activation, scaling, and connectivity.
Introduction
In this tutorial, we will use StatefulSet to manage GridGain cluster in Kubernetes. We will create both in-memory and persistent clusters.
Kubernetes Configuration
Kubernetes configuration involves creating the following resources:
A namespace
A cluster role
A ConfigMap for the node configuration file
A ConfigMap for the license file if you use Enterprise or Ultimate Edition
A service to be used for discovery and load balancing when external apps connect to the cluster
A configuration for pods running GridGain nodes
Creating Namespace
Create a unique namespace for your deployment. In our case, the namespace is called "gridgain".
Create the namespace using the following command:
Creating Service
The Kubernetes service is used for auto-discovery and as a load-balancer for external applications that connect to your cluster.
Every time a new node is started (in a separate pod), the IP finder connects to the service via the Kubernetes API to obtain the list of the existing pods' addresses. The new node uses this addresses to discover all cluster nodes.
Create the service:
Creating Cluster Role and Service Account
Create a service account:
A cluster role is used to grant access to pods. The following file is an example of a cluster role:
Run the following command to create the role and a role binding:
Creating ConfigMap for Node Configuration File
We create a ConfigMap that keeps the node configuration file so that every node can use it. This allows you to keep a single instance of the configuration file for all nodes.
Let's create a configuration file first. Choose one of the tabs below, depending on whether you use persistence or not.
We must use the TcpDiscoveryKubernetesIpFinder IP finder for node discovery. This IP finder connects to the service via the Kubernetes API and obtains the list of the existing pods' addresses. The new node uses these addresses to discover all other cluster nodes.
The file looks like this:
In the configuration file, we:
Enable native persistence and specify the
workDirectory,walPath, andwalArchivePath. These directories are mounted in each pod that runs a GridGain node. Volume configuration is part of the pod configuration.Use the
TcpDiscoveryKubernetesIpFinderIP finder. This IP finder connects to the service via the Kubernetes API and obtains the list of the existing pods' addresses. The new node uses these addresses to discover all other cluster nodes.
The file looks like this:
The namespace and serviceName properties of the IP finder must be the same as specified in the service configuration. Add other properties as required for your use case.
To create the ConfigMap, run the following command in the directory with the node-configuration.xml file.
Providing License File
If you use GridGain Enterprise or Ultimate Edition, you must provide the license file. You can provide the license file as a link to a remote resource, or you can mount the file to each pod.
License via URL
Use the LICENSE_URI variable as described in the Docker documentation in the pod specification file. See the example in the Creating Pod Configuration section.
License via ConfigMap
Create a ConfigMap from the license file by running the following command. The --from-file option must point to an existing license file.
Use this config map ('gridgain-license') to mount the license in the pod configuration. The file must be mounted under the path of the default license file available in the GRIDGAIN-HOME directory. See the example in the Creating Pod Configuration section below.
Creating Pod Configuration
Now we create a configuration for pods that use a StatefulSet.
Our configuration deploys 2 pods running GridGain Enterprise Edition 8.10. If you want to use Ultimate Edition, change the spec.template.spec.containers.image property in the configuration file.
In the container's configuration we:
Enable the "ignite-kubernetes" and "ignite-rest-http" modules.
Use the configuration file from the ConfigMap we created earlier.
Mount volumes for the work directory (where application data is stored), WAL files, and WAL archive.
Open a number of ports:
47100 — the communication port
47500 — the discovery port
49112 — the default JMX port
10800 — thin client/JDBC/ODBC port
8080 — REST API port
The StatefulSet configuration file might look like as follows:
Note the spec.volumeClaimTemplates section, which defines persistent volumes provisioned by a persistent volume provisioner. The volume type depends on the cloud provider. You can have more control over the volume type by defining storage classes.
Create the StatefulSet by running the following command:
Check if the pods were created correctly:
Check the logs of the nodes:
The string servers=2 in the last line indicates that the two nodes joined into a single cluster.
Readiness Probe
The readiness probe controls when a pod starts receiving traffic from the Kubernetes Service. It uses the PROBE REST command with kind=readiness argument, which reports the node as ready only after it has finished pulling its partitions. This keeps Kubernetes from routing traffic to a node that is still rebalancing.
Liveness Probe
The liveness probe controls when Kubernetes restarts an unhealthy pod. It uses the PROBE REST command with kind=liveness argument, which checks only that the Ignite kernel has started; a node that is rebalancing or in maintenance mode is still considered alive and is not restarted.
Startup Probe
The startup probe gives a (re)joining node time to complete its initial rebalance before the liveness probe takes over. It uses the same kind=readiness check as the readiness probe.
Draining a Node
To take a pod out of rotation before a rolling restart, send the DRAIN REST command with action=start argument. This sets the node's drain flag, which makes the readiness probe report 503 so that Kubernetes stops routing new traffic to the pod before it is terminated. Send DRAIN command with action=stop argument to clear the flag and return the node to normal readiness behavior. The flag is held in node memory and is cleared automatically when the pod restarts.
Activating the Cluster
If you use a stateless cluster, skip this step: a cluster without persistence does not require activation.
If you are using persistence, you must activate the cluster after it is started. To do that, connect to one of the pods:
Execute the following command:
You can also activate the cluster using the REST API. Refer to the Connecting to the Cluster section for details about connection to the cluster's REST API.
Scaling the Cluster
You can add more nodes to the cluster by using the kubectl scale command.
In the following example, we bring up one more node (we had two).
To scale your StatefulSet, run the following command:
To scale your StatefulSet, run the following command:
After scaling the cluster, change the baseline topology accordingly.
Connecting to the Cluster
If your application is also running in Kubernetes, you can use either thin clients or client nodes to connect to the cluster.
Get the public IP of the service:
You can use the LoadBalancer Ingress address to connect to one of the open ports. The ports are also listed in the output of the command.
Connecting Client Nodes
A client node requires connection to every node in the cluster. The only way to achieve this is to start a client node within Kubernetes. You need to configure the discovery mechanism to use TcpDiscoveryKubernetesIpFinder, as described in the Creating ConfigMap for Node Configuration File section.
Connecting with Thin Clients
The following code snippet illustrates how to connect to your cluster using the java thin client. You can use other thin clients in the same way. Note that we use the external IP address (LoadBalancer Ingress) of the service.
Connecting to REST API
Connect to the cluster's REST API as follows:
This page is: Copyright © 2026 MariaDB. All rights reserved.
Last updated
Was this helpful?

