0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

OpenShift - oc-mirror - list releases

Last updated at Posted at 2024-08-01

oc-mirror

OpenShift をインターネット非接続環境に導入 (disconnected installation) する際に、oc-mirror plugin が利用できます。

oc-mirror OpenShift CLI(oc) プラグインを使用すると、単一のツールを使用して、必要なすべての OpenShift Container Platform コンテンツおよびその他のイメージをミラーレジストリーにミラーリングできます。次の機能を提供します。

  • OpenShift Container Platform のリリース、Operator、ヘルムチャート、およびその他のイメージをミラーリングするための一元化された方法を提供します。
  • OpenShift Container Platform および Operator の更新パスを維持します。
  • 宣言型イメージセット設定ファイルを使用して、クラスターに必要な OpenShift Container Platform リリース、Operator、およびイメージのみを含めます。
  • 将来のイメージセットのサイズを縮小するインクリメンタルミラーリングを実行します。
  • 前回の実行以降にイメージセット設定から除外されたターゲットミラーレジストリーからのイメージをプルーニングします。
  • オプションで、OpenShift Update Service (OSUS) を使用する際のサポートアーティファクトを生成します。

ここでは、oc-mirror の機能の1つである、list releases(OpenShift のリリース情報の取得)をご紹介します。

Setup

OpenShift Cluster Manager の下記ページから OpenShift Client (oc) mirror plugin (oc-mirror) をダウンロードします。

ダウンロードしたファイルを、以下の要領で配置します。

$ tar xvzf oc-mirror.tar.gz
$ chmod +x oc-mirror
$ mv oc-mirror /usr/local/bin/.
$ which oc-mirror
/usr/local/bin/oc-mirror

以下のように実行できれば、使用可能です。

$ oc-mirror version --output json
{
  "clientVersion": {
    "major": "",
    "minor": "",
    "gitVersion": "4.16.0-202407100906.p0.g75da281.assembly.stream.el9-75da281",
    "gitCommit": "75da281989a147ead237e738507bbd8cec3175e5",
    "gitTreeState": "clean",
    "buildDate": "2024-07-10T09:46:55Z",
    "goVersion": "go1.21.11 (Red Hat 1.21.11-1.module+el8.10.0+21986+2112108a) X:strictfipsruntime",
    "compiler": "gc",
    "platform": "linux/amd64"
  }
}

oc mirror (oc の mirror サブコマンド)でも実行可能で、公式マニュアルではこちらを使用しています。

oc mirror version --output json
{
  "clientVersion": {
    "major": "",
    "minor": "",
    "gitVersion": "4.16.0-202407100906.p0.g75da281.assembly.stream.el9-75da281",
    "gitCommit": "75da281989a147ead237e738507bbd8cec3175e5",
    "gitTreeState": "clean",
    "buildDate": "2024-07-10T09:46:55Z",
    "goVersion": "go1.21.11 (Red Hat 1.21.11-1.module+el8.10.0+21986+2112108a) X:strictfipsruntime",
    "compiler": "gc",
    "platform": "linux/amd64"
  }
}

list releases

list releases を使用してみます。

$ oc mirror list --help
List available platform and operator content and their versions.

Usage:
  oc-mirror list [flags]
  oc-mirror list [command]

Available Commands:
  operators   List available operator catalog content and versions
  releases    List available platform content and versions
  updates     List available updates in upgrade graph from upstream sources.

Flags:
  -h, --help   help for list

Global Flags:
  -v, --verbose int   Number for the log level verbosity (valid 1-9, default is 0)

Use "oc-mirror list [command] --help" for more information about a command.
$ oc mirror list releases --help
List available platform content and versions

Usage:
  oc-mirror list releases [flags]

Examples:
  # Output OpenShift release versions
  oc-mirror list releases

  # Output all OpenShift release channels list for a release
  oc-mirror list releases --version=4.8

  # List all OpenShift versions in a specified channel
  oc-mirror list releases --channel=stable-4.8

  # List all OpenShift channels for a specific version
  oc-mirror list releases --channels --version=4.8

  # List OpenShift channels for a specific version and one or more release architecture. Valid architectures: amd64 (default), arm64, ppc64le, s390x, multi.
  oc-mirror list releases --channels --version=4.13 --filter-by-archs amd64,arm64,ppc64le,s390x,multi

Flags:
      --channel string            List information for a specified channel
      --channels                  List all channel information
      --filter-by-archs strings   An architecture list to control the release image picked when multiple variants are available
  -h, --help                      help for releases
  -v, --verbose int               Number for the log level verbosity (valid 1-9, default is 0)
      --version string            Specify an OpenShift release version

OpenShift Container Platform (OCP) の release 一覧を取得します。

$ oc mirror list releases
Available OpenShift Container Platform release versions:
  4.0
  4.1
  4.2
  4.3
  4.4
  4.5
  4.6
  4.7
  4.8
  4.9
  4.10
  4.11
  4.12
  4.13
  4.14
  4.15
  4.16
  4.17

