Deploying and configuring Open Liberty portlet container
This topic provides instructions on how to deploy, configure, install, uninstall, and troubleshoot issues in Open Liberty portlet container.
Deploying using Helm
To deploy the Open Liberty portlet container using Helm, refer to the following steps:
-
Load the Open Liberty portlet container image into your repository.
-
Extract the Helm charts
.tgzfile for the same version as the image. -
Change to the
hcl-lpc-deploymentdirectory created. -
From the
value-samplesfolder, copy thesample-values.yamlfile tocustom-values.yamlin the current directory. -
Edit
custom-values.yamlto specify your image repository and the name and tag of the Open Liberty portlet container image you want to deploy. You can also use this file to override a few of the other values documented invalues.yamlandvalues.schema.json. For more information, see Configuring using Helm values. -
Run
helm install lpc-deployment -n <your-dx-namespace> . -f ./custom-values.yamlwhere<your-dx-namespace>is replaced by the namespace of your current DX installation.
Configuring using Helm values
When deploying the Open Liberty portlet container; you can modify the following sections in your custom-values.yaml:
- images
- resources
- annotations
- labels
- nodeSelector
Refer to the supplied values.yaml file for details on the format.
Installing Portlet Applications
To install your own standard portlet applications into the Open Liberty portlet container for evaluation, there are two main options:
-
Option 1 - Create an Enhanced Container Image
-
You can deploy one or more additional portlet applications by creating a simple
Dockerfilesimilar to the following:FROM
<repo-URL>/<container-image-name>:<tag>COPY
--chown=dx_user:dx_users <path-to-your-WAR-file> /config/dropins/where the
FROMvalue points to wherever you loaded the HCL-supplied Open Liberty portlet container. If you have more than one application to install, you can add multipleCOPYstatements or use a suitable wildcard expression in the source path. -
When your
Dockerfileis ready and you have Docker installed, create the image with the following command:docker build -f Dockerfile -t <tag-for-new-image>. -
Deploy the enhanced image during the initial installation of the Open Liberty portlet container deployment by specifying your new tag in the
custom-values.yamlfile before running thehelm installcommand. To update an existing deployment with a new image, update thecustom-values.yamlfile but run the following command:helm upgrade lpc-deployment -n your-dx-namespace . -f ./custom-values.yaml
In addition to deploying portlet applications, you can change the configuration of the Open Liberty server when creating a new image. You can make changes to the
server.xmlfile (found in the/config/directory) to add extra Open Liberty features that your portlets might require or to configure applications that do not reside in the/config/dropins/directory. You can also create or change other Open Liberty configuration files in the/config/directory (for example, using thejvm.optionsfile to specify a different heap size). Further information can be found in the Open Liberty documentation.Warning
Some configuration changes may break the Open Liberty portlet container and it is not possible to enumerate here all the ways this can occur. Proceed with caution and be prepared to revert any changes that you have made. Some changes that should not be made are:
- Adding the `webCache` feature (the already installed `portletCache` feature is a customized version of this) - Changing the version of the `javaee` feature - Altering the configuration of the `enterpriseApplication` element with an ID of `wsrpproducer` - Removing the `portletContainer` feature or element -
-
Option 2 - Deploy into a Running Container
Alternatively, you can deploy portlet applications directly into a running container where they are automatically detected and installed by Open Liberty. Note that such deployments do not persist if the Open Liberty portlet container pod is restarted.
To deploy an application with this option, copy the application to the
/config/dropins/directory of the running container. For example, you can use:kubectl cp -n <your-dx-namespace> <path-to-your-WAR-file> lpc-deployment-lpc-0:/config/dropins/
Consuming Portlets in DX Core
To test portlets that you have deployed into the Open Liberty portlet container, you must consume them in the co-located instance of DX Core (in the Kubernetes deployment set up for non-production use) over WSRP.
There are three main steps:
More information can be found in Using your portal as a WSRP Consumer.
Configuring a WSRP Producer
Do this step only once, regardless of how many applications are deployed to the Open Liberty portlet container.
-
Go to the
Web Servicespage on your DX Core installation, typically found athttps://<your-dx-host>/wps/myportal/Practitioner/Administration/Applications/Web%20Services. -
Click the
New Producerbutton and enter a name for the new producer in theTitle:field. -
Enter the URL
http://lpc-deployment-lpc:9080/producer/wsdl/wsrp_service.wsdlin theURL to WSDL service definitions:field. -
Click OK.
Consuming Portlets
After a producer is created, you can then import the individual standards-based portlets from the applications deployed to your Open Liberty portlet container. You must repeat this step whenever you deploy additional applications.
-
Go to the
Web Modulespage on your DX Core installation, typically found athttps://<your-dx-host>/wps/myportal/Practitioner/Administration/Applications/Web%20Modules. -
Click the
Consumebutton and then click the link on the name of your WSRP Producer. -
Check the boxes of the additional portlets you want to use.
Note
Only portlets that are not consumed are listed.
-
Click OK.
Adding Consumed Portlets to DX Pages
The portlets that are consumed should be accessible for addition to both new and existing pages (for example, through the Applications tab in the Site Manager while editing a page).
For information on how to add applications, refer to Adding applications to your page.
Uninstalling the Open Liberty portlet container
When you are done evaluating the Early Access version of the Liberty Portlet Container, you may want to remove it from your DX namespace. You can uninstall the Open Liberty portlet container with the following Helm command:
helm uninstall lpc-deployment -n <your-dx-namespace>
After executing this command, the message release "lpc-deployment" uninstalled is displayed.
Troubleshooting
If you encounter difficulties with running your applications on the Open Liberty portlet container, you can access the logs by either:
- connecting to the running container and viewing them, or
- copying the logs off the container and examining them locally
The logs can be found in the /config/logs/ directory. The messages.log file in that directory shows any exceptions or status messages. The trace.log file gives more information because a high level of tracing is currently enabled for the Open Liberty portlet container.
The following is a sample command to copy the messages.log locally for examination:
kubectl cp -n <your-dx-namespace> lpc-deployment-lpc-0:/config/logs/messages.log <local-path-for-log>
To connect directly to the running container, you can use the following sample command:
kubectl exec -it -n <your-dx-namespace> lpc-deployment-lpc-0 -- /bin/bash
If you have configured your Kubernetes environment and Open Liberty portlet container deployment to allow external HTTP(S) access to the Open Liberty portlet container service, you can use the Open Liberty Admin Center web application to check whether your portlet applications have started.
When consuming your portlets through WSRP from DX Core, you can get potentially valuable information from the DX Core SystemOut log with the following command:
kubectl logs -n <your-dx-namespace> dx-deployment-core-0 -c system-out-log