5.3. 安装 Central
Red Hat Advanced Cluster Security for Kubernetes 的主要组件名为 Central。您可以使用交互式安装程序在 OpenShift Container Platform 上安装 Central。您只需要部署 Central 一次,并使用同一安装监控多个独立集群。
5.3.1. 使用交互式安装程序 复制链接链接已复制到粘贴板!
使用交互式安装程序为您的环境生成所需的 secret、部署配置和部署脚本。
流程
运行交互式 install 命令:
$ 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"): route2 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): pvc3 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):警告在 OpenShift Container Platform 中,对于 hostPath 卷,您必须修改 SELinux 策略以允许访问主机和容器共享的目录。这是因为 SELinux 默认阻止目录共享。要修改 SELinux 策略,请运行以下命令:
$ sudo chcon -Rt svirt_sandbox_file_t <full_volume_path>但是,红帽不推荐修改 SELinux 策略,在 OpenShift Container Platform 上安装时使用 PVC。
在完成时,安装程序会创建一个名为 central-bundle 的文件夹,其中包含用于部署 Central 所需的 YAML 清单和脚本。另外,它显示了您需要运行的脚本的屏幕说明,以部署其他可信证书颁发机构、中部和扫描器,以及登录 RHACS 门户的身份验证说明(如果您回答提示时未提供密码)。