Kubernetes Deployment Overview
Discover ways to deploy Hazelcast clusters in Kubernetes environments.
Before deploying Hazelcast on Kubernetes, consider the following:
Your Java Runtime Environment (JRE) must support TLS 1.2, which is the case for most modern JREs.
We recommend using Kubernetes StatefulSet for managing Hazelcast Pods. If you use Deployment (or ReplicationController), your Hazelcast cluster may start with a split brain, but will eventually recover to form one consistent cluster within a few minutes.
Hazelcast CP Subsystem can be used safely in Kubernetes only if CP Subsystem Persistence is enabled (Enterprise Feature). Otherwise, a CP Subsystem Group may not recover after scaling the cluster or performing the rolling upgrade operation.
If you just want to play with Hazelcast on Kubernetes, execute the following commands to create a Hazelcast cluster
with 3 members in the
default namespace using the
default Service Account.
kubectl apply -f https://raw.githubusercontent.com/hazelcast/hazelcast/master/kubernetes-rbac.yaml kubectl run hazelcast-1 --image=hazelcast/hazelcast:$HAZELCAST_VERSION kubectl run hazelcast-2 --image=hazelcast/hazelcast:$HAZELCAST_VERSION kubectl run hazelcast-3 --image=hazelcast/hazelcast:$HAZELCAST_VERSION
Hazelcast members automatically discover themselves and form one Hazelcast cluster.
|For production-grade Kubernetes deployment, use Helm chart or Kubernetes/OpenShift Operator.|
Kubernetes Operators are software extensions to Kubernetes which help you create and manage your applications. You can deploy and manage Hazelcast using the following Operators:
hazelcast/hazelcast-operator: Hazelcast Operator hosted on Docker Hub
hazelcast/hazelcast-enterprise-operator: Red Hat certified Hazelcast Enterprise Operator hosted on Docker Hub
registry.connect.redhat.com/hazelcast/hazelcast-enterprise-operator: Hazelcast Enterprise Operator hosted on Red Hat Container Catalog
There are a few different ways in using Hazelcast Operators:
Since all the Operators mentioned above are generated from Helm Charts, their functionality and input parameters are exactly the same as in the case of Helm Charts.
Hazelcast Enterprise Operator is currently in the early alpha preview stage, but it will soon become the preferred way of installing Hazelcast in Kubernetes/OpenShift environments. For a tutorial, see deploy:deploying-with-operator.adoc.
Explore some example deployment environments and choose one to suit your use case.
Use the official Hazelcast Docker images:
Please check Hazelcast Kubernetes Code Samples for the their usage.
Hazelcast is available in the form of Helm Chart in a few versions:
stable/hazelcast - Hazelcast IMDG in the official Helm Chart repository
hazelcast/hazelcast - Hazelcast IMDG with Management Center
hazelcast/hazelcast-enterprise - Hazelcast Enterprise with Management Center
IBM/hazelcast-enterprise - Hazelcast Enterprise (with Management Center) dedicated for IBM ICP and IKS environments
You can also check Hazelcast Helm Charts at Helm Hub.
Hazelcast is available as Kubernetes/OpenShift Operator:
Hazelcast works correctly with Istio >= 1.1.0 without any need of additional configuration. You can use it in both client-server and embedded modes. Also, the Hazelcast cluster can be either outside or inside the Istio mesh. See Hazelcast Guides: Hazelcast with Istio Service Mesh for the details.