Skip to main content

MarkLogic Server on Kubernetes

Maintain a cluster

This section includes information on maintaning a cluster.

Upgrades

MarkLogic Kubernetes Helm Chart is released in major, minor, and patch releases:

  • Major releases may include breaking changes and new features that require configuration changes to the values.yaml file. Because of this, it is recommended that you review the changes in a release and test the upgrade in a non-production environment.

  • Minor and patch releases will include bug fixes and other smaller changes.

Recommendations before upgrading

Before you start the upgrade process, consider these recommendations:

  • Read the MarkLogic documentation for details on upgrading MarkLogic.

  • Make sure to have the latest version of Helm installed.

  • Avoid using the --reuse-values option with the Helm upgrade to ensure the changes in the new values.yaml are merged into your release.

  • Always use the values.yaml file using the -f option and avoid using the --set option while installing and upgrading the chart. This ensures your release has all the new values.

  • Upgrade the bootstrap host in the MarkLogic StatefulSet before any other node in the cluster. Because of this, the OnDelete upgrade strategy is recommended over the RollingUpgrade strategy. See Update Strategies for more information on upgrade strategies.

  • It is important to have a database backup in case of upgrade failure. See Backing Up and Restoring a Database.

Upgrade procedures

This section describes three upgrade procedures:

Upgrade MarkLogic Kubernetes Helm Chart version

When a new version of the MarkLogic Helm Chart is released, upgrade to the new version by following these steps:

  1. Update the chart repository to get the new version of the chart:

    helm repo update 

  2. Check the upgrades available for MarkLogic Kuberenetes Helm chart:

    helm search repo marklogic 

  3. Set the upgrade strategy in the values.yaml file to OnDelete:

    updateStrategy: 
        type: OnDelete
  4. Update the values.yaml file with the new values from the updated chart version.

  5. Run the Helm upgrade command. Specify the name of your release and the new chart version using the --version option. Specify the values.yaml file using the -f option:

    helm upgrade <your release> marklogic/marklogic -f values.yaml --version <new version> -n <release-namespace> 

  6. To start the upgrade, terminate the pod with the smallest ordinal that is running a bootstrap node:

    kubectl delete pod <pod-name>-n <release-namespace>.

    For example, kubectl delete pod dnode-group-marklogic-0 -n marklogic.

    Once the pod is terminated, a new pod will be created with the updated Helm chart version.

  7. Repeat step 6 for all pods in your release.

  8. Complete the upgrade process.

Upgrade MarkLogic version in your release

Note

 

  • If a cluster is a multi-group MarkLogic cluster, each release corresponding to a group should be upgraded using the following procedure. If all the nodes in the groups are not updated to the same MarkLogic version, then differences in the version and effective version of the MarkLogic cluster will exist.

  • MarkLogic Kubernetes Helm Chart releases are independent of MarkLogic Server releases. An upgrade may be required when there is a new MarkLogic Server version available.

  • MarkLogic Server also uses the major, minor, and patch release classification. For further information, see MarkLogic Upgrade Support.

To upgrade the MarkLogic version in your release, follow these steps:

  1. Update the image.repository and image.tag in the values.yaml file to the version of MarkLogic to upgrade to:

    image:
      repository: marklogicdb/marklogic-db
      tag: <new tag>
  2. Set upgradeStrategy in the values.yaml file to OnDelete:

    updateStrategy: 
        type: OnDelete
  3. Upgrade the Helm chart using the helm upgrade command with the release name, chart name, and values.yaml:

    helm upgrade <release-name> <chart-name> -f <values.yaml> --version <chart-version> -n <release-namespace> 

  4. Use this command to start the upgrade by deleting the pod with the smallest ordinal that is a MarkLogic bootstrap host:

    kubectl delete pod <pod-name> -n <release-namespace>.

    For example, kubectl delete pod dnode-group-marklogic-0.

  5. Once the pod is terminated, a new pod will be created with an updated MarkLogic version. New values will also be updated in the values.yaml file.

  6. To complete the upgrade, repeat the termination process for all the pods in your release. After all the pods are upgraded, access the Admin UI on the bootstrap host and check that there is a configuration and/or a security database upgrade and/or an effective version change. If there is, a prompt to click OK to upgrade appears. If the prompt does not appear, the process is finished.

  7. Verify the upgrade by checking the version of MarkLogic on the Admin UI or by accessing the server logs. Required tests can now be run.

Upgrade MarkLogic and the Helm Chart versions at the same time
  1. To upgrade the MarkLogic and Helm chart versions at the same time, follow steps 1-5 in Upgrade MarkLogic Kubernetes Helm Chart versionand steps 1-3 in Upgrade MarkLogic version in your release.

  2. Next, initiate terminating the pods. First, delete pod-0 (the pod running the MarkLogic bootstrap host). Then delete the other pods using a command like this one:

    kubectl delete pod <pod-name> -n <release-namespace>.

    For example, kubectl delete pod dnode-group-marklogic-0 -n marklogic.

  3. Monitor the pod status with this command:

    kubectl get pods --nampespace=<your-namespace> -w 

  4. As soon as all pods are back running, verify the upgrade by checking the version or by running the required tests.