Red Hat Camel K is no longer supported.
As of June 30, 2025, Red Hat build of Camel K has reached End of Life. The suggested replacements is Red Hat build of Apache Camel. For details about moving, see the Camel K to Camel Quarkus migration guide.第 2 章 准备 OpenShift 集群
本章介绍了如何在 OpenShift 上安装 Red Hat Integration - Camel K 和 OpenShift Serverless,以及如何在开发环境中安装所需的 Camel K 和 OpenShift Serverless 命令行工具。
2.1. 安装 Camel K 复制链接链接已复制到粘贴板!
您可以从 OperatorHub 在 OpenShift 集群上安装 Red Hat Integration - Camel K Operator。OperatorHub 由 OpenShift Container Platform Web 控制台获得,为集群管理员提供了一个界面,以发现和安装 Operator。
安装 Camel K Operator 后,您可以安装 Camel K CLI 工具以命令行访问所有 Camel K 功能。
先决条件
您可以访问具有正确访问级别的 OpenShift 4.6 (或更新版本)集群、创建项目和安装操作器的功能,以及在本地系统上安装 CLI 工具。
注意You do not need to create a pull secret when installing Camel K from the OpenShift OperatorHub. The Camel K Operator automatically reuses the OpenShift cluster-level authentication to pull the Camel K image from `registry.redhat.io`.
You do not need to create a pull secret when installing Camel K from the OpenShift OperatorHub. The Camel K Operator automatically reuses the OpenShift cluster-level authentication to pull the Camel K image from `registry.redhat.io`.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
已安装 OpenShift CLI 工具(
oc
),以便可以在命令行中与 OpenShift 集群交互。有关如何安装 OpenShift CLI 的详情,请参阅安装 OpenShift CLI。
流程
- 在 OpenShift Container Platform Web 控制台中,使用具有集群管理员特权的帐户登录。
创建新的 OpenShift 项目:
- 在左侧导航菜单中点 Home > Project > Create Project。
-
输入项目名称,如
my-camel-k-project
,然后单击 Create。
- 在左侧导航菜单中点 Operators > OperatorHub。
-
在 Filter by keyword 文本框中,键入
Camel K
,然后点 Red Hat Integration - Camel K Operator 卡。 - 阅读有关操作器的信息,然后单击 Install。Operator 安装页面将打开。
选择以下订阅设置:
- Update Channel > latest
选择以下 2 个选项:
- Installation Mode > A specific namespace on the cluster > my-camel-k-project
- Installation Mode > All namespaces on the cluster (default) > Openshift operator
注意If you do not choose among the above two options, the system by default chooses a global namespace on the cluster then leading to openshift operator.
If you do not choose among the above two options, the system by default chooses a global namespace on the cluster then leading to openshift operator.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Approval Strategy > Automatic
注意如果您的环境需要,可以使用 Installation mode > All namespaces on the cluster 和 Approval Strategy > Manual settings。
- 点 Install,等待片刻,直到 Camel K Operator 准备就绪。
下载并安装 Camel K CLI 工具:
- 在 OpenShift Web 控制台顶部的 帮助菜单(?) 中,选择 Command line tools。
- 向下滚动到 kamel - Red Hat Integration - Camel K - Command Line Interface 部分。
- 单击链接以下载本地操作系统的二进制文件(Linux、Mac、Windows)。
- 在您的系统路径中解压并安装 CLI。
要验证您可以访问 Kamel K CLI,请打开一个命令窗口,然后输入以下内容:
kamel --help
此命令显示有关 Camel K CLI 命令的信息。
后续步骤
(可选) 指定 Camel K 资源限值
2.1.1. 指定 Camel K 资源限值 复制链接链接已复制到粘贴板!
安装 Camel K 时,Camel K 的 OpenShift pod 没有为 CPU 和内存(RAM)资源设置任何限制。如果要为 Camel K 定义资源限值,您必须编辑在安装过程中创建的 Camel K 订阅资源。
前提条件
- 您有集群管理员访问安装 Camel K Operator 的 OpenShift 项目,如 安装 Camel K 所述。
您知道要应用到 Camel K 订阅的资源限值。有关资源限值的更多信息,请参阅以下文档:
流程
- 登录 OpenShift Web 控制台。
- 选择 Operators > Installed Operators > Operator Details > Subscription。
选择 Actions > Edit Subscription。
订阅的文件在 YAML 编辑器中打开。
在
spec
部分下,添加一个config.resources
部分,并为 memory 和 cpu 提供值,如下例所示:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 保存您的更改。
OpenShift 更新订阅并应用您指定的资源限值。