Optional: Adding object stores post-deployment

You can add extra object stores post-deployment by updating the custom resource file to include the additional configuration information for the object store.

About this task

You can add additional object stores post-deployment by updating the CR file to include the additional datasource under the datasource_configuration section and updating the object store configuration under the initialize_configuration section.

Procedure

When you install by using the deployment script, follow these steps:

  1. Edit the ibm_cp4a_cr_final.yaml custom resources file from the initial installation.

    To validate that you have the most recently edited version of the custom resource file that was used for the installation, compare it to the version currently being used by the operator:

    oc get icp4acluster -o yaml
  2. For each additional/new object store that you create, make a copy of an existing object store datasource under dc_os_datasources and update the required parameters for the additional/new object store.
    Refer to Configuring Content Cortex to understand how to update parameters. Also, see topic Datasource Parameters for more details.
  3. Under the initialize_configuration.ic_obj_store_creation.object_stores section in the ibm_cp4a_cr_final.yaml custom resource file:
    1. Make a copy of the required parameters.
      The required parameters include oc_cpe_obj_store_display_name, oc_cpe_obj_store_symb_name, oc_cpe_obj_store_conn.dc_os_datasource_name, oc_cpe_obj_store_conn.dc_os_xa_datasource_name, and oc_cpe_obj_store_admin_user_groups.
    2. If the initialization includes a Content Cortex Workflow system, enter a unique value for oc_cpe_obj_store_workflow_pe_conn_point_name parameter.
  4. Use the existing configuration as a guide to fill up the values for the required parameters.
  5. Modify the icp4adeploy-initialization-config configmap with:
    cpe_initialized = "False"
    Note: If you are upgrading from a previous version or migrating from on-premises, you need to manually add the object stores. Log in to the object store wizard in the IBM Administration Console for Content Platform Engine and follow the steps that are prompted by the UI to create additional object stores.
    Note: Check that the sc_content_initialization parameter in ibm_cp4a_cr_final.yaml is set to true. If you have migrated from on-premises to CP4BA and the icp4adeploy-initialization-config configMap is not present, you only need to set sc_content_initialization to true in ibm_cp4a_cr_final.yaml.
  6. When the edits to the CR and secret are complete, apply the updated custom resource YAML file:
    oc apply -f <ibm_cp4a_my_cr_final.yaml> --overwrite=true
    Note: If you have a multi-pattern deployment, the changes will immediately be updated in the ICP4A CR instance after applying your edited CR. However, it might take some time to be propagated into the Content CR instance. Monitor your Content CR for your changes with a command such as `oc get content -o yaml` or through your Red Hat OpenShift Console.
  7. Update the IBM Content Cortex secret ibm-fncm-secret to have the new credentials added.
    See Creating secrets to protect sensitive IBM Content Cortex configuration data to prepare your ibm-fncm-secret secret. The credentials that are added in the secret must match with the credentials in the dc_os_label parameter.
    Note: If you are using external secret management and adding additional object stores, update the ibm-fncm-secret in vault to include the new username and password with the same format. For example, if you are adding a new object store with the label of os2, then add
    • os2DBUserName
    • os2DBPassword
    For example
    apiVersion: secrets-store.csi.x-k8s.io/v1
    kind: SecretProviderClass
    metadata:
      name: "ibm-fncm-secret"
      namespace: "cp4ba-operand"
      labels:
        gcd-db-server: dbserver1
        db-name: ibm-fncm-secret
        cp4ba.ibm.com/backup-type: mandatory
    spec:
      provider: vault
      parameters:
        roleName: "cp4a-vault-role"
        vaultAddress: "http://vault.default:8200"
        objects:  |
         <existing_data>
          - secretPath: "/secret/data/cp4ba/ibm-fncm-secret"
            objectName: "os2DBUsername"
            secretKey: "os2DBUsername"
          - secretPath: "/secret/data/cp4ba/ibm-fncm-secret"
            objectName: "os2DBPassword"
            secretKey: "os2DBPassword"
    Update the existing ibm-fncm-secret SecretProviderClass to include the new keys, then apply the updates by using
    oc apply -f ibm-fncm-secret-provider-class.yaml
    If you have a Separation of Duties deployment, make sure to update and apply both ibm-fncm-secret-provider-class-cp4ba-operator.yaml and ibm-fncm-secret-provider-class.yaml.
  8. Before restarting the operators, make sure that the cpe_initialized key in the cp4adeploy-initialization-config configMap is still set to False. Then restart the ibm-cp4a-operator and ibm-content-operator by running the following commands.
    
    export CP4BA_OPERATOR_POD=$(oc get pods -n <cp4ba-namespace> | grep ibm-cp4a-operator)
    export CONTENT_OPERATOR_POD=$(oc get pods -n <cp4ba-namespace> | grep ibm-content-operator)
    oc delete pods ${CP4BA_OPERATOR_POD}
    oc delete pods ${CONTENT_OPERATOR_POD}