13.3.2. OpenShift Container Platform OAuth サーバーの追加ルートの作成
Red Hat Advanced Cluster Security for Kubernetes ポータルを使用して OpenShift Container Platform OAuth サーバーを ID プロバイダーとして設定すると、RHACS は OAuth サーバーのルートを 1 つだけ設定します。ただし、Central カスタムリソースで注釈として指定することにより、追加のルートを作成できます。
前提条件
手順
RHACS Operator を使用して RHACS をインストールした場合:
Central カスタムリソースのパッチを含む
CENTRAL_ADDITIONAL_ROUTES環境変数を作成します。$ CENTRAL_ADDITIONAL_ROUTES=' spec: central: exposure: loadBalancer: enabled: false port: 443 nodePort: enabled: false route: enabled: true persistence: persistentVolumeClaim: claimName: stackrox-db customize: annotations: serviceaccounts.openshift.io/oauth-redirecturi.main: sso/providers/openshift/callback1 serviceaccounts.openshift.io/oauth-redirectreference.main: "{\"kind\":\"OAuthRedirectReference\",\"apiVersion\":\"v1\",\"reference\":{\"kind\":\"Route\",\"name\":\"central\"}}"2 serviceaccounts.openshift.io/oauth-redirecturi.second: sso/providers/openshift/callback3 serviceaccounts.openshift.io/oauth-redirectreference.second: "{\"kind\":\"OAuthRedirectReference\",\"apiVersion\":\"v1\",\"reference\":{\"kind\":\"Route\",\"name\":\"second-central\"}}"4 'CENTRAL_ADDITIONAL_ROUTESパッチを Central カスタムリソースに適用します。$ oc patch centrals.platform.stackrox.io \ -n <namespace> \1 <custom-resource> \2 --patch "$CENTRAL_ADDITIONAL_ROUTES" \ --type=merge
または、Helm を使用して RHACS をインストールした場合:
次のアノテーションを
values-public.yamlファイルに追加します。customize: central: annotations: serviceaccounts.openshift.io/oauth-redirecturi.main: sso/providers/openshift/callback1 serviceaccounts.openshift.io/oauth-redirectreference.main: "{\"kind\":\"OAuthRedirectReference\",\"apiVersion\":\"v1\",\"reference\":{\"kind\":\"Route\",\"name\":\"central\"}}"2 serviceaccounts.openshift.io/oauth-redirecturi.second: sso/providers/openshift/callback3 serviceaccounts.openshift.io/oauth-redirectreference.second: "{\"kind\":\"OAuthRedirectReference\",\"apiVersion\":\"v1\",\"reference\":{\"kind\":\"Route\",\"name\":\"second-central\"}}"4 helm upgradeを使用して、Central カスタムリソースにカスタムアノテーションを適用します。$ helm upgrade -n stackrox \ stackrox-central-services rhacs/central-services \ -f <path_to_values_public.yaml>1 - 1
-fオプションを使用して、values-public.yaml設定ファイルのパスを指定します。