10.4. 使服务发现


3scale 可以发现部署或部署到 OpenShift 集群的 API 服务。要达到此目的,请将 OpenShift Service Object YAML 定义配置为包含以下元数据:

    metadata:
      labels:
        discovery.3scale.net: "true"
      annotations:
        discovery.3scale.net/scheme: <http | https>
        discovery.3scale.net/port: '<port number of the service within the cluster>'
        discovery.3scale.net/path: <relative base path of the API backend from the root>
        discovery.3scale.net/description-path: <relative or absolute path to the Open API Specification for the API>
Copy to Clipboard Toggle word wrap

在描述的元数据中,端口和 方案是 强制注解。

另外,只有在 Content-Type 标头是以下值之一时,服务发现才会导入规格:

  • application/swagger+json
  • application/vnd.oai.openapi+json
  • application/json
注意

确保用户或服务帐户(取决于配置的身份验证模式)具有查看命名空间和服务的适当特权。

返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

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

让开源更具包容性

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

關於紅帽

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

Theme

© 2025 Red Hat