10.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
    3 4 7 8 10 11
    在开始以及在 httphttps 部分中,添加 usernamepassword 是可选的。
    2 6 9
    url 选项支持以下 URL 方案:
    • http:// 用于 HTTP 代理。
    • https:// 用于支持 TLS 的 HTTP 代理。
    • SOCKS5 代理的 socks5://
    5
    excludes 列表可以包含 DNS 名称(带有或不带有 * 通配符)、IP 地址或 IP 块(例如:10.0.0.0/8)。此列表中的值适用于所有传出连接,而不考虑协议。
    1
    stringData 部分中的 |- 行表示配置数据的开头。
    注意
    • 首次打开文件时,所有值都会被注释掉(在每行的开头使用 # 符号)。以双 hash 符号(# #)开头的行包含配置键的说明。
    • 确保在编辑字段时,您可以维护相对于 config.yaml: |- 行的两个空格的缩进级别。
  3. 编辑配置文件后,您可以继续正常安装。更新的配置指示 Red Hat Advanced Cluster Security for Kubernetes 使用在提供的地址和端口号上运行的代理。
Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

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

让开源更具包容性

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

關於紅帽

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

© 2024 Red Hat, Inc.