Upgrading existing deployment

This topic explains the procedure to migrate a Kubernetes or Red Hat® OpenShift® cluster.

Before you begin

  • Ensure that the System requirements are met.
  • Ensure that you have completed the Downloading the Docker assets task.
  • Ensure that you understand how the Product Master is installed by using operators. For more information, see Installing (containerized).
  • Ensure that deployment YAML files are configured. For more information, see Configuring Product Master deployment YAML.
  • Starting from the IBM Product Master 14.0 GA release, all secrets values are passed from the app_secrets.yaml file. Product Master is deprecating random secret usage. You need to take a backup of all the existing secrets and update all values from the random-secret to the app_secrets.yaml file.
  • Take backup of the existing release deployment files, customization, app-secret, random-secret, IBM Db2® database and MongoDB, and /opt/MDM/public_html folder of admin pod.
    Backup all the key values present in the random-secret
    1. Take backup by using the following command.

      Self-managed Kubernetes clusterAmazon EKS cluster
      kubectl get secret random-secret -o jsonpath='{.data}' | jq -r 'to_entries[] | "\(.key): \(.value | @base64d)"' > random-secret.txt 
      
      Red Hat OpenShift cluster
      oc get secret random-secret -o jsonpath='{.data}' | jq -r 'to_entries[] | "\(.key): \(.value | @base64d)"' > random-secret.txt 
      
    2. Update all the values from the random-secret file to the app_secrets.yaml file by using the following command.

      Self-managed Kubernetes clusterAmazon EKS cluster
      while IFS= read -r line; do 
        key=$(echo $line | cut -d: -f1) 
        value=$(echo $line | cut -d: -f2- | xargs) 
        kubectl patch secret app-secret --type=json -p='[{"op": "add", "path": "/data/'"$key"'", "value":"'"$(echo -n $value | base64)"'"}]' 
      done < random-secret.txt 
      
      Red Hat OpenShift cluster
      while IFS= read -r line; do 
        key=$(echo $line | cut -d: -f1) 
        value=$(echo $line | cut -d: -f2- | xargs) 
        oc patch secret app-secret --type=json -p='[{"op": "add", "path": "/data/'"$key"'", "value":"'"$(echo -n $value | base64)"'"}]' 
      done < random-secret.txt 
      
    3. Ensure all the values that are related to MongoDB and IBM MQ pods are updated in the app-secret file by using the following command.

      Self-managed Kubernetes clusterAmazon EKS cluster
      kubectl get secret app-secret -o jsonpath='{.data}' | jq -r 'to_entries[] | "\(.key): \(.value | @base64d)"' | grep '<key>' 
      
      Red Hat OpenShift cluster
      oc get secret app-secret -o jsonpath='{.data}' | jq -r 'to_entries[] | "\(.key): \(.value | @base64d)"' | grep '<key>' 
      
    Backup MongoDB
    1. Go to the MongoDB pod by using the following command.

      Self-managed Kubernetes clusterAmazon EKS cluster
      kubectl rsh productmaster-mongodb-5464cb968-qcnts
      Red Hat OpenShift cluster
      oc rsh productmaster-mongodb-5464cb968-qcnts
      Note: Get the MongoDB user and password through the random-secret file.
    2. Take the backup of the MongoDB database by using the following command.
      $cd /data/db
      $mongodump \ 
      --username <username> \
      --authenticationDatabase admin \ 
      --password <password> \ 
      -d <database_name>
      
    3. Download the /data/db/dump folder to your local machine by using the following command. Self-managed Kubernetes clusterAmazon EKS cluster
      kubectl rsync productmaster-mongodb-6975f78c4d-4hx5w:/data/db/dump .
      Red Hat OpenShift cluster
      oc rsync productmaster-mongodb-6975f78c4d-4hx5w:/data/db/dump .
    4. Scale down the MongoDB pod by using the following command.

      Self-managed Kubernetes clusterAmazon EKS cluster
      kubectl scale sts <mongodbpodname> --replicas=0
      Red Hat OpenShift cluster
      oc scale sts <mongodbpodname> --replicas=0
    5. Delete the PV and PVC for the MongoDB pod by using the following command.Self-managed Kubernetes clusterAmazon EKS cluster
      kubectl delete pvc <mongodbpvcname> 
      kubectl delete pv <mongodbpvname>
      Red Hat OpenShift cluster
      oc delete pvc <mongodbpvcname> 
      oc delete pv <mongodbpvname>
      Note: Before provisioning a static volume, you need to first create PV and PVC. For provisioning a dynamic volume there is no need to create separate PV and PVC.

