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

ROKS (RHEL workerノード) 環境での IBM Software Hub のグローバル・イメージ・プル・シークレットの更新

Last updated at Posted at 2025-08-25

IBM Software Hub のインストールの際、全workerノードのグローバル・イメージ・プル・シークレットを更新する必要があります。

2025年8月現在、ROKS (Red Hat OpenShift on IBM Cloud) 環境 (RHEL workerノード) の場合には、グローバル・イメージ・プル・シークレットの変更を反映させるために、すべてのworkerノードを手動でReplaceする必要があります。Software Hub のドキュメント(IBM Software Hub のグローバル・イメージ・プル・シークレットの更新)にその旨記載されています。

3.Red Hat OpenShift on IBM Cloudに IBM Software Hub をインストールする場合は、変更を有効にするために、クラスター内のワーカー・ノードを手動で再ロードする必要があります。 詳しくは、 Red Hat OpenShift on IBM Cloud 資料の「 グローバル・プル・シークレットへのプライベート・レジストリーの追加 」を参照してください。

ROKSでIBM Entitled Registryからイメージをプルする場合の手順を、確認の手順も含めてご紹介します。
注)当記事の画面イメージは2025年8月時点のものであり、今後変更される場合があります。

  1. cpd-cli を Red Hat OpenShift Container Platformクラスターにログインさせます。

    ${CPDM_OC_LOGIN}
    
  2. 以下の該当するコマンドを実行して、グローバル・イメージ・プル・シークレットを更新します。
    a) 後で参照できるように、更新前のグローバル・イメージ・プル・シークレットのシークレット値を保存しておきます。

    oc get secret pull-secret -n openshift-config --output="jsonpath={.data.\.dockerconfigjson}" | base64 --decode > dockerconfigjson.original
    

    b) IBM Entitled Registryを使用する場合は次のコマンドを実行してグローバル・イメージ・プル・シークレットを更新します。

    cpd-cli manage add-icr-cred-to-global-pull-secret \
    --entitled_registry_key=${IBM_ENTITLEMENT_KEY}
    

    c) 更新後のグローバル・イメージ・プル・シークレットのシークレット値を保存します。

    oc get secret pull-secret -n openshift-config --output="jsonpath={.data.\.dockerconfigjson}" | base64 --decode > dockerconfigjson.updated
    

    確認)更新前と更新後の比較: 更新後には cp.icr.io のレジストリー資格情報が追加されています。

    更新前 dockerconfigjson.original
    {
      "auths": {
        "quay.io": {
          "auth": "<encoded_string>",
          "email": "email@example.com"
        },
        "registry.connect.redhat.com": {
          "auth": "<encoded_string>",
          "email": "email@example.com"
        },
        "registry.redhat.io": {
          "auth": "<encoded_string>",
          "email": "email@example.com"
        }
      }
    } 
    
    更新後 dockerconfigjson.updated
    {
      "auths": {
        "cp.icr.io": {
          "auth": "<encoded_string>"
        },
        "quay.io": {
          "auth": "<encoded_string>"
        },
        "registry.connect.redhat.com": {
          "auth": "<encoded_string>"
        },
        "registry.redhat.io": {
          "auth": "<encoded_string>"
        }
      }
    }
    
  3. [このステップがROKS固有です] 変更を反映するため、クラスター内のすべてのworkerノードをReplaceします。
    注)始める前に、ご使用のクラスターにその他のworkerノードが十分にあることを確認して、ポッドのスケジュールを変更し、ポッドの実行を続行できるようにしてください。
    a) デバッグ・ポッドを開始して workerノードにログインし、Replace前のDocker 構成ファイルを確認します。cp.icr.io のレジストリー資格情報が存在しません。

    oc debug node/<node_name>
    sh-5.1# chroot /host
    sh-5.1# cat /.docker/config.json
    {
        "auths": {
                            "quay.io": {
               "auth": "<encoded_string>"
            },
                    "registry.connect.redhat.com": {
               "auth": "<encoded_string>"
            },
                    "registry.redhat.io": {
               "auth": "<encoded_string>"
            },
          :        
        (省略 26個のレジストリー資格情報)
          :
                    }
                                            }
    }sh-5.1# 
    

    b) IBM CloudコンソールのROKS Worker nodes画面にて、ノードを選択し Replace をクリックします。すべてのノードについて順に行う必要があります。ibmcloudコマンドでも実行できます。
    image.png

    c)デバッグ・ポッドを開始して workerノードにログインし、Docker 構成ファイルに cp.icr.io のレジストリー資格情報が追加されていることを確認します。

    oc debug node/<node_name>
    sh-5.1# chroot /host
    sh-5.1# cat /.docker/config.json
    {
        "auths": {
                            "cp.icr.io": {
               "auth": "<encoded_string>"
            },
                            "quay.io": {
               "auth": "<encoded_string>"
            },
                    "registry.connect.redhat.com": {
               "auth": "<encoded_string>"
            },
                    "registry.redhat.io": {
               "auth": "<encoded_string>"
            },
          :        
        (省略 26個のレジストリー資格情報)
          :
                    }
                                            }
    }sh-5.1# 
    

検証環境

  • ROKS VPC 4.16
    • workerノードOS: RHEL 9
  • IBM Software Hub 5.2.0

参考情報

グローバル・イメージ・プル・シークレットの更新のためにworkerノードのReplaceが必要なのは、ROKSでRHEL workerノードを使用している場合です。

2025年5月のIBM Cloudのリリース情報によると、ROKS 4.18ではworkerノードのオペレーティング・システムはRHCOSがデフォルトとなっています。

RHCOSは、VPC上の Red Hat OpenShift on IBM Cloud クラスタ・バージョン 4.18 のデフォルト・オペレーティング・システムです。 詳しくは、 4.18 の変更履歴を ご覧ください。

4
0
2

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