在 Cryostat 上配置 sidecar 容器


Red Hat build of Cryostat 3

Red Hat Customer Content Services

摘要

Cryostat 上配置 sidecar 容器 文档用于希望在与主 Cryostat 容器分开的容器中生成报告的用户,以便可以更有效地管理资源。本文档解释了如何在 Red Hat OpenShift 环境中设置和配置 sidecar 容器。

前言

Red Hat build of Cryostat 是 JDK Flight Recorder (JFR)的容器原生虚拟化,可用于安全监控在 OpenShift Container Platform 集群上运行的工作负载的 Java 虚拟机(JVM)性能。您可以使用 Cryostat 3.0 使用 Web 控制台或 HTTP API 启动、停止、检索、存档、导入和导出容器化应用中的 JVM 的 JFR 数据。

根据您的用例,您可以使用 Cryostat 提供的内置工具直接存储和分析 Red Hat OpenShift 集群上的记录,或者您可以将记录导出到外部监控应用程序,以对记录数据进行更深入分析。

重要

Red Hat build of Cryostat 只是一个技术预览功能。技术预览功能不受红帽产品服务等级协议(SLA)支持,且功能可能并不完整。红帽不推荐在生产环境中使用它们。这些技术预览功能可以使用户提早试用新的功能,并有机会在开发阶段提供反馈意见。

有关红帽技术预览功能支持范围的更多信息,请参阅技术预览功能支持范围

使开源包含更多

红帽致力于替换我们的代码、文档和 Web 属性中有问题的语言。我们从这四个术语开始:master、slave、黑名单和白名单。由于此项工作十分艰巨,这些更改将在即将推出的几个发行版本中逐步实施。详情请查看 CTO Chris Wright 的信息

第 1 章 sidecar 容器概述

Cryostat 支持 sidecar 容器,以便您可以使用 sidecar 容器生成自动分析报告。

在 Cryostat 2.3 之前,您必须依赖主 Cryostat 容器来生成自动分析报告。这种方法是资源密集型,可能会影响运行 Cryostat 应用的性能,因为您可能需要为主 Cryostat 容器置备其他资源。

通过在 sidecar 报告容器中生成自动分析报告,您可以有效地使用 Red Hat build of Cryostat Operator 为 Cryostat 应用程序置备资源。这为您的 Cryostat 容器提供了较低的资源占用空间,因为与目标应用程序交互的 Cryostat 实例可以通过 HTTP 和 JMX 连接运行低覆盖率操作。

另外,您可以复制 sidecar 报告容器,然后配置这个重复的容器以满足您的需要。

第 2 章 设置 sidecar 容器

在 Red Hat OpenShift web 控制台中使用安装的 Red Hat build of Cryostat Operator 创建 Cryostat 实例时,您可以设置 sidecar 容器。

另外,您可以通过修改 Red Hat OpenShift 上的现有 Cryostat 资源来设置 sidecar 容器。此操作指示 Red Hat build of Cryostat Operator 修改 Red Hat OpenShift 上的现有 Cryostat 安装。

先决条件

