6.3. 管理 Service Registry 环境变量


Service Registry Operator 管理最常见的 Service Registry 配置,但有一些选项还不支持它。如果 ApicurioRegistry CR 中没有高级别配置选项,您可以使用环境变量来调整它。您可以通过在 spec.configuration.env 字段中直接设置 ApicurioRegistry CR 中的环境变量来更新它们。然后,它们转发到 Service Registry 的 Deployment 资源。

流程

您可以使用 OpenShift Web 控制台或 CLI 管理 Service Registry 环境变量。

OpenShift web 控制台
  1. 选择 Installed Operators 选项卡,然后选择 Red Hat Integration - Service Registry Operator
  2. Apicurio Registry 标签页中,为您的 Service Registry 部署选择 ApicurioRegistry CR。
  3. YAML 选项卡,然后根据需要编辑 spec.configuration.env 部分。以下示例演示了如何设置默认全局内容规则:

    apiVersion: registry.apicur.io/v1
    kind: ApicurioRegistry
    metadata:
      name: example-apicurioregistry
    spec:
      configuration:
        # ...
        env:
          - name: REGISTRY_RULES_GLOBAL_VALIDITY
            value: FULL # One of: NONE, SYNTAX_ONLY, FULL
          - name: REGISTRY_RULES_GLOBAL_COMPATIBILITY
            value: FULL # One of: NONE, BACKWARD, BACKWARD_TRANSITIVE, FORWARD, FORWARD_TRANSITIVE, FULL, FULL_TRANSITIVE
OpenShift CLI
  1. 选择安装 Service Registry 的项目。
  2. 运行 oc get apicurioregistry 以获取 ApicurioRegistry CR 列表
  3. 在代表您要配置的 Service Registry 实例的 CR 上运行 oc edit apicurioregistry
  4. spec.configuration.env 部分添加或修改环境变量。

    Service Registry Operator 可能会尝试设置已在 spec.configuration.env 字段中明确指定的环境变量。如果环境变量配置具有冲突的值,则 Service Registry Operator 设置的值具有优先权。

    您可以通过对该功能使用高级别配置或仅使用明确指定的环境变量来避免这种冲突。以下是冲突配置示例:

    apiVersion: registry.apicur.io/v1
    kind: ApicurioRegistry
    metadata:
      name: example-apicurioregistry
    spec:
      configuration:
        # ...
        ui:
          readOnly: true
        env:
          - name: REGISTRY_UI_FEATURES_READONLY
            value: false

    此配置会导致 Service Registry web 控制台处于只读模式。

Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

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

让开源更具包容性

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

關於紅帽

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

© 2024 Red Hat, Inc.