You are viewing documentation for a release that is no longer maintained. To view the documentation for the most recent version, see the latest RHACS docs.
5.3. Central のインストール
Red Hat Advanced Cluster Security for Kubernetes の主要コンポーネントは Central と呼ばれます。対話型インストーラーを使用して、OpenShift Container Platform に Central をインストールできます。Central は 1 回だけデプロイし、同じインストールを使用して複数の個別のクラスターをモニターできます。
5.3.1. 対話型インストーラーの使用
対話型インストーラーを使用して、お使いの環境に必要なシークレット、デプロイメント設定、およびデプロイメントスクリプトを生成します。
手順
対話型インストールコマンドを実行します。
$ roxctl central generate interactive
Enter を押してプロンプトのデフォルト値を受け入れるか、必要に応じてカスタム値を入力します。
Enter path to the backup bundle from which to restore keys and certificates (optional): Enter PEM cert bundle file (optional): 1 Enter administrator password (default: autogenerated): Enter orchestrator (k8s, openshift): openshift Enter the directory to output the deployment bundle to (default: "central-bundle"): Enter the OpenShift major version (3 or 4) to deploy on (default: "0"): 4 Enter Istio version when deploying into an Istio-enabled cluster (leave empty when not running Istio) (optional): Enter the method of exposing Central (route, lb, np, none) (default: "none"): route 2 Enter main image to use (default: "stackrox.io/main:3.0.61.1"): Enter whether to run StackRox in offline mode, which avoids reaching out to the Internet (default: "false"): Enter whether to enable telemetry (default: "true"): Enter the deployment tool to use (kubectl, helm, helm-values) (default: "kubectl"): Enter Scanner DB image to use (default: "stackrox.io/scanner-db:2.15.2"): Enter Scanner image to use (default: "stackrox.io/scanner:2.15.2"): Enter Central volume type (hostpath, pvc): pvc 3 Enter external volume name (default: "stackrox-db"): Enter external volume size in Gi (default: "100"): Enter storage class name (optional if you have a default StorageClass configured):
- 1
- カスタム TLS 証明書を追加する場合は、PEM でエンコードされた証明書のファイルパスを指定します。カスタム証明書を指定すると、対話型インストーラーは、使用しているカスタム証明書の PEM 秘密鍵を提供するように要求します。
- 2
- RHACS ポータルを使用するには、ルート、ロードバランサー、またはノードポートを使用して Central を公開する必要があります。
- 3
- hostPath ボリュームを使用して OpenShift Container Platform に Red Hat Cluster Security for Kubernetes をインストールする場合は、SELinux ポリシーを変更する必要があります。
警告OpenShift Container Platform で、hostPath ボリュームを使用するには、SELinux ポリシーを変更して、ホストとコンテナーが共有するディレクトリーへのアクセスを許可する必要があります。これは、SELinux がデフォルトでディレクトリー共有をブロックしているためです。SELinux ポリシーを変更するには、次のコマンドを実行します。
$ sudo chcon -Rt svirt_sandbox_file_t <full_volume_path>
ただし、Red Hat は SELinux ポリシーの変更を推奨していません。代わりに、OpenShift Container Platform にインストールするときに PVC を使用してください。
完了すると、インストーラーは central-bundle という名前のフォルダーを作成します。このフォルダーには、Central をデプロイするために必要な YAML マニフェストとスクリプトが含まれています。さらに、信頼できる認証局である Central と Scanner をデプロイするために実行する必要があるスクリプトの画面上の説明と、RHACS ポータルにログインするための認証手順、プロンプトに答える際にパスワードを入力しなかった場合は自動生成されたパスワードも表示されます。
5.3.2. Central インストールスクリプトの実行
対話型インストーラーを実行した後、setup.sh
スクリプトを実行して Central をインストールできます。
手順
setup.sh
スクリプトを実行して、イメージレジストリーアクセスを設定します。$ ./central-bundle/central/scripts/setup.sh
必要なリソースを作成します。
$ oc create -R -f central-bundle/central
デプロイメントの進行状況を確認します。
$ oc get pod -n stackrox -w
Central の実行後、RHACS ポータルの IP アドレスを見つけて、ブラウザーで開きます。プロンプトに応答するときに選択した公開方法に応じて、次のいずれかの方法を使用して IP アドレスを取得します。
公開方法 コマンド アドレス 例 ルート
oc -n stackrox get route central
出力の
HOST/PORT
列の下のアドレスhttps://central-stackrox.example.route
ノードポート
oc get node -owide && oc -n stackrox get svc central-loadbalancer
サービス用に表示されたポート上の任意のノードの IP またはホスト名
https://198.51.100.0:31489
ロードバランサー
oc -n stackrox get svc central-loadbalancer
EXTERNAL-IP または、ポート 443 でサービスに表示されるホスト名
https://192.0.2.0
なし
central-bundle/central/scripts/port-forward.sh 8443
https://localhost:8443
https://localhost:8443
対話型インストール中に自動生成されたパスワードを選択した場合は、次のコマンドを実行して、Central にログインするためのパスワードを確認できます。
$ cat central-bundle/password