10.2. 在安装过程中配置代理
当使用 roxctl 命令行界面(CLI)或 Helm 安装 Red Hat Advanced Cluster Security for Kubernetes 时,您可以在安装过程中指定代理配置。
当使用 roxctl central generate 命令运行安装程序时,安装程序会为您的环境生成 secret 和部署配置文件。您可以通过编辑生成的配置 secret (YAML)文件来配置代理。目前,您无法使用 roxctl CLI 配置代理。配置存储在 Kubernetes secret 中,它由 Central 和 Scanner 共享。
流程
从部署捆绑包目录中打开配置文件
central/proxy-config-secret.yaml。注意如果您使用 Helm,则配置文件位于
central/templates/proxy-config-secret.yaml中。编辑要在配置文件中修改的字段:
apiVersion: v1 kind: Secret metadata: namespace: stackrox name: proxy-config type: Opaque stringData: config.yaml: |- # # NOTE: Both central and scanner should be restarted if this secret is changed. # # While it is possible that some components will pick up the new proxy configuration # # without a restart, it cannot be guaranteed that this will apply to every possible # # integration etc. # url: http://proxy.name:port # username: username # password: password # # If the following value is set to true, the proxy wil NOT be excluded for the default hosts: # # - *.stackrox, *.stackrox.svc # # - localhost, localhost.localdomain, 127.0.0.0/8, ::1 # # - *.local # omitDefaultExcludes: false # excludes: # hostnames (may include * components) for which you do not # # want to use a proxy, like in-cluster repositories. # - some.domain # # The following configuration sections allow specifying a different proxy to be used for HTTP(S) connections. # # If they are omitted, the above configuration is used for HTTP(S) connections as well as TCP connections. # # If only the `http` section is given, it will be used for HTTPS connections as well. # # Note: in most cases, a single, global proxy configuration is sufficient. # http: # url: http://http-proxy.name:port # username: username # password: password # https: # url: http://https-proxy.name:port # username: username # password: password其中:
用户名和密码-
(可选)指定用户名和密码。这些字段在开始和
http和https部分中是可选的。 url指定代理的 URL。支持以下 URL 方案:
-
HTTP 代理的
http:// -
https://用于支持 TLS 的 HTTP 代理 -
SOCKS5 代理的
socks5://
-
HTTP 代理的
excludes-
以 CIDR 表示法指定 DNS 名称列表,带有或不使用
*通配符、IP 地址或 IP 块,如10.0.0.0/8。此列表中的值适用于所有传出连接,无论协议是什么。 |-指定插入到
stringData部分时配置数据的开始。注意-
首次打开文件时,所有值都会被注释掉(在每行的开头使用
#符号)。以双 hash 符号(# #)开头的行包含配置键的说明。 -
确保在编辑字段时,您需要维护一个相对于
config.yaml: |-line 的缩进级别两个空格。
-
首次打开文件时,所有值都会被注释掉(在每行的开头使用
- 编辑配置文件后,您可以继续正常安装。更新的配置指示 Red Hat Advanced Cluster Security for Kubernetes 使用在提供的地址和端口号上运行的代理。