Scheduling MongoDB


MongoDB is a shared component in Workload Manager and Cost Optimizer modules of CloudCenter Suite. Kubernetes schedules the MongoDB pod as any other pod to share resources (CPU, memory) with other pods. However, in a large setup and over a period of time, MongoDB might want to consume additional resources but could be limited by its peer pods.

This section provides guidance on how to configure the Kubernetes cloud environment to run the MongoDB pod on a new node.

Affinity and Toleration 

The following values are defined on the MongoDB pod.

  • Toleration

    • Key: cloudcenter/dedicated

    • Value: cloudcenter-mongodb

  • Affinity

    • nodeaffinity: preferredDuringSchedulingIgnoredDuringExecution

  • Node Label

    • Key: cloudcenter/purpose

    • Value: cloudcenter-mongodb

Running the MongoDB on a New Node

Perform the following steps to run the MongoDB pod on a new node. 

  1. Add a new node and label it.

    kubectl label node NAME cloudcenter/purpose=cloudcenter-mongodb
  2. Apply a taint to assign the pod to MongoDB as shown in the below example.

    kubectl taint node -l cloudcenter/purpose=cloudcenter-mongodb cloudcenter/dedicated=cloudcenter-mongodb:NoSchedule
  3. Delete the pod to restart the MongoDB on this node.

    kubectl delete po cloudcenter-shared-cloudcenter-mongodb-0

It is not recommended to run the above steps on Amazon EKS.

Refer to these links for additional context:

  • No labels
Terms & Conditions Privacy Statement Cookies Trademarks