Services and Networking
Configure the default headless service and custom ClusterIP, NodePort, and LoadBalancer services for GridGain 9 clusters managed by the Kubernetes Operator.
The operator automatically creates a headless service for internal cluster communication. Additionally, you can define any number of additional services to expose the cluster to applications inside or outside the Kubernetes cluster.
Default Headless Service
The operator creates a headless service named <cluster-name>-headless for each GridGain9Cluster. This service provides stable DNS names for each pod in the StatefulSet, which GridGain nodes use to discover each other. The node finder configuration in gridgainConfig typically references this service:
spec:
gridgainConfig:
content: |
ignite {
network {
nodeFinder {
netClusterNodes=[
"my-cluster-headless:27100"
]
type=STATIC
}
port=27100
}
}You do not need to create this service yourself. The operator creates it automatically.
Custom Services
You can define additional services under spec.services. Each entry requires a name, a type, and at least one port. The operator creates a Kubernetes Service named <cluster-name>-<service-name> for each entry.
The supported service types are ClusterIP, NodePort, LoadBalancer, and Headless.
ClusterIP
A ClusterIP service makes the cluster reachable from within the Kubernetes cluster. This is the default service type and is suitable for applications running alongside GridGain:
NodePort
A NodePort service exposes the cluster on a static port on every Kubernetes node. Node ports must be in the range 30000-32767:
LoadBalancer
A LoadBalancer service provisions a cloud load balancer that routes external traffic to the cluster. This is the recommended approach for production deployments in cloud environments:
Setting externalTrafficPolicy to Local preserves client source IP addresses but requires that the load balancer only sends traffic to nodes that have a GridGain pod running. The default policy is Cluster, which distributes traffic across all nodes at the cost of an extra hop.
Service Annotations
Cloud providers often use annotations to configure load balancer behavior. Pass them through the annotations field on the service definition:
Session Affinity
For services that benefit from sticky sessions, set sessionAffinity to ClientIP. The default is None:
Multiple Services
You can define multiple services on a single cluster to serve different access patterns. For example, an internal ClusterIP for pod-to-pod communication, a LoadBalancer for external REST API access, and a NodePort for client driver connections:
Each service is independent and can have its own type, ports, annotations, and traffic policies.
This page is: Copyright © 2026 MariaDB. All rights reserved.
Last updated
Was this helpful?

