Deploying MongoDB OpsManager with a custom resource

After you install the MongoDB service on Cloud Pak for Data, you can use a custom resource (CR) to deploy the MongoDB OpsManager user interface.

Procedure

  1. Create a secret for logging in to OpsManager.
    Note:

    Passwords must be at least 8 characters long and contain at least one letter, one digit, and one special character.

    You can customize the values in the following example YAML file:
    apiVersion: v1
    kind: Secret
    metadata:
      name: mongodb-<opsManagerInstanceName>-secret     #Replace with your instance name
    type: Opaque
    stringData:
      FirstName: "firstnm"
      LastName: "lastnm"
      Password: "Sample@11111111A"
      Username: "sample"
  2. Apply the YAML file to the namespace that Cloud Pak for Data was installed in by running the following command:
    oc apply -f CR-file.yaml -n ${PROJECT_CPD_INSTANCE}
  3. Use the following sample YAML file as a template for the CR. Edit the fields to the desired values for your environment.
    apiVersion: mongodb.cpd.ibm.com/v1
    kind: CPDMongoDBOpsManager
    metadata:
      name: <opsManagerInstanceName>     #Replace with your instance name
    spec:
      forceDeleteResources: false
      license:
        accept: true
      version: 4.0.0
      dedicated: false
      replicas: 2
      storageSize: "2G"
      storageClass: <yourStorageClass>     #Replace with your storage class
      resources:
        requests:
          cpu: "1"
          memory: "5G"
        limits:
          cpu: "4"
          memory: "15G"
      applicationDatabase:
        replicas: 3
        storageSize: "2G"
        storageClass: <yourStorageClass>     #Replace with your storage class
        resources:
          requests:
            cpu: "0.5"
            memory: "500M"
          limits:
            cpu: "1"
            memory: "4G"
    • To deploy on dedicated nodes, set the dedicated: key under the spec: to True.
    • To automatically remove pvcs and secrets when you delete an instance, set the spec.forceDeleteResources under the spec: key to true.
  4. Apply the YAML file to the namespace that Cloud Pak for Data was installed in by running the following command:
    oc apply -f CR-file.yaml -n ${PROJECT_CPD_INSTANCE}
  5. You can access Ops Manager by looking up the route with the following command:
    oc get routes -n ${PROJECT_CPD_INSTANCE}

    You should see a route that is based on the name of your Ops Manager instance. You could also again describe the instance as you did for the status and look for the opsmanagerURL key under Status that contains the URL for Ops Manager.