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.
第 9 章 为外部网络访问配置代理
如果您的网络配置通过代理限制出站流量,您可以在 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
。
9.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.yaml
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 编辑 YAML 配置文件中要修改的字段,如在安装过程中配置代理中指定的字段。
保存更改后,运行以下命令替换 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 pod。