4.13. Image set configuration examples
次の ImageSetConfiguration
ファイルの例は、さまざまなミラーリングのユースケースの設定を示しています。
ユースケース: 最短の OpenShift Container Platform アップグレードパスを含める
以下の ImageSetConfiguration
ファイルは、ローカルストレージバックエンドを使用し、最小バージョン 4.11.37
から最大バージョン 4.12.15
への最短アップグレードパスに沿ってすべての OpenShift Container Platform バージョンを含めます。
ImageSetConfiguration
ファイルの例
apiVersion: mirror.openshift.io/v1alpha2 kind: ImageSetConfiguration storageConfig: local: path: /home/user/metadata mirror: platform: channels: - name: stable-4.12 minVersion: 4.11.37 maxVersion: 4.12.15 shortestPath: true
ユースケース: OpenShift Container Platform の最小バージョンから最新バージョンまでのすべてのバージョンを含める
以下の ImageSetConfiguration
ファイルは、レジストリーストレージバックエンドを使用し、最小バージョン 4.10.10
からチャネルの最新バージョンまでのすべての OpenShift Container Platform バージョンを含みます。
このイメージセット設定で oc-mirror を呼び出すたびに、stable-4.10
チャネルの最新リリースが評価されるため、定期的に oc-mirror を実行すると、OpenShift Container Platform イメージの最新リリースを自動的に受け取ることができます。
ImageSetConfiguration
ファイルの例
apiVersion: mirror.openshift.io/v1alpha2 kind: ImageSetConfiguration storageConfig: registry: imageURL: example.com/mirror/oc-mirror-metadata skipTLS: false mirror: platform: channels: - name: stable-4.10 minVersion: 4.10.10
ユースケース: 最小から最新までの Operator バージョンを含める
次のImageSetConfiguration
ファイルは、ローカルストレージバックエンドを使用し、これには、stable
チャネルの Kubernetes Operator 用の Red Hat Advanced Cluster Security (4.0.1 以降のバージョン) のみが含まれています。
最小または最大のバージョン範囲を指定した場合、その範囲内のすべての Operator バージョンを受信できない可能性があります。
デフォルトで、oc-mirror は、Operator Lifecycle Manager (OLM) 仕様でスキップされたバージョン、または新しいバージョンに置き換えられたバージョンを除外します。スキップされた Operator のバージョンは、CVE の影響を受けるか、バグが含まれている可能性があります。代わりに新しいバージョンを使用してください。スキップおよび置き換えられたバージョンの詳細は、OLM を使用した更新グラフの作成 を参照してください。
指定した範囲内のすべての Operator バージョンを受信するには、mirror.operators.full
フィールドを true
に設定します。
ImageSetConfiguration
ファイルの例
apiVersion: mirror.openshift.io/v1alpha2 kind: ImageSetConfiguration storageConfig: local: path: /home/user/metadata mirror: operators: - catalog: registry.redhat.io/redhat/redhat-operator-index:v4.13 packages: - name: rhacs-operator channels: - name: stable minVersion: 4.0.1
最新バージョンではなく最大バージョンを指定するには、mirror.operators.packages.channels.maxVersion
フィールドを設定します。
ユースケース: Nutanix CSI Operator を含める
次の ImageSetConfiguration
ファイルは、ローカルストレージバックエンドを使用します。このファイルには、Nutanix CSI Operator、OpenShift Update Service (OSUS) グラフイメージ、および追加の Red Hat Universal Base Image (UBI) が含まれます。
ImageSetConfiguration
ファイルの例
kind: ImageSetConfiguration apiVersion: mirror.openshift.io/v1alpha2 storageConfig: registry: imageURL: mylocalregistry/ocp-mirror/openshift4 skipTLS: false mirror: platform: channels: - name: stable-4.11 type: ocp graph: true operators: - catalog: registry.redhat.io/redhat/certified-operator-index:v4.13 packages: - name: nutanixcsioperator channels: - name: stable additionalImages: - name: registry.redhat.io/ubi9/ubi:latest
ユースケース: デフォルトの Operator チャネルを含める
次の ImageSetConfiguration
ファイルには、OpenShift Elasticsearch Operator の stable-5.7
および stable
チャネルが含まれています。安定版 5.7
チャネルのパッケージのみが必要な場合でも、stable
チャネルは Operator のデフォルトチャネルであるため、ImageSetConfiguration
ファイルにも含める必要があります。そのチャネルでバンドルを使用しない場合も、常に Operator パッケージのデフォルトチャネルを含める必要があります。
oc mirror list operators --catalog=<catalog_name> --package=<package_name>
コマンドを実行すると、デフォルトチャネルを見つけることができます。
ImageSetConfiguration
ファイルの例
apiVersion: mirror.openshift.io/v1alpha2 kind: ImageSetConfiguration storageConfig: registry: imageURL: example.com/mirror/oc-mirror-metadata skipTLS: false mirror: operators: - catalog: registry.redhat.io/redhat/redhat-operator-index:v4.13 packages: - name: elasticsearch-operator channels: - name: stable-5.7 - name: stable
ユースケース: カタログ全体を含める (すべてのバージョン)
次の ImageSetConfiguration
ファイルは、mirror.operators.full
フィールドを true
に設定して、Operator カタログ全体のすべてのバージョンを含めます。
ImageSetConfiguration
ファイルの例
apiVersion: mirror.openshift.io/v1alpha2 kind: ImageSetConfiguration storageConfig: registry: imageURL: example.com/mirror/oc-mirror-metadata skipTLS: false mirror: operators: - catalog: registry.redhat.io/redhat/redhat-operator-index:v4.13 full: true
ユースケース: カタログ全体を含める (チャネルヘッドのみ)
次の ImageSetConfiguration
ファイルには、Operator カタログ全体のチャネルヘッドが含まれています。
デフォルトでは、カタログ内の各 Operator において、oc-mirror にはデフォルトチャネルから Operator の最新バージョン (チャネルヘッド) が含まれています。チャネルヘッドだけでなく、すべての Operator バージョンをミラーリングする場合は、mirror.operators.full
フィールドを true
に設定する必要があります。
この例では、targetCatalog
フィールドを使用して、カタログをミラーリングする代替 namespace と名前も指定します。
ImageSetConfiguration
ファイルの例
apiVersion: mirror.openshift.io/v1alpha2 kind: ImageSetConfiguration storageConfig: registry: imageURL: example.com/mirror/oc-mirror-metadata skipTLS: false mirror: operators: - catalog: registry.redhat.io/redhat/redhat-operator-index:v4.13 targetCatalog: my-namespace/my-operator-catalog
ユースケース: 任意のイメージと Helm チャートを含む
次の ImageSetConfiguration
ファイルは、レジストリーストレージバックエンドを使用し、これには Helm チャートと追加の Red Hat Universal Base Image (UBI) が含まれています。
ImageSetConfiguration
ファイルの例
apiVersion: mirror.openshift.io/v1alpha2 kind: ImageSetConfiguration archiveSize: 4 storageConfig: registry: imageURL: example.com/mirror/oc-mirror-metadata skipTLS: false mirror: platform: architectures: - "s390x" channels: - name: stable-4.13 operators: - catalog: registry.redhat.io/redhat/redhat-operator-index:v4.13 helm: repositories: - name: redhat-helm-charts url: https://raw.githubusercontent.com/redhat-developer/redhat-helm-charts/master charts: - name: ibm-mongodb-enterprise-helm version: 0.2.0 additionalImages: - name: registry.redhat.io/ubi9/ubi:latest
使用例: EUS リリースのアップグレードパスを含める
次の ImageSetConfiguration
ファイルには eus-<version>
チャネルが含まれており、maxVersion
の値は minVersion
の値より 2 マイナーバージョン以上大きい値になっています。
たとえばこの ImageSetConfiguration
ファイルでは、minVersion
が 4.12.28
に設定されており、eus-4.14
チャネルの maxVersion
は 4.14.16
です。
ImageSetConfiguration
ファイルの例
kind: ImageSetConfiguration apiVersion: mirror.openshift.io/v2alpha1 mirror: platform: graph: true # Required for the OSUS Operator architectures: - amd64 channels: - name: stable-4.12 minVersion: '4.12.28' maxVersion: '4.12.28' shortestPath: true type: ocp - name: eus-4.14 minVersion: '4.12.28' maxVersion: '4.14.16' shortestPath: true type: ocp