WebSphereLibertyDump custom resource

The WebSphereLibertyDump custom resource (CR) causes a Liberty server memory dump to be created. A Java™ dump can also be included. The memory and Java dumps are from a Liberty server instance that is running in a pod.

WebSphereLibertyDump prerequisites

WebSphereLibertyDump provides a day-2 operation.

Before you can use WebSphereLibertyDump, the WebSphereLibertyApplication CR must configure storage for serviceability and a CR for WebSphereLibertyDump must exist in the same namespace as the WebSphereLibertyApplication CR.

For automatic discovery of supported day-2 operations from external tools, the following annotations must exist in the WebSphereLibertyApplication and WebSphereLibertyDump custom resource definitions (CRDs).

  • The WebSphereLibertyApplication CRD must have an annotation that specifies the WebSphereLibertyDump day-2 operation. The following example adds annotations for both day-2 operations.
    annotations:
      openliberty.io/day2operations: WebSphereLibertyTrace,WebSphereLibertyDump
  • The WebSphereLibertyDump CRD must have an annotation that specifies the Pod k8s Kind for the day-2 operation.
    annotations:
      day2operation.openliberty.io/targetKinds: Pod

WebSphereLibertyDump configurable parameters

The WebSphereLibertyDump CRD has configurable parameters. The following list describes the parameters.

include
A list of Java dump types to request. Available dump type values are thread, heap, and system.
license
Information about the license, which is available at https://ibm.biz/was-license.
accept
A boolean that specifies whether the license is accepted. The default is false. The value must be true to accept the license and enable deployment of the WebSphereLibertyDump day-2 operation.
podName
The name of the Pod, which must be in the same namespace as the WebSphereLibertyDump CR.
For more information, see the server dump documentation at openliberty.io.

WebSphereLibertyDump example

The following YAML example sets values for license, podName, and include parameters in the WebSphereLibertyDump CR. The example includes the thread and heap dump types.

apiVersion: liberty.websphere.ibm.com/v1
kind: WebSphereLibertyDump
metadata:
  name: example-dump
spec:
  license:
    accept: false
  podName: my_pod_name
  include:
    - thread
    - heap

The dump file name is added to the WebSphereLibertyDump CR status and the file is stored in the serviceability folder with a format such as /serviceability/namespace/pod_name/timestamp.zip.

After the dump starts, you cannot reuse the CR for more dumps. Each server dump requires a new CR.

You can check the status of a memory dump operation in the status field of the CR YAML. You can also run an Red Hat® OpenShift® CLI (oc) or Kubernetes CLI (kubectl) get wldump command to see the status of all dump operations in the current namespace.

oc get wldump -o wide
kubectl get wldump -o wide

wldump and wldumps are short names for webspherelibertydump, the singular name, and webspherelibertydumps, the plural name.

Restriction: A system memory dump might not work on all Kubernetes versions, such as Red Hat OpenShift 4.x.