How to customize the Mobile Foundation component deployed on IBM Cloud Private (ICP)

During the deployment of the Mobile Foundation Helm charts on the IBM Cloud Private various configuration details are supplied. There are several cases, these configuration settings available on the deployed Mobile Foundation on the ICP needs customizations post deployment especially when the system runs in production scenarios or during the tests.

This blog post assumes that you have already set up IBM Cloud Private and loaded the IBM Mobile Foundation Passport Advantage Archive on ICP.

Following set of instructions shows how the Mobile Foundation artifacts can be customized once the base PPA package is loaded and the helm charts are deployed on the IBM Cloud Private.

The MobileFoundation for ICP PPA package contains a set of customizable mfp server artifacts structured as follows:

icp-kubernetes/usr-mfpf-server
├── config
│   ├── keystore.xml
│   ├── ltpa.xml
│   ├── mfpfproperties.xml
│   ├── mfpfsqldb.xml
│   ├── registry.xml
│   └── tracespec.xml
├── env
│   ├── jvm.options
│   └── server.env
├── jre-security
│   └── readme.txt
└── security
    ├── keystore.jks
    ├── ltpa.keys
    └── truststore.jks

Note: For Analytics and AppCenter, please locate the structure under the directory usr-mfpf-analytics and usr-mfpf-server respectively within the package.

Procedure

Below are the set of steps, which explains how the jvm.options file can be customized (eg., to add the MaxHeap settings) and used for updating the Kubernetes pods on the Mobile Foundation Server deployments.

  1. As depicted in the mfp server artifacts directory structure, one can create a directory structure in the local directory

     [root@masternode1 ~]# mkdir -p usr-mfpf-server/env
     [root@masternode1 ~]# cd usr-mfpf-server/env
    

    This creates the following directory structure that can be used to customize the image on the ICP for modifying the jvm.options.

     icp-kubernetes/usr-mfpf-server
     ├── env
     │   └── jvm.options
    
  2. Create a Dockerfile to overwrite jvm.options as follows:

     FROM mycluster.icp:8500/default/mfpf-server:1.0.0.1
     COPY jvm.options /opt/ibm/wlp/usr/servers/mfp/jvm.options
    
  3. Let us consider that we want to add the MaxHeap size (Xmx) in the jvm.options for the Mobile Foundation Server:
     -Dcom.ibm.ws.jmx.connector.client.rest.readTimeout=180000
     -Xmx1024m
    
  4. Build docker image with a new tag name (say 1.0.0.2).

     # docker build . -t mfpf-server:1.0.0.2
    

    This updates the existing mfp-server docker image with the customized jvm.options.

  5. Log in to the ICP cluster and docker registry via commandline:

    # bx pr login -a https://<icp_cluster_ip>:8443 --skip-ssl-validation -u admin -p xxxx -c <mycluster-account>
    # docker login mycluster.icp:8500 -u admin -p xxxx
    
  6. Push the new image to the ICP container repository as follows:

    # docker tag mfpf-server:1.0.0.2 mycluster.icp:8500/default/mfpf-server:1.0.0.2
    # docker push mycluster.icp:8500/default/mfpf-server:1.0.0.2
    
  7. Check the available Mobile Foundation Server kubernetes as follows:

     kubectl get deployments
     NAME                                     DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE
     mfpserver-ibm-mfpf-server-prod         2         2         2            2           5d
    
  8. Now update Mobile Foundation Server kubernetes deployment mfpserver-ibm-mfpf-server-prod to use the customized image.

     kubectl edit deployments mfpserver-ibm-mfpf-server-prod
    
  9. Replace - image: mycluster.icp:8500/default/mfpf-server:1.0.0.1 with - image: mycluster.icp:8500/default/mfpf-server:1.0.0.2

  10. Once the image is updated in the kube configuration, the mfp server pods are deleted and recreated automatically using the new configuration. Make sure that all the pods are running and ready as follows:

    kubectl get pods
    
  11. Access the pods and verify the updated jvm.options file is being used:

    # kubectl exec -it mfpserver-ibm-mfpf-server-prod-bbcf6bcd4-dprsz bash
    root@mfpserver-ibm-mfpf-server-prod-sdd76xs82-pjswe:/# cat /opt/ibm/wlp/usr/servers/mfp/jvm.options
    
    -Dcom.ibm.ws.jmx.connector.client.rest.readTimeout=180000
    -Xmx1024m
    

The above set of instructions are applicable for customzing any of the mfpserver, analytics or appcenter components running on ICP.

For MobileFirst Server on IBM Cloud Private, refer to the documentation

Inclusive terminology note: The Mobile First Platform team is making changes to support the IBM® initiative to replace racially biased and other discriminatory language in our code and content with more inclusive language. While IBM values the use of inclusive language, terms that are outside of IBM's direct influence are sometimes required for the sake of maintaining user understanding. As other industry leaders join IBM in embracing the use of inclusive language, IBM will continue to update the documentation to reflect those changes.
Last modified on May 09, 2019