搜索

2.2. 在 OpenShift 上安装 3scale API Management Operator

download PDF
注意

3scale 支持 OpenShift Container Platform(OCP)的最后两个通用版本(GA)。如需更多信息,请参阅 Red Hat 3scale API 管理支持的配置 页面。

本文档演示了如何:

  • 创建一个新项目。
  • 部署红帽 3scale API 管理实例。
  • 通过 Operator Lifecycle Manager(OLM)安装 3scale Operator。
  • 部署 Operator 后,部署自定义资源。

先决条件

  • 使用具有管理员权限的帐户访问受支持的 OpenShift Container Platform 4 集群版本。

警告

在另一个新创建的空项目中部署 3scale 操作器和自定义资源定义(CRD)。如果您将其部署到包含基础架构的现有项目中,则可能会更改或删除现有的元素。

要在 OpenShift 上安装 3scale 操作器,请执行以下部分中所述的步骤:

2.2.1. 创建新的 OpenShift 项目

此流程说明了如何创建名为 3scale-project 的新 OpenShift 项目。将此项目名称替换为您自己的项目名称。

流程

要创建新 OpenShift 项目,请执行以下操作:

  • 使用字母数字字符和短划线表示有效的名称。例如,运行以下命令来创建 3scale-project

    $ oc new-project 3scale-project

这会创建新的 OpenShift 项目,其中将安装 operator、APIManager 自定义资源(CR)和 Capabilities 自定义资源。Operator 通过该项目中的 OLM 管理自定义资源。

2.2.2. 使用 OLM 安装和配置 3scale API Management Operator

使用 Operator Lifecycle Manager (OLM)通过 OCP 控制台中的 OperatorHub 在 OpenShift Container Platform (OCP) 4.12 (或以上)集群中安装 3scale Operator。您可以使用以下安装模式安装 3scale Operator:

  • 集群范围内的 Operator 在集群中的所有命名空间中可用。
  • 集群中的特定命名空间
注意

如果您在受限网络或断开连接的集群中使用 OpenShift Container Platform,Operator Lifecycle Manager 将不再使用 OperatorHub。按照在 受限网络中标题为"使用 Operator Lifecycle Manager"的指南中设置和使用 OLM 的说明

流程

  1. 在 OpenShift Container Platform 控制台中,使用具有管理员特权的帐户登录。
  2. Operators > OperatorHub
  3. Filter by keyword 框中,键入 3scale operator 来查找 Red Hat Integration - 3scale
  4. Red Hat Integration - 3scale。此时会显示有关 Operator 的信息。
  5. 阅读有关 Operator 的信息,再点 Install。此时会打开 Install Operator 页面。
  6. Install Operator 页面中,在 Update channel 部分选择要更新的频道。
  7. Installation mode 部分中,选择安装 Operator 的位置。

    1. All namespaces on the cluster(default) - operator 在集群的所有命名空间中可用。
    2. A specific namespace on the cluster - operator 只能在您选择的集群的特定单一命名空间中可用。
  8. Install
  9. 安装完成后,系统会显示确认信息,指示 Operator 已准备就绪。
  10. 验证 3scale operator ClusterServiceVersion (CSV) 是否已正确安装。另外,检查它报告 Operator 的安装是否成功:

    • Operators > Installed Operators
    • Red Hat Integration - 3scale operator。
    • Details 选项卡中,向下滚动到 Conditions 部分,其中 Succeeded 条件应该在 Reason 列中读取 InstallSucceeded

除了指定的步骤外,在受限网络中使用 OCP 时,创建一个在 3scale 开发人员门户中使用的允许域的列表。请考虑以下示例:

  • 您打算添加到开发人员门户的任何链接。
  • 通过第三方 SSO 提供程序(如 GitHub)进行单点登录(SSO)集成。
  • 计费。
  • 触发外部 URL 的 Webhook。

2.2.2.1. 在断开连接的环境中的限制

