第5章 クラスター拡張機能
5.1. クラスター拡張機能の管理 リンクのコピーリンクがクリップボードにコピーされました!
Operator Lifecycle Manager (OLM) v1 はテクノロジープレビュー機能です。テクノロジープレビュー機能は、Red Hat 製品のサービスレベルアグリーメント (SLA) の対象外であり、機能的に完全ではないことがあります。Red Hat は、実稼働環境でこれらを使用することを推奨していません。テクノロジープレビューの機能は、最新の製品機能をいち早く提供して、開発段階で機能のテストを行いフィードバックを提供していただくことを目的としています。
Red Hat のテクノロジープレビュー機能のサポート範囲に関する詳細は、以下のリンクを参照してください。
カタログがクラスターに追加されると、カタログに公開されている拡張機能と Operator のバージョン、パッチ、OTA (over-the-air) 更新にアクセスできるようになります。
カスタムリソース (CR) を使用して、CLI から拡張機能を宣言的に管理できます。
現在、Operator Lifecycle Manager (OLM) v1 は、Red Hat が提供する Operator カタログなどのプライベートレジストリーを認証できません。これは既知の問題です。その結果、Red Hat Operators カタログがインストールされていることを前提とする OLM v1 の手順は機能しません。(OCPBUGS-36364)
5.1.1. サポートされる拡張機能 リンクのコピーリンクがクリップボードにコピーされました!
現在、Operator Lifecycle Manager (OLM) v1 は、次のすべての条件を満たすクラスター拡張機能のインストールをサポートしています。
-
拡張機能は、既存の OLM で導入された
registry+v1バンドル形式を使用する必要があります。 -
拡張機能は、
AllNamespacesインストールモードによるインストールをサポートする必要があります。 - 拡張機能は Webhook を使用してはなりません。
拡張機能は、次に示すいずれかのファイルベースのカタログプロパティーを使用して依存関係を宣言してはなりません。
-
olm.gvk.required -
olm.package.required -
olm.constraint
-
OLM v1 は、インストールする拡張機能がこれらの制約を満たしているかどうかを確認します。インストールする拡張機能がこれらの制約を満たしていない場合、クラスター拡張機能の条件にエラーメッセージが出力されます。
Operator Lifecycle Manager (OLM) v1 は、既存の OLM で導入された OperatorConditions API をサポートしていません。
拡張機能が OperatorConditions API のみに依存して更新を管理している場合、拡張機能が正しくインストールされない可能性があります。この API に依存する拡張機能のほとんどは起動時に失敗しますが、一部は調整中に失敗する可能性があります。
回避策として、拡張機能を特定のバージョンに固定できます。拡張機能を更新する場合は、拡張機能のドキュメントを参照して、いつ拡張機能を新しいバージョンに固定すれば安全か確認してください。
5.1.2. カタログからインストールする Operator を見つける リンクのコピーリンクがクリップボードにコピーされました!
クラスターにカタログを追加した後、カタログにクエリーを実行して、インストールする Operator と拡張機能を見つけることができます。カタログをクエリーする前に、カタログサーバーサービスをポート転送する必要があります。
前提条件
- クラスターにカタログを追加している。
-
jqCLI ツールがインストールされている。
手順
次のコマンドを実行して、
openshift-catalogdnamespace のカタログサーバーサービスのポート転送を行います。$ oc -n openshift-catalogd port-forward svc/catalogd-catalogserver 8080:443新しいターミナルウィンドウまたはタブで、次のコマンドを実行してカタログの JSON ファイルをローカルにダウンロードします。
$ curl -L -k https://localhost:8080/catalogs/<catalog_name>/all.json \ -C - -o /<path>/<catalog_name>.json例5.1 コマンドの例
$ curl -L -k https://localhost:8080/catalogs/redhat-operators/all.json \ -C - -o /home/username/catalogs/rhoc.json次のコマンドのいずれかを実行して、カタログ内のオペレータと拡張機能のリストを返します。
重要現在、Operator Lifecycle Manager (OLM) v1 は、次のすべての条件を満たすクラスター拡張機能のインストールをサポートしています。
-
拡張機能は、既存の OLM で導入された
registry+v1バンドル形式を使用する必要があります。 -
拡張機能は、
AllNamespacesインストールモードによるインストールをサポートする必要があります。 - 拡張機能は Webhook を使用してはなりません。
拡張機能は、次に示すいずれかのファイルベースのカタログプロパティーを使用して依存関係を宣言してはなりません。
-
olm.gvk.required -
olm.package.required -
olm.constraint
-
OLM v1 は、インストールする拡張機能がこれらの制約を満たしているかどうかを確認します。インストールする拡張機能がこれらの制約を満たしていない場合、クラスター拡張機能の条件にエラーメッセージが出力されます。
次のコマンドを実行して、ローカルカタログファイルからすべての Operator と拡張機能のリストを取得します。
$ jq -s '.[] | select(.schema == "olm.package") | .name' \ /<path>/<filename>.json例5.2 コマンドの例
$ jq -s '.[] | select(.schema == "olm.package") | .name' \ /home/username/catalogs/rhoc.json例5.3 出力例
NAME AGE "3scale-operator" "advanced-cluster-management" "amq-broker-rhel8" "amq-online" "amq-streams" "amq7-interconnect-operator" "ansible-automation-platform-operator" "ansible-cloud-addons-operator" "apicast-operator" "aws-efs-csi-driver-operator" "aws-load-balancer-operator" "bamoe-businessautomation-operator" "bamoe-kogito-operator" "bare-metal-event-relay" "businessautomation-operator" ...次のコマンドを実行して、
AllNamespacesインストールモードをサポートし、Webhook を使用しないパッケージのリストを、ローカルカタログファイルから取得します。$ jq -c 'select(.schema == "olm.bundle") | \ {"package":.package, "version":.properties[] | \ select(.type == "olm.bundle.object").value.data | @base64d | fromjson | \ select(.kind == "ClusterServiceVersion" and (.spec.installModes[] | \ select(.type == "AllNamespaces" and .supported == true) != null) \ and .spec.webhookdefinitions == null).spec.version}' \ /<path>/<catalog_name>.json例5.4 出力例
{"package":"3scale-operator","version":"0.10.0-mas"} {"package":"3scale-operator","version":"0.10.5"} {"package":"3scale-operator","version":"0.11.0-mas"} {"package":"3scale-operator","version":"0.11.1-mas"} {"package":"3scale-operator","version":"0.11.2-mas"} {"package":"3scale-operator","version":"0.11.3-mas"} {"package":"3scale-operator","version":"0.11.5-mas"} {"package":"3scale-operator","version":"0.11.6-mas"} {"package":"3scale-operator","version":"0.11.7-mas"} {"package":"3scale-operator","version":"0.11.8-mas"} {"package":"amq-broker-rhel8","version":"7.10.0-opr-1"} {"package":"amq-broker-rhel8","version":"7.10.0-opr-2"} {"package":"amq-broker-rhel8","version":"7.10.0-opr-3"} {"package":"amq-broker-rhel8","version":"7.10.0-opr-4"} {"package":"amq-broker-rhel8","version":"7.10.1-opr-1"} {"package":"amq-broker-rhel8","version":"7.10.1-opr-2"} {"package":"amq-broker-rhel8","version":"7.10.2-opr-1"} {"package":"amq-broker-rhel8","version":"7.10.2-opr-2"} ...
-
拡張機能は、既存の OLM で導入された
次のコマンドを実行して、Operator または拡張機能のメタデータの内容を検査します。
$ jq -s '.[] | select( .schema == "olm.package") | \ select( .name == "<package_name>")' /<path>/<catalog_name>.json例5.5 コマンドの例
$ jq -s '.[] | select( .schema == "olm.package") | \ select( .name == "openshift-pipelines-operator-rh")' \ /home/username/rhoc.json例5.6 出力例
{ "defaultChannel": "stable", "icon": { "base64data": "PHN2ZyB4bWxu..." "mediatype": "image/png" }, "name": "openshift-pipelines-operator-rh", "schema": "olm.package" }
5.1.2.1. 一般的なカタログクエリー リンクのコピーリンクがクリップボードにコピーされました!
jq CLI ツールを使用して、カタログをクエリーできます。
| クエリー | Request |
|---|---|
| カタログで利用可能なパッケージ |
|
|
|
|
| パッケージのメタデータ |
|
| パッケージ内のカタログブロブ |
|
| クエリー | Request |
|---|---|
| パッケージのチャネル |
|
| チャネル内のバージョン |
|
|
|
| クエリー | Request |
|---|---|
| パッケージ内のバンドル |
|
|
|
5.1.3. クラスター拡張機能の管理に使用するサービスアカウントの作成 リンクのコピーリンクがクリップボードにコピーされました!
既存の Operator Lifecycle Manager (OLM) とは異なり、OLM v1 にはクラスター拡張機能をインストール、更新、および管理する権限がありません。クラスター管理者は、サービスアカウントを作成し、クラスター拡張機能のインストール、更新、管理に必要なロールベースのアクセス制御 (RBAC) を割り当てる必要があります。
OLM v1 には既知の問題があります。拡張機能のサービスアカウントに適切なロールベースのアクセス制御 (RBAC) を割り当てなければ、OLM v1 が停止し、調整が停止します。
現在、OLM v1 には、拡張機能管理者がサービスアカウントの適切な RBAC を見つけるために使用できるツールはありません。
OLM v1 はテクノロジープレビュー機能であり、実稼働クラスターでは使用できないため、この問題を回避するためには、ドキュメントに含まれているより許容度の高い RBAC を使用します。
この RBAC はテスト目的に限定して使用できます。実稼働クラスターでは使用しないでください。
前提条件
-
cluster-admin権限を持つアカウントを使用して OpenShift Container Platform クラスターにアクセスできる。
手順
次の例のように、サービスアカウントを作成します。
apiVersion: v1 kind: ServiceAccount metadata: name: <extension>-installer namespace: <namespace>例5.7
extension-service-account.yamlファイルの例apiVersion: v1 kind: ServiceAccount metadata: name: pipelines-installer namespace: pipelines次のコマンドを実行してサービスアカウントを適用します。
$ oc apply -f extension-service-account.yaml次の例のように、クラスターロールを作成し、RBAC を割り当てます。
警告次のクラスターロールは、最小権限の原則に従っていません。このクラスターロールはテスト目的に限定して使用できます。実稼働クラスターでは使用しないでください。
apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: name: <extension>-installer-clusterrole rules: - apiGroups: ["*"] resources: ["*"] verbs: ["*"]例5.8
pipelines-cluster-role.yamlファイルの例apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: name: pipelines-installer-clusterrole rules: - apiGroups: ["*"] resources: ["*"] verbs: ["*"]次のコマンドを実行して、クラスターにクラスターロールを追加します。
$ oc apply -f pipelines-role.yaml次の例のように、クラスターロールバインディングを作成して、クラスターロールによって付与された権限をサービスアカウントにバインドします。
apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: name: <extension>-installer-binding roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole name: <extension>-installer-clusterrole subjects: - kind: ServiceAccount name: <extension>-installer namespace: <namespace>例5.9
pipelines-cluster-role-binding.yamlファイルの例apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: name: pipelines-installer-binding roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole name: pipelines-installer-clusterrole subjects: - kind: ServiceAccount name: pipelines-installer namespace: pipelines次のコマンドを実行して、クラスターロールバインディングを適用します。
$ oc apply -f pipelines-cluster-role-binding.yaml
5.1.4. カタログからのクラスター拡張のインストール リンクのコピーリンクがクリップボードにコピーされました!
カスタムリソース (CR) を作成し、それをクラスターに適用することで、カタログから拡張機能をインストールできます。Operator Lifecycle Manager (OLM) v1 は、クラスターにスコープ指定された、registry+v1 バンドル形式を介した既存の OLM Operator などの、クラスター拡張機能のインストールをサポートします。詳細は、サポートされている拡張機能 を参照してください。
現在、Operator Lifecycle Manager (OLM) v1 は、Red Hat が提供する Operator カタログなどのプライベートレジストリーを認証できません。これは既知の問題です。その結果、Red Hat Operators カタログがインストールされていることを前提とする OLM v1 の手順は機能しません。(OCPBUGS-36364)
前提条件
- クラスターにカタログを追加している。
- カタログファイルのローカルコピーをダウンロードしている。
-
jqCLI ツールがインストールされている。 - サービスアカウントを作成し、インストールする拡張機能をインストール、更新、管理するために十分なロールベースのアクセス制御 (RBAC) を割り当てました。詳細は GCP サービスアカウントの作成 を参照してください。
手順
次の手順を実行して、カタログファイルのローカルコピーからパッケージのチャネルとバージョン情報を検査します。
次のコマンドを実行して、選択したパッケージからチャネルのリストを取得します。
$ jq -s '.[] | select( .schema == "olm.channel" ) | \ select( .package == "<package_name>") | \ .name' /<path>/<catalog_name>.json例5.10 コマンドの例
$ jq -s '.[] | select( .schema == "olm.channel" ) | \ select( .package == "openshift-pipelines-operator-rh") | \ .name' /home/username/rhoc.json例5.11 出力例
"latest" "pipelines-1.11" "pipelines-1.12" "pipelines-1.13" "pipelines-1.14"次のコマンドを実行して、チャネルで公開されているバージョンのリストを取得します。
$ jq -s '.[] | select( .package == "<package_name>" ) | \ select( .schema == "olm.channel" ) | \ select( .name == "<channel_name>" ) | .entries | \ .[] | .name' /<path>/<catalog_name>.json例5.12 コマンドの例
$ jq -s '.[] | select( .package == "openshift-pipelines-operator-rh" ) | \ select( .schema == "olm.channel" ) | select( .name == "latest" ) | \ .entries | .[] | .name' /home/username/rhoc.json例5.13 出力例
"openshift-pipelines-operator-rh.v1.12.0" "openshift-pipelines-operator-rh.v1.12.1" "openshift-pipelines-operator-rh.v1.12.2" "openshift-pipelines-operator-rh.v1.13.0" "openshift-pipelines-operator-rh.v1.13.1" "openshift-pipelines-operator-rh.v1.11.1" "openshift-pipelines-operator-rh.v1.12.0" "openshift-pipelines-operator-rh.v1.12.1" "openshift-pipelines-operator-rh.v1.12.2" "openshift-pipelines-operator-rh.v1.13.0" "openshift-pipelines-operator-rh.v1.14.1" "openshift-pipelines-operator-rh.v1.14.2" "openshift-pipelines-operator-rh.v1.14.3" "openshift-pipelines-operator-rh.v1.14.4"
拡張機能を新しい namespace にインストールする場合は、次のコマンドを実行します。
$ oc adm new-project <new_namespace>次の例のような CR を作成します。
pipelines-operator.yamlCR の例apiVersion: olm.operatorframework.io/v1alpha1 kind: ClusterExtension metadata: name: pipelines-operator spec: packageName: openshift-pipelines-operator-rh installNamespace: <namespace> serviceAccount: name: <service_account> channel: <channel> version: "<version>"ここでは、以下のようになります。
<namespace>-
pipelinesやmy-extensionなど、バンドルをインストールする namespace を指定します。拡張機能は継続してクラスタースコープであり、異なる namespace にインストールされているリソースが含まれる可能性があります。 <service_account>- 拡張機能をインストール、更新、管理するために作成したサービスアカウントの名前を指定します。
<channel>-
オプション: インストールまたは更新するパッケージのチャネル (
pipelines-1.11、latestなど) を指定します。 <version>オプション: インストールまたは更新するパッケージのバージョンまたはバージョン範囲 (
1.11.1、1.12.x、>=1.12.1など) を指定します。詳細は、「ターゲットバージョンを指定するカスタムリソース (CR) の例」および「バージョン範囲のサポート」を参照してください。重要一意の名前を持たない Operator または拡張機能をインストールしようとすると、インストールが失敗するか、予期しない結果になる可能性があります。その原因は以下のとおりです。
- クラスターに複数のカタログがインストールされている場合、Operator Lifecycle Manager (OLM) v1 には、Operator または拡張機能のインストール時にカタログを指定するメカニズムがありません。
- OLM v1 では、クラスターにインストールできるすべての Operator および拡張機能のバンドルとパッケージに、一意の名前が使用されている必要があります。
次のコマンドを実行して、CR をクラスターに適用します。
$ oc apply -f pipeline-operator.yaml出力例
clusterextension.olm.operatorframework.io/pipelines-operator created
検証
次のコマンドを実行して、Operator または拡張機能の CR を YAML 形式で表示します。
$ oc get clusterextension pipelines-operator -o yaml例5.14 出力例
apiVersion: v1 items: - apiVersion: olm.operatorframework.io/v1alpha1 kind: ClusterExtension metadata: annotations: kubectl.kubernetes.io/last-applied-configuration: | {"apiVersion":"olm.operatorframework.io/v1alpha1","kind":"ClusterExtension","metadata":{"annotations":{},"name":"pipelines-operator"},"spec":{"channel":"latest","installNamespace":"pipelines","packageName":"openshift-pipelines-operator-rh","serviceAccount":{"name":"pipelines-installer"},"pollInterval":"30m"}} creationTimestamp: "2024-06-10T17:50:51Z" finalizers: - olm.operatorframework.io/cleanup-unpack-cache generation: 1 name: pipelines-operator resourceVersion: "53324" uid: c54237be-cde4-46d4-9b31-d0ec6acc19bf spec: channel: latest installNamespace: pipelines packageName: openshift-pipelines-operator-rh serviceAccount: name: pipelines-installer upgradeConstraintPolicy: Enforce status: conditions: - lastTransitionTime: "2024-06-10T17:50:58Z" message: resolved to "registry.redhat.io/openshift-pipelines/pipelines-operator-bundle@sha256:dd3d18367da2be42539e5dde8e484dac3df33ba3ce1d5bcf896838954f3864ec" observedGeneration: 1 reason: Success status: "True" type: Resolved - lastTransitionTime: "2024-06-10T17:51:11Z" message: installed from "registry.redhat.io/openshift-pipelines/pipelines-operator-bundle@sha256:dd3d18367da2be42539e5dde8e484dac3df33ba3ce1d5bcf896838954f3864ec" observedGeneration: 1 reason: Success status: "True" type: Installed - lastTransitionTime: "2024-06-10T17:50:58Z" message: "" observedGeneration: 1 reason: Deprecated status: "False" type: Deprecated - lastTransitionTime: "2024-06-10T17:50:58Z" message: "" observedGeneration: 1 reason: Deprecated status: "False" type: PackageDeprecated - lastTransitionTime: "2024-06-10T17:50:58Z" message: "" observedGeneration: 1 reason: Deprecated status: "False" type: ChannelDeprecated - lastTransitionTime: "2024-06-10T17:50:58Z" message: "" observedGeneration: 1 reason: Deprecated status: "False" type: BundleDeprecated - lastTransitionTime: "2024-06-10T17:50:58Z" message: 'unpack successful: observedGeneration: 1 reason: UnpackSuccess status: "True" type: Unpacked installedBundle: name: openshift-pipelines-operator-rh.v1.14.4 version: 1.14.4 resolvedBundle: name: openshift-pipelines-operator-rh.v1.14.4 version: 1.14.4ここでは、以下のようになります。
spec.channel- 拡張の CR で定義されたチャネルを表示します。
spec.version- 拡張の CR で定義されたバージョンまたはバージョン範囲を表示します。
status.conditions- 拡張機能のステータスと健全性に関する情報を表示します。
type: Deprecated次の 1 つ以上が非推奨かどうかを表示します。
type: PackageDeprecated- 解決されたパッケージが非推奨かどうかを表示します。
type: ChannelDeprecated- 解決されたチャネルが非推奨かどうかを表示します。
type: BundleDeprecated- 解決されたバンドルが非推奨かどうかを表示します。
statusフィールドのFalseの値はreason: Deprecated条件が非推奨ではないことを示します。ステータスフィールドのTrueの値はreason: Deprecated条件が非推奨であることを示します。installedBundle.name- インストールされているバンドルの名前を表示します。
installedBundle.version- インストールされているバンドルのバージョンを表示します。
resolvedBundle.name- 解決されたバンドルの名前を表示します。
resolvedBundle.version- 解決されたバンドルのバージョンを表示します。
5.1.5. クラスター拡張機能の更新 リンクのコピーリンクがクリップボードにコピーされました!
カスタムリソース (CR) を手動で編集し、変更を適用することで、クラスター拡張機能または Operator を更新できます。
前提条件
- カタログがインストールされています。
- カタログファイルのローカルコピーをダウンロードしている。
- Operator または拡張機能がインストールされている。
-
jqCLI ツールがインストールされている。
手順
次の手順を実行して、カタログファイルのローカルコピーからパッケージのチャネルとバージョン情報を検査します。
次のコマンドを実行して、選択したパッケージからチャネルのリストを取得します。
$ jq -s '.[] | select( .schema == "olm.channel" ) | \ select( .package == "<package_name>") | \ .name' /<path>/<catalog_name>.json例5.15 コマンドの例
$ jq -s '.[] | select( .schema == "olm.channel" ) | \ select( .package == "openshift-pipelines-operator-rh") | \ .name' /home/username/rhoc.json例5.16 出力例
"latest" "pipelines-1.11" "pipelines-1.12" "pipelines-1.13" "pipelines-1.14"次のコマンドを実行して、チャネルで公開されているバージョンのリストを取得します。
$ jq -s '.[] | select( .package == "<package_name>" ) | \ select( .schema == "olm.channel" ) | \ select( .name == "<channel_name>" ) | .entries | \ .[] | .name' /<path>/<catalog_name>.json例5.17 コマンドの例
$ jq -s '.[] | select( .package == "openshift-pipelines-operator-rh" ) | \ select( .schema == "olm.channel" ) | select( .name == "latest" ) | \ .entries | .[] | .name' /home/username/rhoc.json例5.18 出力例
"openshift-pipelines-operator-rh.v1.11.1" "openshift-pipelines-operator-rh.v1.12.0" "openshift-pipelines-operator-rh.v1.12.1" "openshift-pipelines-operator-rh.v1.12.2" "openshift-pipelines-operator-rh.v1.13.0" "openshift-pipelines-operator-rh.v1.14.1" "openshift-pipelines-operator-rh.v1.14.2" "openshift-pipelines-operator-rh.v1.14.3" "openshift-pipelines-operator-rh.v1.14.4"
次のコマンドを実行して、Operator または拡張機能の CR で指定されているバージョンまたはチャネルを確認します。
$ oc get clusterextension <operator_name> -o yamlコマンドの例
$ oc get clusterextension pipelines-operator -o yaml例5.19 出力例
apiVersion: olm.operatorframework.io/v1alpha1 kind: ClusterExtension metadata: annotations: kubectl.kubernetes.io/last-applied-configuration: | {"apiVersion":"olm.operatorframework.io/v1alpha1","kind":"ClusterExtension","metadata":{"annotations":{},"name":"pipelines-operator"},"spec":{"channel":"latest","installNamespace":"openshift-operators","packageName":"openshift-pipelines-operator-rh","pollInterval":"30m","version":"\u003c1.12"}} creationTimestamp: "2024-06-11T15:55:37Z" generation: 1 name: pipelines-operator resourceVersion: "69776" uid: 6a11dff3-bfa3-42b8-9e5f-d8babbd6486f spec: channel: latest installNamespace: openshift-operators packageName: openshift-pipelines-operator-rh upgradeConstraintPolicy: Enforce version: <1.12 status: conditions: - lastTransitionTime: "2024-06-11T15:56:09Z" message: installed from "registry.redhat.io/openshift-pipelines/pipelines-operator-bundle@sha256:e09d37bb1e754db42324fd18c1cb3e7ce77e7b7fcbf4932d0535391579938280" observedGeneration: 1 reason: Success status: "True" type: Installed - lastTransitionTime: "2024-06-11T15:55:50Z" message: resolved to "registry.redhat.io/openshift-pipelines/pipelines-operator-bundle@sha256:e09d37bb1e754db42324fd18c1cb3e7ce77e7b7fcbf4932d0535391579938280" observedGeneration: 1 reason: Success status: "True" type: Resolved - lastTransitionTime: "2024-06-11T15:55:50Z" message: "" observedGeneration: 1 reason: Deprecated status: "False" type: Deprecated - lastTransitionTime: "2024-06-11T15:55:50Z" message: "" observedGeneration: 1 reason: Deprecated status: "False" type: PackageDeprecated - lastTransitionTime: "2024-06-11T15:55:50Z" message: "" observedGeneration: 1 reason: Deprecated status: "False" type: ChannelDeprecated - lastTransitionTime: "2024-06-11T15:55:50Z" message: "" observedGeneration: 1 reason: Deprecated status: "False" type: BundleDeprecated installedBundle: name: openshift-pipelines-operator-rh.v1.11.1 version: 1.11.1 resolvedBundle: name: openshift-pipelines-operator-rh.v1.11.1 version: 1.11.1次のいずれかの方法を使用して CR を編集します。
Operator または拡張機能を特定のバージョン (
1.12.1など) に固定する場合は、次の例のように CR を編集します。pipelines-operator.yamlCR の例apiVersion: olm.operatorframework.io/v1alpha1 kind: ClusterExtension metadata: name: pipelines-operator spec: packageName: openshift-pipelines-operator-rh installNamespace: <namespace> version: "1.12.1"1 - 1
- バージョンを
1.11.1から1.12.1に更新します。
許容可能な更新バージョンの範囲を定義する場合は、次の例のように CR を編集します。
バージョン範囲を指定した CR の例
apiVersion: olm.operatorframework.io/v1alpha1 kind: ClusterExtension metadata: name: pipelines-operator spec: packageName: openshift-pipelines-operator-rh installNamespace: <namespace> version: ">1.11.1, <1.13"1 - 1
- 必要なバージョン範囲が、バージョン
1.11.1より大きく、1.13より小さいことを指定します。詳細は、「バージョン範囲のサポート」および「バージョン比較文字列」を参照してください。
チャネルから解決できる最新バージョンに更新する場合は、次の例のように CR を編集します。
チャネルを指定した CR の例
apiVersion: olm.operatorframework.io/v1alpha1 kind: ClusterExtension metadata: name: pipelines-operator spec: packageName: openshift-pipelines-operator-rh installNamespace: <namespace> channel: pipelines-1.131 - 1
- 指定されたチャネルから解決できる最新リリースをインストールします。チャネルへの更新は自動的にインストールされます。
チャネルとバージョンまたはバージョン範囲を指定する場合は、次の例のように CR を編集します。
チャネルとバージョン範囲を指定した CR の例
apiVersion: olm.operatorframework.io/v1alpha1 kind: ClusterExtension metadata: name: pipelines-operator spec: packageName: openshift-pipelines-operator-rh installNamespace: <namespace> channel: latest version: "<1.13"詳細は、「ターゲットバージョンを指定するカスタムリソース (CR) の例」を参照してください。
次のコマンドを実行して、クラスターに更新を適用します。
$ oc apply -f pipelines-operator.yaml出力例
clusterextension.olm.operatorframework.io/pipelines-operator configuredヒント次のコマンドを実行すると、CLI から CR にパッチを適用して変更を適用できます。
$ oc patch clusterextension/pipelines-operator -p \ '{"spec":{"version":"<1.13"}}' \ --type=merge出力例
clusterextension.olm.operatorframework.io/pipelines-operator patched
検証
次のコマンドを実行して、チャネルとバージョンの更新が適用されていることを確認します。
$ oc get clusterextension pipelines-operator -o yaml例5.20 出力例
apiVersion: olm.operatorframework.io/v1alpha1 kind: ClusterExtension metadata: annotations: kubectl.kubernetes.io/last-applied-configuration: | {"apiVersion":"olm.operatorframework.io/v1alpha1","kind":"ClusterExtension","metadata":{"annotations":{},"name":"pipelines-operator"},"spec":{"channel":"latest","installNamespace":"openshift-operators","packageName":"openshift-pipelines-operator-rh","pollInterval":"30m","version":"\u003c1.13"}} creationTimestamp: "2024-06-11T18:23:26Z" generation: 2 name: pipelines-operator resourceVersion: "66310" uid: ce0416ba-13ea-4069-a6c8-e5efcbc47537 spec: channel: latest installNamespace: openshift-operators packageName: openshift-pipelines-operator-rh upgradeConstraintPolicy: Enforce version: <1.13 status: conditions: - lastTransitionTime: "2024-06-11T18:23:33Z" message: resolved to "registry.redhat.io/openshift-pipelines/pipelines-operator-bundle@sha256:814742c8a7cc7e2662598e114c35c13993a7b423cfe92548124e43ea5d469f82" observedGeneration: 2 reason: Success status: "True" type: Resolved - lastTransitionTime: "2024-06-11T18:23:52Z" message: installed from "registry.redhat.io/openshift-pipelines/pipelines-operator-bundle@sha256:814742c8a7cc7e2662598e114c35c13993a7b423cfe92548124e43ea5d469f82" observedGeneration: 2 reason: Success status: "True" type: Installed - lastTransitionTime: "2024-06-11T18:23:33Z" message: "" observedGeneration: 2 reason: Deprecated status: "False" type: Deprecated - lastTransitionTime: "2024-06-11T18:23:33Z" message: "" observedGeneration: 2 reason: Deprecated status: "False" type: PackageDeprecated - lastTransitionTime: "2024-06-11T18:23:33Z" message: "" observedGeneration: 2 reason: Deprecated status: "False" type: ChannelDeprecated - lastTransitionTime: "2024-06-11T18:23:33Z" message: "" observedGeneration: 2 reason: Deprecated status: "False" type: BundleDeprecated installedBundle: name: openshift-pipelines-operator-rh.v1.12.2 version: 1.12.2 resolvedBundle: name: openshift-pipelines-operator-rh.v1.12.2 version: 1.12.2
トラブルシューティング
非推奨または存在しないターゲットバージョンまたはチャネルを指定する場合は、次のコマンドを実行して拡張機能のステータスを確認できます。
$ oc get clusterextension <operator_name> -o yaml例5.21 存在しないバージョンの出力例
apiVersion: olm.operatorframework.io/v1alpha1 kind: ClusterExtension metadata: annotations: kubectl.kubernetes.io/last-applied-configuration: | {"apiVersion":"olm.operatorframework.io/v1alpha1","kind":"ClusterExtension","metadata":{"annotations":{},"name":"pipelines-operator"},"spec":{"channel":"latest","installNamespace":"openshift-operators","packageName":"openshift-pipelines-operator-rh","pollInterval":"30m","version":"3.0"}} creationTimestamp: "2024-06-11T18:23:26Z" generation: 3 name: pipelines-operator resourceVersion: "71852" uid: ce0416ba-13ea-4069-a6c8-e5efcbc47537 spec: channel: latest installNamespace: openshift-operators packageName: openshift-pipelines-operator-rh upgradeConstraintPolicy: Enforce version: "3.0" status: conditions: - lastTransitionTime: "2024-06-11T18:29:02Z" message: 'error upgrading from currently installed version "1.12.2": no package "openshift-pipelines-operator-rh" matching version "3.0" found in channel "latest"' observedGeneration: 3 reason: ResolutionFailed status: "False" type: Resolved - lastTransitionTime: "2024-06-11T18:29:02Z" message: installation has not been attempted as resolution failed observedGeneration: 3 reason: InstallationStatusUnknown status: Unknown type: Installed - lastTransitionTime: "2024-06-11T18:29:02Z" message: deprecation checks have not been attempted as resolution failed observedGeneration: 3 reason: Deprecated status: Unknown type: Deprecated - lastTransitionTime: "2024-06-11T18:29:02Z" message: deprecation checks have not been attempted as resolution failed observedGeneration: 3 reason: Deprecated status: Unknown type: PackageDeprecated - lastTransitionTime: "2024-06-11T18:29:02Z" message: deprecation checks have not been attempted as resolution failed observedGeneration: 3 reason: Deprecated status: Unknown type: ChannelDeprecated - lastTransitionTime: "2024-06-11T18:29:02Z" message: deprecation checks have not been attempted as resolution failed observedGeneration: 3 reason: Deprecated status: Unknown type: BundleDeprecated
5.1.6. Operator の削除 リンクのコピーリンクがクリップボードにコピーされました!
ClusterExtension カスタムリソース (CR) を削除することで、Operator とそのカスタムリソース定義 (CRD) を削除できます。
前提条件
- カタログがインストールされています。
- Operator がインストールされています。
手順
次のコマンドを実行して、Operator とその CRD を削除します。
$ oc delete clusterextension <operator_name>出力例
clusterextension.olm.operatorframework.io "<operator_name>" deleted
検証
次のコマンドを実行して、Operator とそのリソースが削除されたことを確認します。
次のコマンドを実行して、Operator が削除されたことを確認します。
$ oc get clusterextensions出力例
No resources found次のコマンドを実行して、Operator のシステム namespace が削除されたことを確認します。
$ oc get ns <operator_name>-system出力例
Error from server (NotFound): namespaces "<operator_name>-system" not found