Procedure

  1. Verify that the secret details are present by using the following command.
    Self-managed Kubernetes cluster Amazon EKS cluster
    kubectl get secret  | grep ipm-registry
    Red Hat OpenShift cluster
    oc get secret  | grep ipm-registry
  2. Check the CR name by using the following command.
    Self-managed Kubernetes cluster Amazon EKS cluster
    kubectl get productmaster
    Red Hat OpenShift cluster
    oc get productmaster
    Note: You need to use the same CR name in the ipm_14.0.x_cr.yaml file.
  3. Update the ipm_14.0.x_cr.yaml file to make replica count of all pods to 0 and apply again.
  4. Confirm that all the pods are removed by using the following command.
    Self-managed Kubernetes cluster Amazon EKS cluster
    kubectl get pods
    Red Hat OpenShift cluster
    oc get pods
  5. Optional: If you have created any manual ingress route for IBM Product Master, delete it by using the following command.
    Self-managed Kubernetes cluster Amazon EKS cluster
    kubectl delete ingress <name>
    Red Hat OpenShift cluster
    oc delete ingress <name>
  6. Check existing packagemanifest before applying subscription by using the following command.
    Self-managed Kubernetes cluster Amazon EKS cluster
    kubectl describe packagemanifest productmaster-operator | grep -C3 "Default Channel"
    Red Hat OpenShift cluster
    oc describe packagemanifest productmaster-operator | grep -C3 "Default Channel"
  7. Update the new catalog source docker images into the catalog_source.yaml file. You can find the new image in the latest downloaded catalog_source.yaml file (IBM Product Master deployment files that are downloaded from the IBM Support Fix Central site).
  8. Apply the catalog_source.yaml file by using the following command.
    Self-managed Kubernetes cluster Amazon EKS cluster
    kubectl apply -f catalog_source.yaml
    Red Hat OpenShift cluster
    oc apply -f catalog_source.yaml
    1. Verify creation of new pods starts by using the following command.
      Self-managed Kubernetes cluster Amazon EKS cluster
      kubectl get pods
      Red Hat OpenShift cluster
      oc get pods
    2. Verify that the new catalog is created by using the following command.
      Self-managed Kubernetes cluster Amazon EKS cluster
      kubectl get pods | grep catalog
      Red Hat OpenShift cluster
      oc get pods | grep catalog
    3. Verify that the packagemanifest is updated with the new channel version and operator image by using the following command.
      Self-managed Kubernetes cluster Amazon EKS cluster
      kubectl describe packagemanifest productmaster-operator | grep -C3 "Default Channel"
      Red Hat OpenShift cluster
      oc describe packagemanifest productmaster-operator | grep -C3 "Default Channel"
  9. Update the subscription by using the following command.
    Self-managed Kubernetes cluster Amazon EKS cluster
    kubectl apply -f subscription.yaml
    Red Hat OpenShift cluster
    oc apply -f subscription.yaml
  10. Update the CSV or Operator controller. This step is required only if you have set the value of InstallPlanApproval to Manual because when the value is Automatic, subscription gets updated automatically.
  11. Add the volume details for the magento and message-archive services in your volumes.yaml file.
  12. Upgrade IBM Product Master by using the newly downloaded ipm_14.0.x_cr.yaml file as follows.
    1. Update the storage class to the same value as used in the IBM Product Master deployment.
    2. Optional: If you are using own registry, update the value of the image > registry.
    3. Enable feature that are required and mark rest of 0 so that associated pods don't come up and consume CPU and Memory. For more information, see Enabling a feature through CR.
    4. Apply the CR file.

What to do next

  1. After all the pods are up and running, you can log in to the IBM Product Master by using the following URLs.
    UI Self-managed Kubernetes cluster Amazon EKS cluster Red Hat OpenShift cluster
    Persona-based UI https://<hostname>:<nginx_ingress https port>/mdm_ui/#/login https://<hostname>/mdm_ui/#/login https://<hostname>/mdm_ui/#/login
    Admin UI https://<hostname>:<nginx_ingress https port>/ https://<hostname>/ https://<hostname>/utils/enterLogin.jsp
  2. Perform database migration by accessing the productmaster-admin-<container-name> pod by using the following command.

    Self-managed Kubernetes clusterAmazon EKS cluster
    kubectl rsh productmaster-admin-<container-name>
    Red Hat OpenShift cluster
    oc rsh productmaster-admin-<container-name>
    Follow the steps listed in the Migrating to IBM Product Master Version 14.0 topic.
  3. If you are using dynamic volume provisioning then, you need to restore the MongoDB database that you backed up in the Backup MongoDB section.
    1. Copy the dump into the /data/db folder of the MongoDB pod by using the following command.Self-managed Kubernetes clusterAmazon EKS cluster
      kubectl rsync dump productmaster-mongodb-0:/data/db
      Red Hat OpenShift cluster
      oc rsync dump productmaster-mongodb-0:/data/db
    2. Restore the MongoDB database by using the following command. This way, the backup gets restored on the latest MongoDB version.
      $ mongorestore 
      --username <username> \  
      --authenticationDatabase admin \
      --password <password> \  
      /data/db/dump
      
  4. If you had done the customization by creating custom images, then to get your customization, follow Customizing the containerized deployment instructions.