以下列表概述了 3scale 2.14 在断开连接的环境中的当前限制:

  • GitHub 登录 Developer Portal 不可用。
  • 支持链接不可用。
  • 到外部文档的链接无法正常运行。
  • Developer Portal 中的 OpenAPI 规范(OAS)验证器不正常运行,会影响外部服务的链接。
  • ActiveDocs 的产品 概述 页面中,到 OAS 的链接不起作用。

    • 在创建新的 ActiveDocs 规格时,还需要检查 Skip swagger 验证选项。

2.2.3. 使用 OLM 升级 3scale API Management Operator

要将 3scale Operator 从单一命名空间升级到基于 Operator 部署的所有命名空间中集群范围的安装,您必须从命名空间中删除 3scale Operator,然后在集群中重新安装 Operator。

集群管理员可以使用 Web 控制台从所选命名空间中删除已安装的 Operator。卸载 Operator 不会卸载现有的 3scale 实例。

从命名空间中卸载 3scale Operator 后,您可以使用 OLM 在集群范围模式下安装 Operator。

先决条件

  • 3scale 管理员权限或具有命名空间删除权限的 OpenShift 角色。

流程

  1. 在 OpenShift Container Platform 控制台中,使用具有管理员特权的帐户登录。
  2. Operators > OperatorHub。此时会显示安装的 Operator 页面。
  3. Filter by name 中输入 3scale 以查找 Operator 并点它。
  4. Operator Details 页面中,从 Actions 下拉菜单中选择 Uninstall Operator,将其从特定命名空间中删除。
  5. 此时会显示 Uninstall Operator? 对话框,提醒您:

    Removing the operator will not remove any of its custom resource definitions or managed resources. If your operator has deployed applications on the cluster or configured off-cluster resources, these will continue to run and need to be cleaned up manually.
    This action removes the operator as well as the Operator deployments and pods, if any. Any operands and resources managed by the operator, including CRDs and CRs, are not removed. The web console enables dashboards and navigation items for some operators. To remove these after uninstalling the operator, you might need to manually delete the operator CRDs.
  6. 选择 Uninstall。此 operator 会停止运行,并且不再接收更新。
  7. 在 OpenShift Container Platform 控制台中点 Operators > OperatorHub
  8. Filter by keyword 框中,键入 3scale operator 来查找 Red Hat Integration - 3scale
  9. Red Hat Integration - 3scale。此时会显示有关 Operator 的信息。
  10. Install。此时会打开 Install Operator 页面。
  11. Install Operator 页面中,在 Update channel 部分选择要更新的频道。
  12. Installation mode 部分中,选择 All namespaces on the cluster(default)。Operator 将在集群中的所有命名空间中可用。
  13. Subscribe.3scale operator 详情页面会显示,您可以查看 Subscription Overview
  14. 确认订阅升级状态显示为 Up to date
  15. 验证是否显示了 3scale operator ClusterServiceVersion(CSV)。

2.2.3.1. 配置微版本的自动应用程序

警告

如果您使用外部 Oracle 数据库,请将 3scale 更新策略设置为 Manual。使用外部 Oracle 数据库时,会手动更新数据库和 .spec.system.imageAutomatic 设置不会更新 .spec.system.image。请参阅 Migrating 3scale 指南,以使用外部 Oracle 数据库更新基于 Operator 的安装。

要获得自动更新,3scale 操作器必须将批准策略设置为 Automatic。这允许它自动应用微版本更新。下面描述了自动手动设置之间的区别,并概述了从一个设置切换到另一个流程的步骤。

自动和手动:

  • 在安装过程中,自动设置是所选选项。随着新的更新可用,就会安装新的更新。您可以在安装过程中或之后更改。
  • 如果您在安装过程中或以后选择了 Manual 选项,会在有可用情况下收到更新。接下来,您必须批准 Install Plan,并自行应用。

流程

  1. Operators > Installed Operators
  2. Installed Operators 列表中,单击 Red Hat Integration - 3scale
  3. Subscription 标签页。在 Subscription Details 标题下,您将看到子标题 Approval
  4. Approval 下的链接。默认情况下,链接设置为 Automatic。将弹出带有标题 Change Update Approval Strategy 的模态。
  5. 选择您的首选选项:Automatic (默认)Manual,然后点 Save
Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

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

让开源更具包容性

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

關於紅帽

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

© 2024 Red Hat, Inc.