To use embedded Hazelcast on Kubernetes, package a Hazelcast member in each application replica, disable multicast, configure Kubernetes discovery, grant the required permissions if using API discovery, and deploy the application. The replicas’ Hazelcast members can then discover one another and form a cluster. This differs from deploying a separate Hazelcast cluster that application instances connect to as clients.
What “embedded Hazelcast” means on Kubernetes
In an embedded topology, each application replica starts its own Hazelcast member inside the JVM. Scaling the application therefore changes the number of Hazelcast members as well. Hazelcast’s embedded Kubernetes tutorial demonstrates this pattern with a Spring Boot application and two replicas; the tutorial reports that their members form one cluster.
This is a lifecycle choice, not just a discovery setting. If you want Hazelcast membership to scale and restart with the application, embedding may fit. If you want Hazelcast to have its own deployment lifecycle and serve applications independently, consider a separately deployed cluster instead.
Choose a Kubernetes discovery method
Hazelcast members need a way to find peer Pods. Hazelcast 5.7 documents Kubernetes API discovery and DNS lookup as options in its Kubernetes Auto Discovery guide.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
#1 Best Overall
| Method | How it finds members | Permissions and scope |
|---|---|---|
| Kubernetes API discovery | Queries the Kubernetes API for Pod addresses. | Requires suitable service-account permissions. Can group discovery by service, labels, or namespace. |
| DNS lookup | Resolves Pod IP addresses associated with a headless Service. | Does not require Kubernetes API permissions, but Hazelcast documents the approach as limited to one cluster per service. |
For API discovery, use a service name or label selector when the namespace contains other workloads. Hazelcast warns that namespace-only discovery can be disrupted by non-Hazelcast Pods in that namespace.
Configure the application
Add the Hazelcast dependency
Add the Hazelcast dependency that matches the application and Hazelcast version you intend to use: hazelcast or, for a Spring integration, hazelcast-spring. The official walkthrough uses Spring Boot, but its approach can be adapted to another JVM framework that includes Hazelcast.
Enable Kubernetes discovery
Place the configuration where the application loads Hazelcast settings. Hazelcast’s tutorial places a hazelcast.yaml file in the application resources. The minimal configuration shown there disables multicast and enables the Kubernetes plugin:
hazelcast:
network:
join:
multicast:
enabled: false
kubernetes:
enabled: true
This enables the plugin, but the selected discovery method and any service, label, or namespace grouping must also suit your cluster. Consult the Hazelcast 5.7 discovery options when configuring API or DNS discovery.
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Repair Windows errors before they cause bigger problemsFix Now →Grant API discovery permissions
When using Kubernetes API discovery, the plugin needs permission to query the Kubernetes API. Hazelcast’s tutorial provides an RBAC example for the default service account in the default namespace. Adapt the Role or ClusterRole bindings to the service account and namespace used by your application; do not apply that sample unchanged to a differently scoped workload. The tutorial says the RBAC step can be skipped on clusters that do not use RBAC.
DNS lookup avoids granting API permissions to the Hazelcast workload, but has the headless-Service and one-cluster-per-service constraints described above.
Rank #3
Build, deploy, and verify
- Build the JVM application. Include Hazelcast and package the discovery configuration with the application.
- Create a container image. Use the image in a Kubernetes Deployment for the application.
- Set the replica count. The tutorial uses two replicas as an example; each replica starts a Hazelcast member in this embedded arrangement.
- Inspect application logs. Confirm that the Hazelcast member list includes the expected replicas. The tutorial shows two members for its two-replica example; this is an example result, not a guarantee for every cluster.
Protect members during shutdowns and updates
Hazelcast 5.7 warns that abrupt termination of more members than the configured backup count can cause data loss. Its Kubernetes guidance recommends allowing enough time for graceful shutdown and data migration, enabling the graceful-shutdown hook, and using a RollingUpdate strategy that updates Deployment Pods one at a time.
- Set
terminationGracePeriodSecondslong enough for the member to shut down gracefully. - Enable Hazelcast’s graceful-shutdown hook and set its maximum graceful-shutdown wait to allow data migration to finish.
- Roll out Deployment changes one Pod at a time rather than terminating multiple members together.
Hazelcast states that the Platform Operator sets the listed graceful-shutdown properties for its managed deployment. For embedded members, configure and verify the behavior in your application deployment.
For additional failure-domain separation, Hazelcast documents zone-aware and node-aware partition grouping for Kubernetes API discovery. These options require API permissions and depend on Pods actually being distributed across zones or nodes as intended.
Decide how clients will connect
Clients inside the Kubernetes cluster
For an in-cluster client, Hazelcast recommends using the Kubernetes Service name in its client configuration.
Clients outside the cluster
External clients need an exposed service and network routing to the Hazelcast members. Hazelcast’s external-connection tutorial and Operator exposure guide describe different approaches for Unisocket and Smart clients:
| Client approach | Exposure pattern | What to plan for |
|---|---|---|
| Unisocket | A load-balancing service. | The service and network must route connections to the cluster. |
| Smart | A separate service per member. | Smart clients can direct partitioned-data requests to the partition owner, so member addresses must be reachable by the client. |
A LoadBalancer service requires the Kubernetes environment to allocate public IP addresses. NodePort requires network rules that make the selected node addresses and ports reachable. The required setup depends on the cluster environment.
Best Value
Embedded members or a separately deployed cluster?
Hazelcast’s production guidance recommends the Platform Operator for production-grade Kubernetes deployments and also documents Helm as a deployment route. Those approaches deploy Hazelcast as a cluster separate from the application’s embedded members; they are not simply alternative discovery settings for the same embedded topology. See Hazelcast’s Platform 5.7 deployment guidance and the Operator installation guide.
| Consideration | Embedded in application replicas | Separate Hazelcast deployment |
|---|---|---|
| Lifecycle | Changing application replicas also changes the number of Hazelcast members. | Hazelcast has a deployment lifecycle separate from the application. |
| Operations | Package Hazelcast and discovery configuration with the JVM application. | Hazelcast documents the Operator and Helm as Kubernetes deployment routes and recommends the Operator for production-grade deployments. |
| Client access | Clients need a reachable address for the embedded members, using in-cluster service naming or external exposure as appropriate. | Applications connect as clients to the separately deployed cluster. |
Choose based on the lifecycle you want and how you will manage discovery, upgrades, failure handling, and client connectivity. The Operator and Helm guidance concerns operating a separate Hazelcast cluster, while the embedded tutorial concerns Hazelcast members that run as part of the application replicas.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

