インストール
第1章 Builds のインストール
クラスター管理者は、OpenShift Container Platform クラスターに Builds をインストールできます。
1.1. 前提条件
- OpenShift Container Platform Web コンソールにアクセスできる。
-
oc
CLI がインストールされている。 - 管理者として OpenShift Container Platform クラスターにログインしている。
- クラスターで Marketplace 機能 が有効になっているか、Red Hat Operator カタログソースが手動で設定されている。
Red Hat OpenShift Pipelines Operator は、依存関係コンポーネントとして、インストール時に Builds for Red Hat OpenShift と合わせて、自動的にインストールされます。Red Hat OpenShift Pipelines Operator がすでにインストールされている場合、Builds はその Operator を使用して機能させます。
1.2. Web コンソールを使用した Builds のインストール
Red Hat OpenShift Web コンソールのビルドを使用して、OperatorHub から Builds for Red Hat OpenShift Operator をインストールできます。この Operator をインストールすると、Build コンポーネントのインストールおよび使用が可能になります。
手順
- Web コンソールの Administrator パースペクティブで、Operators → OperatorHub ページに移動します。
- Filter by keyword ボックスを使用して、Builds for Red Hat OpenShift Operator を検索します。
- Builds for Red Hat OpenShift Operator タイルをクリックします。
- Operator 関する簡単な説明を確認して、Install をクリックします。
Install Operator ページで以下を行います。
-
Installation Mode は All namespaces on the cluster (default) に設定されていることを確認します。このモードでは、Operator がデフォルトの
openshift-builds
namespace にインストールされ、クラスター内のすべての namespace で監視および利用できるようになります。 -
インストールされた namespace がデフォルトで
openshift-builds
に設定されていることを確認します。 - Approval Strategy で Automatic を選択します。これにより、Operator への今後のアップグレードは Operator Lifecycle Manager (OLM) によって自動的に処理されます。Manual 承認ストラテジーを選択すると、OLM は更新要求を作成します。クラスター管理者は、Operator を新規バージョンに更新できるように OLM 更新要求を手動で承認する必要があります。
Update Channel を選択します。
- Update Channel はデフォルトで latest に設定されます。latest チャネルを使用すると、Builds for Red Hat OpenShift Operator の最新の安定バージョンをインストールできます。
-
Builds for Red Hat OpenShift Operator の特定のバージョンをインストールするには、クラスター管理者は対応する
builds-<version>
チャネルを使用できます。たとえば、Red Hat OpenShift Operator バージョン1.1
の Builds をインストールするには、builds-
1.1 チャネルを使用できます。
-
Installation Mode は All namespaces on the cluster (default) に設定されていることを確認します。このモードでは、Operator がデフォルトの
- Install をクリックします。
検証
Builds for Red Hat OpenShift Operator をインストールした後、コントローラーが適切に機能するために必要なリソースが作成されていることを確認する必要があります。
手順
- Web コンソールの Administrator パースペクティブで、openshift-builds としてプロジェクトを選択します。
- Operators → Installed Operators ページに移動します。
- All instances タブをクリックします。
-
All instances タブで、
OpenShiftBuild
インスタンスおよびShipwrightBuild
インスタンスがリストされていることを確認します。または、OpenShift Build タブと Shipwright Build タブをクリックすることもできます。 - 次に、Workloads → Pods ページに移動します。
Pods ページで、次の Pod がリストされていることを確認します。
-
openshift-builds
Operator Pod - コントローラーを構築し、Webhook Pod を構築する
-
SharedResource
デーモンセットとSharedResource
Webhook Pod
-
1.3. CLI を使用した Builds のインストール
コマンドラインインターフェイス (CLI) を使用してビルドをインストールすることもできます。
手順
以下の例のように、
sub.yaml
サブスクリプションオブジェクトファイルを作成し、namespace を 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
以下のコマンドを実行して subscription オブジェクトを適用します。
$ oc apply -f sub.yml
Builds for Red Hat OpenShift Operator が、デフォルトのターゲット namespace
openshift-builds
にインストールされました。
検証
Builds for Red Hat OpenShift Operator をインストールした後、Operator が適切に機能することを確認するために、次のリソースが作成されていることを確認する必要があります。
次のコマンドを実行して、
OpenshiftBuild
リソースが作成されていることを確認します。$ oc get openshiftbuilds
次のコマンドを実行して、
ShipwrightBuilds
リソースが作成されていることを確認します。$ oc get shipwrightbuilds
次のコマンドを実行して、
openshift-builds
namespace に次の Pod が作成されていることを確認します。-
openshift-builds
Operator Pod - コントローラーを構築し、Webhook Pod を構築する
SharedResource デーモンセットと SharedResource Webhook Pod
$ oc get pods -n openshift-builds
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
-
1.4. ShipwrightBuilds ビルドコントローラーと Webhook Pod の無効化
共有リソースの Container Storage Interface (CSI) ドライバーコンポーネントと ShipwrightBuilds
カスタムリソース定義 (CRD) を無効にせずに、ShipwrightBuilds
カスタムリソース (CR) を無効にできます。ShipwrightBuilds
CR を無効にすると、ShipwrightBuilds
ビルドコントローラーと ShipwrightBuilds
ビルド Webhook Pod が openshift-builds
namespace から削除されます。
手順
次のコマンドを実行して、
ShipwrightBuilds
コントローラーと Webhook を無効にします。$ oc patch openshiftbuild cluster --type=merge -p '{"spec":{"shipwright":{"build":{"state":"Disabled"}}}}'
このコマンドはビルドコントローラーと Webhook を無効にしますが、
ShipwrightBuilds
CRD には影響しません。
1.5. 関連情報
Legal Notice
Copyright © 2024 Red Hat, Inc.
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.