9.2. 在安装过程中配置代理


当您使用 roxctl 命令行界面(CLI)或 Helm 安装 Red Hat Advanced Cluster Security for Kubernetes 时,您可以在安装过程中指定代理配置。

当您使用 roxctl central generate 命令运行安装程序时,安装程序会为您的环境生成 secret 和部署配置文件。您可以通过编辑生成的配置 secret(YAML)文件来配置代理。目前,您无法使用 roxctl CLI 配置代理。配置存储在 Kubernetes secret 中,它由 Central 和 Scanner 共享。

流程

  1. 从部署捆绑包目录打开配置文件 central/proxy-config-secret.yaml

    注意

    如果使用 Helm,则配置文件位于 central/templates/proxy-config-secret.yaml 中。

  2. 在配置文件中编辑您要修改的字段:

    apiVersion: v1
    kind: Secret
    metadata:
      namespace: stackrox
      name: proxy-config
    type: Opaque
    stringData:
      config.yaml: |- 
    1
    
        # # 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 
    2
    
        # username: username 
    3
    
        # password: password 
    4
    
        # # 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 
    5
    
        # # 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 
    6
    
        #   username: username 
    7
    
        #   password: password 
    8
    
        # https:
        #   url: http://https-proxy.name:port 
    9
    
        #   username: username 
    10
    
        #   password: password 
    11
    Copy to Clipboard Toggle word wrap
    3 4 7 8 10 11
    添加 用户名和密码 是可选的,在 http 和 https 部分的开头和 https 部分。
    2 6 9
    url 选项支持以下 URL 方案:
    • HTTP:// 用于 HTTP 代理。
    • HTTPS:// 用于启用了 TLS 的 HTTP 代理。
    • socks5:// for a SOCKS5 代理。
    5
    excludes 列表可以包含 DNS 名称(带有或没有 * 通配符)、IP 地址或 CIDR 表示法中的 IP 块(例如 10.0.0.0/8)。无论协议是什么,此列表中的值将应用于所有传出连接。
    1
    stringData 部分中的 |- 行表示配置数据的开头。
    注意
    • 第一次打开文件时,所有值都会被注释掉(使用位于行开头的 # 号)。以双 hash 符号开头的行 # # 包含配置键的解释。
    • 确保在编辑字段时,维护与 config.yaml 相关的两个空格的缩进级别:|- 行。
  3. 编辑配置文件后,您可以正常进行安装。更新的配置指示 Red Hat Advanced Cluster Security for Kubernetes 使用在提供的地址和端口号上运行的代理。
返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2025 Red Hat