Migrating to 5.6

  • To increase the reliability of the ForceStart and avoid unnecessary data loss, autoForceStart is removed from the operator’s persistence options. Instead, you can use startupAction option and set it to ForceStart or PartialStart. For example:

apiVersion: hazelcast.com/v1alpha1
kind: Hazelcast
metadata:
  name: hazelcast
spec:
  clusterSize: 3
  repository: 'docker.io/hazelcast/hazelcast-enterprise'
  version: '5.2.1'
  licenseKeySecret: hazelcast-license-key
  persistence:
    baseDir: "/data/hot-restart/"
    clusterDataRecoveryPolicy: "FullRecoveryOnly"
    pvc:
      accessModes: ["ReadWriteOnce"]
      requestStorage: 8Gi
    startupAction: ForceStart

Helm Chart Migration

Starting from 5.6, Helm Charts is used for the operator installations. So while migrating from 5.5 to 5.6, following steps must be followed:

Step 1: Add labels and annotations to existing CRDs to authorize Helm Chart to manage them (<namespace> must be replaced with the namespace where operator is already installed.):

kubectl label --overwrite crd hazelcasts.hazelcast.com "app.kubernetes.io/managed-by=Helm" && \
kubectl label --overwrite crd hotbackups.hazelcast.com "app.kubernetes.io/managed-by=Helm" && \
kubectl label --overwrite crd maps.hazelcast.com "app.kubernetes.io/managed-by=Helm" && \
kubectl label --overwrite crd multimaps.hazelcast.com "app.kubernetes.io/managed-by=Helm" && \
kubectl label --overwrite crd replicatedmaps.hazelcast.com "app.kubernetes.io/managed-by=Helm" && \
kubectl label --overwrite crd topics.hazelcast.com "app.kubernetes.io/managed-by=Helm" && \
kubectl label --overwrite crd managementcenters.hazelcast.com "app.kubernetes.io/managed-by=Helm" && \
kubectl label --overwrite crd cronhotbackups.hazelcast.com "app.kubernetes.io/managed-by=Helm" && \
kubectl label --overwrite crd wanreplications.hazelcast.com "app.kubernetes.io/managed-by=Helm"

kubectl annotate --overwrite crd hazelcasts.hazelcast.com "meta.helm.sh/release-name=operator-crds" "meta.helm.sh/release-namespace=<namespace>" && \
kubectl annotate --overwrite crd hotbackups.hazelcast.com "meta.helm.sh/release-name=operator-crds" "meta.helm.sh/release-namespace=<namespace>" && \
kubectl annotate --overwrite crd cronhotbackups.hazelcast.com "meta.helm.sh/release-name=operator-crds" "meta.helm.sh/release-namespace=<namespace>" && \
kubectl annotate --overwrite crd maps.hazelcast.com "meta.helm.sh/release-name=operator-crds" "meta.helm.sh/release-namespace=<namespace>" && \
kubectl annotate --overwrite crd multimaps.hazelcast.com "meta.helm.sh/release-name=operator-crds" "meta.helm.sh/release-namespace=<namespace>" && \
kubectl annotate --overwrite crd replicatedmaps.hazelcast.com "meta.helm.sh/release-name=operator-crds" "meta.helm.sh/release-namespace=<namespace>" && \
kubectl annotate --overwrite crd topics.hazelcast.com "meta.helm.sh/release-name=operator-crds" "meta.helm.sh/release-namespace=<namespace>" && \
kubectl annotate --overwrite crd managementcenters.hazelcast.com "meta.helm.sh/release-name=operator-crds" "meta.helm.sh/release-namespace=<namespace>" && \
kubectl annotate --overwrite crd wanreplications.hazelcast.com "meta.helm.sh/release-name=operator-crds" "meta.helm.sh/release-namespace=<namespace>"
[shell,yaml]

Step 2: Install CRDs for the new version:

helm install operator-crds hazelcast/hazelcast-platform-operator-crds

Step 3: Delete existing deployments and roles (replace <cr_name> with your Hazelcast instance’s name):

kubectl delete serviceaccount/hazelcast-platform-controller-manager && \
kubectl delete role.rbac.authorization.k8s.io/hazelcast-platform-manager-role && \
kubectl delete clusterrole.rbac.authorization.k8s.io/hazelcast-platform-manager-role && \
kubectl delete rolebinding.rbac.authorization.k8s.io/hazelcast-platform-manager-rolebinding && \
kubectl delete clusterrolebinding.rbac.authorization.k8s.io/hazelcast-platform-manager-clusterrolebinding && \
kubectl delete deployment.apps/hazelcast-platform-controller-manager

kubectl delete $(kubectl get clusterrole,role -o name | grep <cr_name>)

Step 4: Install new operator using Helm Chart:

helm install operator hazelcast/hazelcast-platform-operator
After completing these steps, Hazelcast Enterprise users can also upgrade their Hazelcast Cluster version by triggering a rolling upgrade. To trigger a rolling upgrade, you just need to update Hazelcast version in your Kubernetes specification and re-apply it.