Using an external database for Managed services

You can configure Managed services to use an external MongoDB. This configuration is optional.

External MongoDB connection

The supported version for external MongoDB is 6.0.13.

Steps to connect an external MongoDB connection:

  1. Edit IAConfig.

    oc edit IAConfig -A
    
  2. Update IAConfig using the following spec for Managed services.

     spec:
       imagePullSecret: ibm-entitlement-key
       infraAutoComposableComponents:
       - enabled: true
         name: ibm-management-im-install
       - enabled: true
         name: ibm-management-cam-install
         spec:
           manageservice:
             global:
               externalDb: <true | false >
               externalDbConfig: < external DB config in base 64 >
               externalMongoDBCertificate: <CA certificate  in  base 64 >
               mongoDbUrl: <mongodburl in  base 64  >
       license:
         accept: true
       storageClass: rook-cephfs
       storageClassLargeBlock: rook-ceph-block
    
    • externalDb: Set this value to true.

    • externalDbConfig: Add base64 encode for extra configuration. This is added as an object and contain all the options that require to connect the mongo connection.

    Sample configuration:

       {
         "ssl":true,
         "sslValidate":false,
       }
    

    Note: Add certType: 'crt' for crt type certification or certType: 'pem' for pem type certification in the external database configuration.

    • externalMongoDBCertificate: base64 encode of the certificate.

    • mongoDbUrl: External database url.

    Note: Some of the mongo instance may use only url and need not require any certificate. In such case, update externalDb and mongoDbUrl.

  3. Save your IAConfig changes.

  4. All the pods are deleted and newly created pods points to the external MongoDB connection.

Disconnection of external MongoDB and reconnect to the cam-mongo pods

Steps to disconnect from an external MongoDB connection and reconnect to the cam-mongo pods:

  1. Edit the IAConfig.

    oc edit IAConfig -A
    
  2. Set the externalDb to false in IAConfig.

     global:
          externalDb:  false
    
  3. Save your IAConfig changes.

  4. All the pods are deleted and newly created pods points to the cam-mongo pods.

When you are unable to access Managed services routes with correct externalDB configuration, then increase the icpdata_addon_version to a higher value in the configmap cam-proxy-zen-extension.

oc -n cp4aiops edit configmap cam-proxy-zen-extension