Skip to main content

MarkLogic Server on Kubernetes

Extend the data volumes

Volume expansion is only available if the underlying StorageClass has the option allowVolumeExpansion set to true. See Expanding Persistent Volumes Claims for more information, including a list of volume types supported.

After StatefulSet objects are created, the only items that can be modified are the number of replicas, the update strategy, and the object template. Attempting to modify any other specifications returns this error:

# * spec: Forbidden: updates to statefulset spec for fields other than ‘replicas’, ‘template’, and ‘updateStrategy’ are forbidden.

Expand the volume without downtime

To expand the volume without downtime, follow these steps:

  1. Delete the StatefulSet set without deleting the pods by entering this command:

    kubectl delete sts <statefulset-name>--cascade=orphan -n <release-namespace>

    Note

    This will cause orphan pods. However, there will not be any downtime.

  2. Modify each PVC with the desired size by entering this command:

    kubectl edit pvc <pvc-name> -n <release-namespace>

    This output appears:

    apiVersion: v1
    kind: PersistentVolumeClaim
    metadata:
      annotations:
    ...
      labels:
        app.kubernetes.io/instance: huge-ml
        app.kubernetes.io/name: marklogic
      name: datadir-huge-ml-marklogic-0
      namespace: ml
    spec:
      accessModes:
      - ReadWriteOnce
      resources:
        requests:
          storage: 80Gi (old size 20Gi)
      storageClassName: gp3
  3. Recreate the StatefulSet with the new storage request. First, modify the values.yaml used to deploy the ML-cluster:

    # Configure persistence using persistent Volume Claim
    # ref: https://kubernetes.io/docs/concepts/storage/persistent-volumes
      /#persistentvolumeclaims
    # The "" storageClass will use the default storage class for your cluster. 
      (gp2 for EKS, standard for Minikube)
    # If set the enabled to false, it will use EmptyDir
     volumepersistence:
      enabled: true
      storageClass: "gp3"
      size: 80Gi<---New size
      annotations: {}
      accessModes:
        - ReadWriteOnce
      mountPath: /var/opt/MarkLogic
  4. Next, upgrade the Helm chart by entering this command:

    helm upgrade <release name> -n <release-namespace> marklogic --version <version> - f <path-to-values-file>