1
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?

More than 1 year has passed since last update.

IBMCloud OpenShift Container Registry保存先ストレージの変更

Last updated at Posted at 2024-04-25

内容サマリ

Red Hat OpenShift on IBM Cloudを購入(オーダ)する時に、コンテナイメージの保存先としてICOSストレージを指定する必要がある。本記事では、コンテナイメージの保存先を変更する必要が発生した場合の変更手順について記載する。

本記事は、OpenShiftのイメージレジストリをデフォルトのUnmanagedモードを前提としています

IBMCloudのドキュメントは下記に記載がある
※本記事作成時点では、保存先の変更方法については記載がない
イメージ・レジストリーのセットアップ

製品オーダ時の下記赤枠の部分が必要になった時の話です。
Pasted_Image_2024_04_24__22_21.png

現在の設定を確認

現在どのバケットが内部レジストリーとして設定されているか確認

OpenShift 上でイメージレジストリーに関する設定を詳細に表示

oc describe configs.imageregistry.operator.openshift.io cluster

このコマンドを実行すると、現在の設定が表示される。ここで、"Storage"セクションに注目して、現在設定されている"s3"ブロックの"bucket"フィールド名を確認します。

Spec:
  Storage:
    Management State:  Unmanaged
    s3:
      Bucket:           icos-test1827130
      Region:           jp-tok-standard
      Region Endpoint:  https://s3.direct.jp-tok.cloud-object-storage.appdomain.cloud

Bucketの部分がICOSのバケット名となっている

設定の編集

次に、設定を編集するために、以下のコマンドを使用して設定ファイルを開き、編集する
テキストエディタが開かれ、設定ファイルを直接編集する

oc edit configs.imageregistry.operator.openshift.io cluster

エディタが開いたら、"storage"セクションを探し、"s3"ブロック内の"bucket"フィールドを見つけ、その値を新しいバケット名に変更する。

storage:
  s3:
    bucket: <new-bucket-name>

編集が完了したら、ファイルを保存してエディタを閉じる。OpenShiftは自動的に変更を検出して設定を更新し、必要な再起動やリソースの再配置を行う。

変更内容の確認

イメージレジストリの設定を詳細に表示する
先ほど設定したbucketが反映されていることを確認する

oc describe configs.imageregistry.operator.openshift.io cluster

システムへの影響について

イメージレジストリの再起動
設定の変更を適用するためにレジストリが再起動されることがあり、イメージのプルやプッシュが一時的に影響を受ける可能性があるので注意

1
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
1
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?