流程

  1. 在 Red Hat OpenShift web 控制台中进入 Operators & gt; Installed Operators
  2. 从安装的 Operator 列表中,点 Red Hat build of Cryostat Operator 实例的名称。在 Web 控制台中打开 Operator 详情页面
  3. Provided APIs 部分中,单击 Create instance
  4. 完成所有带有星号的必填字段,如 Name 字段。
  5. Create Cryostat 配置页面中,进入 Report Options 部分。
  6. 要显示配置 Cryostat 自动报告分析实现的选项,请点展开图标。

    图 2.1. Create Cryostat 配置页面中的 Report Options 部分

    *Create Cryostat* 配置页面} 中的 *Report Options* 部分
  7. 配置以下任何报告选项以满足您的需要:

    1. 副本 :默认为 0, 这表示主 Cryostat 容器处理报告生成。您必须设置一个大于 0 的值,以便 sidecar 容器的副本或副本可以生成并处理分析报告。
    2. resources :为每个 sidecar 副本设置资源限值。要显示每个 sidecar 副本的可配置限制和请求选项,点展开图标。选项包括 CPU 内核 内存和存储 Storage 选项对 sidecar 报告的生成最少有关系。Red Hat OpenShift 为每个选项设置支持的单元。
    3. 子进程最大堆大小 : 选项仅适用于主 Cryostat 容器。为主 Cryostat 容器分配可用于生成报告的最大内存量。

      注意

      对于 Sub Process Max Heap Size 选项指定的值类型可能有以下限制:

      • 较低值可能会导致报告生成请求失败,因为报告大小可能会超过主 Cryostat 容器的分配内存。另外,报告生成可能会超时,因为 JVM 必须持续运行垃圾回收(GC)操作才能处理报告。
      • 一个高的值可能会消耗在主 Cryostat 容器中运行的 Cryostat 实例的内存资源,因为内存限制适用于两个内存分区,直到报告生成操作完成为止。

      考虑使用选项的默认设置生成报告。如果默认设置与您的要求不匹配,请考虑配置该选项。

  8. 要生成 Cryostat 实例,请点击 Create

验证

  1. 进入 Cryostat 实例的 Cryostat 详情页面,然后选择 Details 选项卡。
  2. Application URL 字段下提供的 URL。您的 Web 浏览器会将您重定向到 OpenShift Container Platform 登录页面,其中您必须输入您的凭证。
  3. 在 Cryostat web 控制台中选择您的目标 JVM。
  4. 进入 Recordings 菜单项,并启动 Java 虚拟机(JVM)的 JFR 记录。
  5. Active Recordings 选项卡或 Archived Recordings 选项卡中,通过扩展列出的记录旁的 twistie 图标(v)来查看 sidecar 的自动化分析信息:

    图 2.2. 查看 sidecar 记录的自动分析信息示例

    查看 sidecar 记录的自动分析信息示例
  6. 进入 Red Hat OpenShift web 控制台并选择 Workloads > Pods
  7. 点 pod 的名称。
  8. Pod 详情页面中 点击 Logs 选项卡。
  9. 要停止日志流,点暂停图标。在日志窗口中打开一系列日志消息。

    图 2.3. Pod 详情页面中的 Log streaming 按钮

    *Pod details* 页面中的 *Log streaming* 按钮
  10. 找到任何日志信息,确认 sidecar 报告容器是否收到来自主 Cryostat 容器生成的报告请求。

    图 2.4. Logs 选项卡中日志消息示例

    *Logs* 标签页中的日志消息示例

更新于 2024-07-02

法律通告

Copyright © 2024 Red Hat, Inc.
The text of and illustrations in this document are licensed by Red Hat under a Creative Commons Attribution–Share Alike 3.0 Unported license ("CC-BY-SA"). An explanation of CC-BY-SA is available at http://creativecommons.org/licenses/by-sa/3.0/. In accordance with CC-BY-SA, if you distribute this document or an adaptation of it, you must provide the URL for the original version.
Red Hat, as the licensor of this document, waives the right to enforce, and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent permitted by applicable law.
Red Hat, Red Hat Enterprise Linux, the Shadowman logo, the Red Hat logo, JBoss, OpenShift, Fedora, the Infinity logo, and RHCE are trademarks of Red Hat, Inc., registered in the United States and other countries.
Linux® is the registered trademark of Linus Torvalds in the United States and other countries.
Java® is a registered trademark of Oracle and/or its affiliates.
XFS® is a trademark of Silicon Graphics International Corp. or its subsidiaries in the United States and/or other countries.
MySQL® is a registered trademark of MySQL AB in the United States, the European Union and other countries.
Node.js® is an official trademark of Joyent. Red Hat is not formally related to or endorsed by the official Joyent Node.js open source or commercial project.
The OpenStack® Word Mark and OpenStack logo are either registered trademarks/service marks or trademarks/service marks of the OpenStack Foundation, in the United States and other countries and are used with the OpenStack Foundation's permission. We are not affiliated with, endorsed or sponsored by the OpenStack Foundation, or the OpenStack community.
All other trademarks are the property of their respective owners.
返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2025 Red Hat