第3章 使ってみる

3.1. Red Hat Single Sign-On for OpenShift Image Streams およびアプリケーションテンプレートの使用

重要

Red Hat JBoss Middleware for OpenShift イメージは、認証を必要とするセキュリティー保護された Red Hat Registry registry.redhat.io からオンデマンドで取得されます。コンテンツを取得するには、Red Hat アカウントを使用してレジストリーにログインする必要があります。

registry.redhat.io からのコンテナーイメージを共有環境 (OpenShift など) で使用するには、管理者が個人の Red Hat カスタマーポータルの認証情報の代わりに Registry Service Account (認証トークンとも呼ばれる) を使用することを推奨します。

レジストリーサービスアカウントを作成するには、Registry Service Account Management Application に移動して、必要に応じてログインします。

  1. Registry Service Accounts ページから、Create Service Account をクリックします。
  2. サービスアカウントの名前 (registry.redhat.io-sa) を指定します。これには、固定されたランダムな文字列が追加されます。

    1. サービスアカウントの説明を入力します (例: Service account to consume container images from registry.redhat.io.)。
    2. Create をクリックします。
  3. サービスアカウントの作成後に、Registry Service Accounts ページに表示される表の Account name 列の registry.redhat.io-sa をクリックします。
  4. 最後に、OpenShift Secret タブをクリックし、そのページに一覧表示されているすべての手順を実行します。

詳細は、「Red Hat コンテナーレジストリーの認証」を参照してください。

  1. クラスター管理者またはグローバル openshift プロジェクトへのプロジェクト管理者アクセスを持つユーザーとしてログインしていることを確認します。
  2. OpenShift Container Platform のバージョンに基づいてコマンドを選択します。

    1. マスターホストの(一部)で OpenShift Container Platform v3 ベースのクラスターインスタンスを実行している場合、以下を実行します。

      $ oc login -u system:admin
    2. OpenShift Container Platform v4 ベースのクラスターインスタンスを実行している場合は、CLIkubeadmin ユーザーとしてログインします。

      $ oc login -u kubeadmin -p password https://openshift.example.com:6443
  3. 以下のコマンドを実行して、openshift プロジェクトで Red Hat Single Sign-On 7.4.10.GA リソースのコアセットを更新します。

    $ for resource in sso74-image-stream.json \
      sso74-https.json \
      sso74-postgresql.json \
      sso74-postgresql-persistent.json \
      sso74-x509-https.json \
      sso74-x509-postgresql-persistent.json
    do
      oc replace -n openshift --force -f \
      https://raw.githubusercontent.com/jboss-container-images/redhat-sso-7-openshift-image/sso74-dev/templates/${resource}
    done
  4. 以下のコマンドを実行して、Red Hat Single Sign-On 7.4.10.GA OpenShift イメージストリームを openshift プロジェクトにインストールします。

    $ oc -n openshift import-image rh-sso-7/sso74-openshift-rhel8:7.4 --from=registry.redhat.io/rh-sso-7/sso74-openshift-rhel8:7.4 --confirm