Create a MarkLogic cluster
This section describes how to add the MarkLogic Kubernetes repository. It includes the steps to create a three-node MarkLogic cluster with resource allocation using a Helm chart.
Add the MarkLogic repository
To add the MarkLogic repository to Helm, follow these steps:
Enter this command:
helm repo add marklogic https://marklogic.github.io/marklogic-kubernetes/
The message
"marklogic" has been added to your repositories
appears.Verify that the repository was added to Helm by entering this command:
helm repo list
An entry like
marklogic https://marklogic.github.io/marklogic-kubernetes/
appears.To ensure the Helm repository is up to date, enter this command:
helm repo update
Install the chart
Note
It is recommended to deploy the chart in an exclusive namespace.
To install the chart, follow these steps:
To create a three-node MarkLogic cluster with a resource allocation of 16 vCPUs, 128 GB RAM, and storage of 500 GB, update the settings in the
values.yaml
file as shown:Note
Use the latest MarkLogic Docker image for the new implementation as specified in the
values.yaml
file below. Refer to dockerhub for the latest image available.# Number of Marklogic nodes replicaCount: 3 # Marklogic image parameters # using the latest image 11.0.3-centos-1.0.2 image: repository: marklogicdb/marklogic-db; tag: 11.0.3-centos-1.0.2 pullPolicy: IfNotPresent # Configure persistence using persistent Volume Claim persistence: storageClass:“<storageClass-name>” enabled: true size: 500Gi # Compute Resources resources: requests: cpu: 16000m memory: 128Gi
Note
storageClass-name is used for gp2, gp3 (for EKS), or custom.
Create a Kubernetes Secret for the MarkLogic admin credentials. The secret should include the username, password, and wallet password. The credentials should be inserted between the ' ' marks when using this command:
kubectl create secret generic ml-admin-secrets \ --from-literal=username='' \ --from-literal=password='' \ --from-literal=wallet-password=''
Set the parameter
auth.secretName
in thevalues.yaml
file:# If no secret is specified and the admin credentials are not provided, a secret will be automatically# generated with random admin and wallet passwords. auth: secretName: "ml-admin-secrets"
Create a Kubernetes Secret for the credentials of the private image repository. Use the kubectl create secret command with the credentials needed to access the repository. In this example, the username and password are set.
image-repo-secrets
Once the secret is created, set the value for
imagePullSecrets.name
in thevalues.yaml
file:# Configure the imagePullSecrets to pull the image from private repository that requires credential imagePullSecrets: - name: "image-repo-secrets"
Next, install the chart to the current namespace using the settings in the
values.yaml
file by entering this command:helm install my-release marklogic/marklogic --version <version> --values values.yaml -n <release-namespace>
Once the installation is successful, this output appears:
NAME: my-release LAST DEPLOYED: NAMESPACE: <release-namespace> STATUS: deployed REVISION: 1
Verify the deployment by entering this command:
helm list -n <release-namespace>