5.2. クラスター拡張機能の管理
カタログを使用すると、拡張機能や Operator のバージョン、パッチ、OTA (over-the-air) 更新にアクセスできます。カスタムリソース (CR) を使用して、CLI から拡張機能を宣言的に管理します。
OpenShift Container Platform 4.22 の場合、OLM v1 の手順に関するドキュメントは CLI ベースのもののみとなっています。別の方法として、管理者は、Import YAML ページや Search ページなどの通常の方法を使用して、Web コンソールで関連オブジェクトを作成および表示することもできます。ただし、既存の Software Catalog および Installed Operators ページに OLM v1 コンポーネントはまだ表示されません。
5.2.1. カタログからインストールする Operator を見つける リンクのコピーリンクがクリップボードにコピーされました!
クラスターにカタログを追加した後、カタログにクエリーを実行して、インストールする Operator と拡張機能を見つけることができます。
現在、Operator Lifecycle Manager (OLM) v1 では、catalogd によって管理されるクラスター上のカタログをクエリーすることはできません。OLM v1 では、カタログレジストリーをクエリーするには、opm および jq CLI ツールを使用する必要があります。
前提条件
- クラスターにカタログを追加している。
-
jqCLI ツールがインストールされている。 -
opmがインストールされている。
手順
AllNamespacesインストールモードをサポートし、Webhook を使用しない拡張機能のリストを返すには、次のコマンドを入力します。$ opm render <catalog_registry_url>:<tag> \ | jq -cs '[.[] | select(.schema == "olm.bundle" \ and (.properties[] | select(.type == "olm.csv.metadata").value.installModes[] \ | select(.type == "AllNamespaces" and .supported == true)) \ and .spec.webhookdefinitions == null) | .package] | unique[]'各項目の説明:
catalog_registry_url-
カタログレジストリーの URL (
registry.redhat.io/redhat/redhat-operator-indexなど) を指定します。 tagカタログのタグまたはバージョンを指定します。たとえば、
v4.22またはlatest などです。例5.1 コマンドの例
$ opm render \ registry.redhat.io/redhat/redhat-operator-index:v4.22 \ | jq -cs '[.[] | select(.schema == "olm.bundle" \ and (.properties[] | select(.type == "olm.csv.metadata").value.installModes[] \ | select(.type == "AllNamespaces" and .supported == true)) \ and .spec.webhookdefinitions == null) | .package] | unique[]'例5.2 出力例
"3scale-operator" "amq-broker-rhel8" "amq-online" "amq-streams" "amq-streams-console" "ansible-automation-platform-operator" "ansible-cloud-addons-operator" "apicast-operator" "authorino-operator" "aws-load-balancer-operator" "bamoe-kogito-operator" "cephcsi-operator" "cincinnati-operator" "cluster-logging" "cluster-observability-operator" "compliance-operator" "container-security-operator" "cryostat-operator" "datagrid" "devspaces" ...
次のコマンドを実行して、拡張機能のメタデータの内容を検査します。
$ opm render <catalog_registry_url>:<tag> \ | jq -s '.[] | select( .schema == "olm.package") \ | select( .name == "<package_name>")'例5.3 コマンドの例
$ opm render \ registry.redhat.io/redhat/redhat-operator-index:v4.22 \ | jq -s '.[] | select( .schema == "olm.package") \ | select( .name == "openshift-pipelines-operator-rh")'例5.4 出力例
{ "schema": "olm.package", "name": "openshift-pipelines-operator-rh", "defaultChannel": "latest", "icon": { "base64data": "iVBORw0KGgoAAAANSUhE...", "mediatype": "image/png" } }
5.2.1.1. 一般的なカタログクエリー リンクのコピーリンクがクリップボードにコピーされました!
opm および jq CLI ツールを使用してカタログをクエリーできます。次の表は、拡張機能のインストール、更新、およびライフサイクルの管理時に使用できる一般的なカタログクエリーを示しています。
コマンド構文
$ opm render <catalog_registry_url>:<tag> | <jq_request>
各項目の説明:
catalog_registry_url-
カタログレジストリーの URL (
registry.redhat.io/redhat/redhat-operator-indexなど) を指定します。 tag-
カタログのタグまたはバージョンを指定します。たとえば、
v4.22またはlatest などです。 jq_request- カタログで実行するクエリーを指定します。
例5.5 コマンドの例
$ opm render \
registry.redhat.io/redhat/redhat-operator-index:v4.22 \
| jq -cs '[.[] | select(.schema == "olm.bundle" and (.properties[] \
| select(.type == "olm.csv.metadata").value.installModes[] \
| select(.type == "AllNamespaces" and .supported == true)) \
and .spec.webhookdefinitions == null) \
| .package] | unique[]'
| クエリー | Request |
|---|---|
| カタログで利用可能なパッケージ |
|
|
|
|
| パッケージのメタデータ |
|
| パッケージ内のカタログブロブ |
|
| クエリー | Request |
|---|---|
| パッケージのチャネル |
|
| チャネル内のバージョン |
|
|
|
| クエリー | Request |
|---|---|
| パッケージ内のバンドル |
|
|
|