Chapter 2. Setting up a sidecar container You can set up a sidecar container when you create a Cryostat instance with an installed Red Hat build of Cryostat Operator on the Red Hat OpenShift web console. Additionally, you can set up a sidecar container by modifying an existing Cryostat resource on Red Hat OpenShift. This action instructs the Red Hat build of Cryostat Operator to modify the existing Cryostat installation on Red Hat OpenShift. Prerequisites Logged in to the OpenShift Container Platform by using the Red Hat OpenShift web console. Installed the Red Hat build of Cryostat Operator in a project on Red Hat OpenShift. See Installing Cryostat on Red Hat OpenShift by using a Red Hat build of Cryostat Operator (Installing Cryostat). Deployed a Java application that has JMX or the Cryostat agent enabled inside the same namespace as your Cryostat instance. Procedure From the Red Hat OpenShift web console, go to Operators > Installed Operators . From the list of installed operators, click the name of your Red Hat build of Cryostat Operator instance. An Operator details page opens on your web console. In the Provided APIs section, click Create instance . Complete any mandatory fields, which are marked with an asterisk, such as the Name field. From the Create Cryostat configuration page, go to the Report Options section. To show options for configuring the Cryostat's automated report analysis implementation, click the expand icon. Figure 2.1. The Report Options section on the Create Cryostat configuration page Configure any of the following report options to meet your needs: Replicas : Defaults to 0 , which indicates that the main Cryostat container handles report generation. You must set to a value greater than 0 , so that a replica or replicas of your sidecar container can generate and handle analysis reports. Resources : Sets the resource limits for each sidecar replica. To show configurable limits and request options for each sidecar replica, click the expand icon. Options include CPU cores , Memory , and Storage . The Storage option has the least relevance to the generation of a sidecar report. Red Hat OpenShift sets the supported units for each option. Sub Process Max Heap Size : Option applies only to the main Cryostat container. Allocates the maximum amount of memory for the main Cryostat container that it can use to generate reports. Note The following limitations might exist with the type of value you specify for the Sub Process Max Heap Size option: A low value might cause report-generation requests to fail, because the report size might exceed the allocated memory for the main Cryostat container. Additionally, report generation might time out, because the JVM must constantly run garbage collection (GC) operations to process the report. A high value might deplete memory resources for the Cryostat instance that operates inside the main Cryostat container, because the memory limitation applies to two memory partitions until the report-generation operation finishes. Consider generating a report with the option's default setting. If the default setting does not match your requirements and then consider configuring the option. To generate a Cryostat instance, click Create . Verification Go to your Cryostat instance's Cryostat details page and then select the Details tab. Click the URL that is available under the Application URL field. Your web browser redirects you to a OpenShift Container Platform login page, where you must enter your credentials. From the Cryostat web console, select your target JVM. Go to the Recordings menu item and start a JFR recording of your Java Virtual Machine (JVM). On the Active Recordings tab or the Archived Recordings tab, view automated analysis information for the sidecar by expanding the twistie icon ( v ) to your listed recording: Figure 2.2. Example of viewing automated analysis information for a sidecar recording Go to your Red Hat OpenShift web console and select Workloads > Pods . Click the name of your pod. From the Pod details page, click the Logs tab. To stop the log stream, click the pause icon. A series of log messages opens in the log window. Figure 2.3. The Log streaming button on the Pod details page Locate any log messages that confirm that the sidecar report container received the generated report requests from the main Cryostat container. Figure 2.4. Example of log messages in the Logs tab Additional resources Installing Cryostat on Red Hat OpenShift by using a Red Hat build of Cryostat Operator (Installing Cryostat) Creating a JDK Flight Recorder (JFR) recording (Creating a JFR recording with Cryostat) Red Hat build of Cryostat Operator (Using the Red Hat build of Cryostat Operator to configure Cryostat) Revised on 2023-12-12 18:43:02 UTC

Commands: