This documentation is for a release that is no longer maintained.
You can select a different version or view all RHACS documentation.第 10 章 为外部网络访问配置代理
如果您的网络配置通过代理限制出站流量,您可以在 Red Hat Advanced Cluster Security for Kubernetes 中配置代理设置,以通过代理路由流量。
当您在 Red Hat Advanced Cluster Security for Kubernetes 中使用代理时:
- 来自 Central 和 Scanner 的所有传出 HTTP、HTTPS 和其他 TCP 流量都经过代理。
- Central 和 Scanner 之间的流量不会经过代理。
- 代理配置不会影响其他 Red Hat Advanced Cluster Security for Kubernetes 组件。
当您没有使用离线模式时,且在安全集群中运行的 Collector 需要在运行时下载额外的 eBPF 探测或内核模块:
- 收集器尝试通过联系 Sensor 来下载它们。
- 然后,Sensor 将此请求转发到 Central。
-
中央使用代理查找模块或探测地址为
https://collector-modules.stackrox.io。
10.1. 在现有部署上配置代理 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
要在现有部署中配置代理,您必须将 proxy-config secret 导出为 YAML 文件,更新该文件中的代理配置,并将它上传为 secret。
流程
将现有 secret 保存为 YAML 文件:
oc -n stackrox get secret proxy-config \ -o go-template='{{index .data "config.yaml" | \ base64decode}}{{"\n"}}' > /tmp/proxy-config.yaml$ oc -n stackrox get secret proxy-config \ -o go-template='{{index .data "config.yaml" | \ base64decode}}{{"\n"}}' > /tmp/proxy-config.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow - 编辑 YAML 配置文件中您要修改的字段,如 Configure proxy 在安装过程中指定。
保存更改后,运行以下命令来替换 secret:
oc -n stackrox create secret generic proxy-config \ --from-file=config.yaml=/tmp/proxy-config.yaml -o yaml --dry-run | \ oc label -f - --local -o yaml app.kubernetes.io/name=stackrox | \ oc apply -f -
$ oc -n stackrox create secret generic proxy-config \ --from-file=config.yaml=/tmp/proxy-config.yaml -o yaml --dry-run | \ oc label -f - --local -o yaml app.kubernetes.io/name=stackrox | \ oc apply -f -Copy to Clipboard Copied! Toggle word wrap Toggle overflow 重要- 您必须至少等待 1 分钟,直到 OpenShift Container Platform 将您的更改传播到 Central 和 Scanner。
- 如果您在更改代理配置后看到与传出连接相关的问题,您必须重启 Central 和 Scanner pod。