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 章 启用离线模式
您可以通过启用离线模式,将 Red Hat Advanced Cluster Security for Kubernetes 用于没有连接到互联网的集群。在离线模式下,Red Hat Advanced Cluster Security for Kubernetes 组件无法连接到互联网上的地址或主机。
Red Hat Advanced Cluster Security for Kubernetes 不会确定用户提供的主机名、IP 地址或其他资源是否在互联网上。例如,如果您尝试与互联网上托管的 Docker registry 集成,Red Hat Advanced Cluster Security for Kubernetes 不会阻断这个请求。
以离线模式部署和操作 Red Hat Advanced Cluster Security for Kubernetes:
- 下载 RHACS 镜像并在您的集群中安装它们。如果使用 OpenShift Container Platform,您可以使用 Operator Lifecycle Manager(OLM) 和 OperatorHub 将镜像下载到连接到互联网的工作站。然后,工作站会将镜像推送到已连接的安全集群的镜像 registry 中。对于其他平台,您可以使用 Skopeo 或 Docker 等程序从远程 registry 中拉取镜像并将其推送到您自己的私有注册表,如 直接下载镜像 中所述。
- 在安装过程中启用离线模式。
- (可选)通过上传新的定义文件,Routinely 更新 Scanner 的漏洞列表。
- (可选)当需要时,通过上传新的内核支持软件包在更多内核版本中添加对运行时集合的支持。
您只能在安装过程中启用离线模式,而不在升级过程中启用。
5.1. 下载镜像以供离线使用 复制链接链接已复制到粘贴板!
5.1.1. 直接下载镜像 复制链接链接已复制到粘贴板!
您可以手动拉取、重新标记并将 Red Hat Advanced Cluster Security for Kubernetes 镜像推送到 registry。镜像捆绑包当前版本的镜像有:
-
registry.redhat.io/advanced-cluster-security/rhacs-main-rhel8:3.69.2
-
registry.redhat.io/advanced-cluster-security/rhacs-scanner-rhel8:3.69.2
-
registry.redhat.io/advanced-cluster-security/rhacs-scanner-db-rhel8:3.69.2
-
registry.redhat.io/advanced-cluster-security/rhacs-collector-rhel8:3.69.2
-
registry.redhat.io/advanced-cluster-security/rhacs-collector-slim-rhel8:3.69.2
5.1.1.1. 重新标记镜像 复制链接链接已复制到粘贴板!
您可以使用 Docker 命令行界面下载和重新标记镜像。
在重新标记镜像时,您必须维护镜像的名称和标签。例如,使用:
docker tag registry.redhat.io/advanced-cluster-security/rhacs-main-rhel8:3.69.2 <your_registry>/rhacs-main-rhel8:3.69.2
$ docker tag registry.redhat.io/advanced-cluster-security/rhacs-main-rhel8:3.69.2 <your_registry>/rhacs-main-rhel8:3.69.2
和不要像以下示例一样重新标记:
docker tag registry.redhat.io/advanced-cluster-security/rhacs-main-rhel8:3.69.2 <your_registry>/other-name:latest
$ docker tag registry.redhat.io/advanced-cluster-security/rhacs-main-rhel8:3.69.2 <your_registry>/other-name:latest
流程
登录到 registry:
docker login registry.redhat.io
$ docker login registry.redhat.io
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 拉取镜像:
docker pull <image>
$ docker pull <image>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 重新标记镜像:
docker tag <image> <new_image>
$ docker tag <image> <new_image>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 将更新的镜像推送到 registry:
docker push <new_image>
$ docker push <new_image>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow