安装


builds for Red Hat OpenShift 1.1

安装构建

Red Hat OpenShift Documentation Team

摘要

本文档提供有关安装构建的信息。

第 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 控制台安装构建

您可以使用 Red Hat OpenShift Web 控制台的构建从 OperatorHub 安装 Red Hat OpenShift Operator 构建。安装此 Operator 可让您安装和使用构建组件。

流程

  1. 在 Web 控制台的 Administrator 视角中,导航到 OperatorsOperatorHub 页面。
  2. 使用 Filter by keyword 复选框在目录中搜索 Builds for Red Hat OpenShift Operator。
  3. Builds for Red Hat OpenShift Operator 标题。
  4. 阅读有关 Operator 的简单描述并点 Install
  5. Install Operator 页中:

    1. 检查 Installation Mode 是否已设置为 All namespaces on the cluster (default)。此模式将 Operator 安装至默认 openshift-builds 命名空间,以便供集群中的所有命名空间监视和使用。
    2. 检查 Installed Namespace 是否默认设置为 openshift-builds
    3. Approval Strategy 选择 Automatic。这样可确保以后对 Operator 的升级由 Operator Lifecycle Manager (OLM) 自动进行。如果您选择 Manual 批准策略,OLM 会创建一个更新请求。作为集群管理员,您必须手动批准 OLM 更新请求,才可将 Operator 更新至新版本。
    4. 选择一个 Update Channel:

      • 更新频道 默认设置为 latest。latest 频道启用 Red Hat OpenShift Operator 构建的最新稳定版本。
      • 要为 Red Hat OpenShift Operator 安装构建的特定版本,集群管理员可以使用对应的 builds-<version> 频道。例如,要为 Red Hat OpenShift Operator 版本 1.1 安装构建,您可以使用 builds-1.1 频道。
  6. Install

验证

安装构建 Red Hat OpenShift Operator 后,您必须验证是否已创建所需资源以确保控制器正常工作。

流程

  1. 在 Web 控制台的 Administrator 视角中,将项目选择为 openshift-builds。
  2. 导航到 OperatorsInstalled Operators 页面。
  3. All instances 选项卡。
  4. All instances 选项卡上,验证是否列出了 OpenShiftBuild & ShipwrightBuild 实例。或者,您也可以单击 Open Shift Build 和 Shipwright Build 选项卡。
  5. 现在,进入到 WorkloadsPods 页面。
  6. Pods 页面中,验证是否列出了以下 pod:

    • openshift-builds operator pod
    • 构建控制器和构建 webhook pod
    • sharedresource daemonset 和 SharedResource Webhook pod

1.3. 使用 CLI 安装构建

您还可以使用命令行界面(CLI)安装构建。

流程

  1. 创建一个 sub.yaml 订阅对象文件,以便为 Red Hat OpenShift Operator 订阅 Builds 的命名空间,如下例所示:

    apiVersion: operators.coreos.com/v1alpha1
    kind: Subscription
    metadata:
      name: openshift-builds-operator
      namespace: openshift-builds
    spec:
      channel: <channel-name> 
    1
    
      name: openshift-builds-operator 
    2
    
      source: redhat-operators 
    3
    
      sourceNamespace: openshift-marketplace 
    4
    Copy to Clipboard Toggle word wrap
    1
    要从中订阅 Operator 的频道名称。
    2
    要订阅的 Operator 的名称。
    3
    提供 Operator 的 CatalogSource 的名称。
    4
    CatalogSource 的命名空间。将 openshift-marketplace 用于默认的 OperatorHub CatalogSource。
  2. 使用以下命令应用订阅对象:

    $ oc apply -f sub.yml
    Copy to Clipboard Toggle word wrap

    Red Hat OpenShift Operator 的 Builds 现已安装在默认目标命名空间 openshift-builds 中。

验证

安装构建 Red Hat OpenShift Operator 后,您必须验证是否已创建以下资源以确保 Operator 正常工作:

  1. 运行以下命令,以确保创建了 OpenshiftBuild 资源:

    $ oc get openshiftbuilds
    Copy to Clipboard Toggle word wrap
  2. 运行以下命令,以确保创建了 ShipwrightBuilds 资源:

    $ oc get shipwrightbuilds
    Copy to Clipboard Toggle word wrap
  3. 运行以下命令,以确保在 openshift-builds 命名空间中创建以下 pod:

    • openshift-builds operator pod
    • 构建控制器和构建 webhook pod
    • sharedresource daemonset 和 SharedResource Webhook pod

      $ oc get pods -n openshift-builds
      Copy to Clipboard Toggle word wrap

      pod 列表显示,如下例所示:

      $ oc get pods -n openshift-builds
      NAME                                                 READY   STATUS    RESTARTS   AGE
      openshift-builds-operator-6f5c48c6b5-cvp2w           2/2     Running   0          13d
      openshift-pipelines-operator-64d8c4969c-952cc        2/2     Running   0          3d13h
      shared-resource-csi-driver-node-gbkqs                2/2     Running   0          13d
      shared-resource-csi-driver-node-kcqxc                2/2     Running   0          13d
      shared-resource-csi-driver-node-sbsvg                2/2     Running   0          13d
      shared-resource-csi-driver-webhook-9d9bd48f4-d5ln6   1/1     Running   0          13d
      shipwright-build-controller-5454475b85-mmm6w         1/1     Running   0          13d
      shipwright-build-webhook-7fbd49c6bb-2n77s            1/1     Running   0          13d
      tekton-operator-webhook-756f5dfdc7-c99mc             1/1     Running   0          3d13h
      Copy to Clipboard Toggle word wrap

1.4. 禁用 ShipwrightBuilds 构建控制器和 webhook pod

您可以在不禁用共享资源 Container Storage Interface (CSI)驱动程序组件和 ShipwrightBuilds 自定义资源定义(CRD)的情况下禁用 ShipwrightBuilds 自定义资源(CR)。禁用 ShipwrightBuilds CR,会从 openshift-builds 命名空间中删除 ShipwrightBuilds 构建控制器和 ShipwrightBuilds 构建 webhook pod。

流程

  • 运行以下命令禁用 ShipwrightBuilds 控制器和 webhook:

    $ oc patch openshiftbuild cluster --type=merge -p '{"spec":{"shipwright":{"build":{"state":"Disabled"}}}}'
    Copy to Clipboard Toggle word wrap

    此命令禁用构建控制器和 Webhook,但不会影响 ShipwrightBuilds CRD。

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.

返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

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

让开源更具包容性

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

關於紅帽

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

Theme

© 2025 Red Hat