安装
第 1 章 安装构建 复制链接链接已复制到粘贴板!
作为集群管理员,您可以在 OpenShift Container Platform 集群上安装构建。
1.1. 先决条件 复制链接链接已复制到粘贴板!
- 访问 OpenShift Container Platform web 控制台。
-
已安装
oc
CLI。 - 以管理员身份登陆到 OpenShift Container Platform 集群。
- 您的集群启用了 Marketplace 功能,或者手动配置 Red Hat Operator 目录源。
作为依赖项组件,Red Hat OpenShift Pipelines Operator 在安装过程中会自动与 Red Hat OpenShift Operator 构建一起安装。如果您已经安装了 Red Hat OpenShift Pipelines Operator,则 Builds 会将该 Operator 用于其正常工作。
1.2. 使用 Web 控制台安装构建 复制链接链接已复制到粘贴板!
您可以使用 OpenShift Container Platform Web 控制台从 OperatorHub 安装 Red Hat OpenShift Operator 的构建。安装此 Operator 可让您安装和使用构建组件。
流程
- 在 Web 控制台的 Administrator 视角中,导航到 Operators → OperatorHub 页面。
- 使用 Filter by keyword 复选框在目录中搜索 Red Hat OpenShift Operator 的 Builds。
- 点 Builds for Red Hat OpenShift Operator 标题。
- 阅读有关 Operator 的简单描述,然后点 Install。
在 Install Operator 页面中:
-
检查 Installation Mode 是否已设置为 All namespaces on the cluster (default)。选择该项会将 Operator 安装至默认
openshift-operators
命名空间,以便供集群中的所有命名空间监视和使用。 -
检查 Installed Namespace 是否默认设置为
openshift-operators
。 - 为 Approval Strategy 选择 Automatic。这样可确保以后对 Operator 的升级由 Operator Lifecycle Manager (OLM) 自动进行。如果您选择 Manual 批准策略,OLM 会创建一个更新请求。作为集群管理员,您必须手动批准 OLM 更新请求,才可将 Operator 更新至新版本。
选择一个 Update Channel:
- 更新频道 默认设置为 latest。latest 频道启用 Red Hat OpenShift Operator 构建的最新稳定版本。
-
要为 Red Hat OpenShift Operator 安装构建的特定版本,集群管理员可以使用对应的
openshift-builds-<version>
频道。例如,要为 Red Hat OpenShift Operator 版本0.11.0
安装构建,您可以使用openshift-builds-0.11.0
频道。
-
检查 Installation Mode 是否已设置为 All namespaces on the cluster (default)。选择该项会将 Operator 安装至默认
- 点 Install。
验证
- 在 Installed Operators 页面中,验证列出了 Red Hat OpenShift Operator 的 Builds,其 Status 设置为 Succeeded 以确认安装成功。
1.2.1. 使用 Web 控制台创建 ShipwrightBuild 资源 复制链接链接已复制到粘贴板!
为 Red Hat OpenShift Operator 安装构建后,您必须创建一个 ShipwrightBuild
资源,以启用构建控制器的功能。
流程
- 在 Web 控制台的 Administrator 视角中,导航到 Operators → Installed Operators 页面。
- 点列表中存在的 Red Hat OpenShift Operator 链接。Operator 详情页面 将打开。
- 选择 Shipwright Build 选项卡,再单击 Create ShipwrightBuild。
选择 Form view 或 YAML 视图来 使用以下方法之一配置新的
ShipwrightBuild
资源:在选择 Form view 或 YAML 视图 时,您会看到为
name
和targetNamespace
字段配置的默认值。如果您不想编辑这些字段,点 Create 使用默认值配置ShipwrightBuild
资源。您可以在 Shipwright Build 选项卡中查看创建的资源。
验证
- 构建控制器和构建 Webhook pod 必须在上述目标命名空间中创建。
1.3. 使用 CLI 安装构建 复制链接链接已复制到粘贴板!
您还可以使用 CLI 安装构建。
流程
创建一个
sub.yaml
订阅对象文件,以便为 Red Hat OpenShift Operator 订阅构建的命名空间,如下例所示:Copy to Clipboard Copied! Toggle word wrap Toggle overflow 使用以下命令应用订阅对象:
oc apply -f sub.yml
$ oc apply -f sub.yml
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Red Hat OpenShift Operator 的 Builds 现在安装在默认目标命名空间
openshift-operators
中。
1.3.1. 使用 CLI 创建 ShipwrightBuild 资源 复制链接链接已复制到粘贴板!
为 Red Hat OpenShift Operator 安装构建后,您必须创建一个 ShipwrightBuild
资源,以启用构建控制器的功能。
流程
创建一个
instance.yaml
文件,在shipwright-builds
命名空间中创建ShipwrightBuild
资源,如下例所示:Copy to Clipboard Copied! Toggle word wrap Toggle overflow 使用以下命令应用 YAML 文件:
oc apply -f instance.yaml
$ oc apply -f instance.yaml
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
验证
运行以下命令验证
ShipwrightBuild
资源现在是否已配置:oc get pods -n shipwright-builds
$ oc get pods -n shipwright-builds
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Legal Notice
复制链接链接已复制到粘贴板!
Copyright © 2025 Red Hat
OpenShift documentation is licensed under the Apache License 2.0 (https://www.apache.org/licenses/LICENSE-2.0).
Modified versions must remove all Red Hat trademarks.
Portions adapted from https://github.com/kubernetes-incubator/service-catalog/ with modifications by Red Hat.
Red Hat, Red Hat Enterprise Linux, the Red Hat logo, the Shadowman 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 Software Collections 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.