4.16 を指定して、4.16 内の release 一覧を取得してみます。Default では、channelstable が、architectureamd64 が設定されます。

$ oc mirror list releases --version=4.16
Listing stable channels. Use --channel=<channel-name> to filter.
Use oc-mirror list release --channels to discover other channels.

Channel: stable-4.16
Architecture: amd64
4.15.0
4.15.2
4.15.3
4.15.5
4.15.6
4.15.8
4.15.9
4.15.10
4.15.11
4.15.12
4.15.13
4.15.14
4.15.15
4.15.16
4.15.17
4.15.18
4.15.19
4.15.20
4.15.21
4.15.22
4.16.0
4.16.1
4.16.2
4.16.3
4.16.4

channel 一覧を取得します。

$ oc mirror list releases --channels --version=4.16
Listing channels for version 4.16.

candidate-4.15
fast-4.15
stable-4.15
candidate-4.16
eus-4.16
fast-4.16
stable-4.16
candidate-4.17

candidate-4.16 の release 一覧を取得してみます。

$ oc mirror list releases --version=4.16 --channel=candidate-4.16
Channel: candidate-4.16
Architecture: amd64
4.15.0-ec.0
4.15.0-ec.1
4.15.0-ec.2
4.15.0-ec.3
4.15.0-rc.0
4.15.0-rc.1
4.15.0-rc.2
4.15.0-rc.3
4.15.0-rc.4
4.15.0-rc.5
4.15.0-rc.7
4.15.0-rc.8
4.15.0
4.15.2
4.15.3
4.15.5
4.15.6
4.15.7
4.15.8
4.15.9
4.15.10
4.15.11
4.15.12
4.15.13
4.15.14
4.15.15
4.15.16
4.15.17
4.15.18
4.15.19
4.15.20
4.15.21
4.15.22
4.15.23
4.15.24
4.16.0-ec.0
4.16.0-ec.1
4.16.0-ec.2
4.16.0-ec.3
4.16.0-ec.4
4.16.0-ec.5
4.16.0-ec.6
4.16.0-rc.0
4.16.0-rc.1
4.16.0-rc.2
4.16.0-rc.3
4.16.0-rc.4
4.16.0-rc.5
4.16.0-rc.6
4.16.0-rc.9
4.16.0
4.16.1
4.16.2
4.16.3
4.16.4
4.16.5

--filter-by-archsppc64le,s390x を指定してみます。

$ oc mirror list releases --version=4.16 --channel=candidate-4.16 --filter-by-archs ppc64le,s390x
Channel: candidate-4.16
Architecture: ppc64le
4.15.0-ec.0
4.15.0-ec.1
4.15.0-ec.2
4.15.0-ec.3
4.15.0-rc.0
4.15.0-rc.1
4.15.0-rc.2
4.15.0-rc.3
4.15.0-rc.4
4.15.0-rc.5
4.15.0-rc.7
4.15.0-rc.8
4.15.0
4.15.2
4.15.3
4.15.5
4.15.6
4.15.7
4.15.8
4.15.9
4.15.10
4.15.11
4.15.12
4.15.13
4.15.14
4.15.15
4.15.16
4.15.17
4.15.18
4.15.19
4.15.20
4.15.21
4.15.22
4.15.23
4.15.24
4.16.0-ec.0
4.16.0-ec.1
4.16.0-ec.2
4.16.0-ec.3
4.16.0-ec.4
4.16.0-ec.5
4.16.0-ec.6
4.16.0-rc.0
4.16.0-rc.1
4.16.0-rc.2
4.16.0-rc.3
4.16.0-rc.4
4.16.0-rc.5
4.16.0-rc.6
4.16.0-rc.9
4.16.0
4.16.1
4.16.2
4.16.3
4.16.4
4.16.5
Channel: candidate-4.16
Architecture: s390x
4.15.0-ec.0
4.15.0-ec.1
4.15.0-ec.2
4.15.0-ec.3
4.15.0-rc.0
4.15.0-rc.1
4.15.0-rc.2
4.15.0-rc.3
4.15.0-rc.4
4.15.0-rc.5
4.15.0-rc.7
4.15.0-rc.8
4.15.0
4.15.2
4.15.3
4.15.5
4.15.6
4.15.7
4.15.8
4.15.9
4.15.10
4.15.11
4.15.12
4.15.13
4.15.14
4.15.15
4.15.16
4.15.17
4.15.18
4.15.19
4.15.20
4.15.21
4.15.22
4.15.23
4.15.24
4.16.0-ec.0
4.16.0-ec.1
4.16.0-ec.2
4.16.0-ec.3
4.16.0-ec.4
4.16.0-ec.5
4.16.0-ec.6
4.16.0-rc.0
4.16.0-rc.1
4.16.0-rc.2
4.16.0-rc.3
4.16.0-rc.4
4.16.0-rc.5
4.16.0-rc.6
4.16.0-rc.9
4.16.0
4.16.1
4.16.2
4.16.3
4.16.4
4.16.5

このように、非常に簡単に OCP release の各種情報を取得することが出来ます。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?