2.8. 使用 Oracle 作为系统数据库的操作器安装 3scale

作为红帽 3scale API 管理管理员,您可以使用 Oracle 数据库使用操作器安装 3scale。默认情况下,3scale 2.11 具有一个名为 system 的组件,可将配置数据存储在 MySQL 数据库中。您可以覆盖默认数据库,并将信息存储在外部 Oracle 数据库中。按照以下步骤,使用您自己的 Oracle 数据库客户端二进制文件构建自定义系统容器镜像,并将 3scale 部署到 OpenShift。

注意
  • 当您只执行 3scale 的 Operator 安装时,OpenShift Container Platform(OCP)版本 4.2 和 4.3 不支持 Oracle 数据库。如需更多信息,请参阅 Red Hat 3scale API 管理支持的配置 页面。

先决条件

要使用 Oracle 作为系统数据库通过操作器安装 3scale,请执行以下步骤:

流程

  1. GitHub 存储库下载 3scale OpenShift 模板并提取存档:

    tar -xzf 3scale-amp-openshift-templates-3scale-2.11.1-GA.tar.gz
  2. 按照使用 Oracle 数据库设置 3scale 系统镜像的先决条件操作

    注意

    如果本地下载并存储的客户端软件包版本与 3scale 期望不匹配,3scale 将自动下载并使用以下步骤中的相应版本。

  3. 将 Oracle Database Instant Client Package 文件放在 3scale-amp-openshift-templates-3scale-2.11.1-GA/amp/system-oracle/oracle-client-files 目录中。
  4. 使用您在创建 registry 服务帐户中创建的凭证登录到 registry.redhat.io 帐户。

    docker login registry.redhat.io
  5. 构建基于 Oracle 的自定义系统镜像.镜像标签必须是固定镜像标签,如下例所示:

    docker build . --tag myregistry.example.com/system-oracle:2.11.0-1
  6. 将基于 Oracle 的系统镜像推送到 OCP 集群可访问的容器注册表。此容器 registry 是安装 3scale 解决方案的位置:

    docker push myregistry.example.com/system-oracle:2.11.0-1
  7. 通过使用对应字段创建 system-database secret,设置 Oracle Database URL 连接字符串和 Oracle Database 系统密码。请参阅为 Oracle 数据库安装外部数据库
  8. 通过创建 APIManager 自定义资源来安装 3scale 解决方案。按照使用 operator 部署 3scale 中的说明进行操作。

    • APIManager 自定义资源必须指定设置为您之前构建的基于 Oracle 的系统的 .spec.system.image 字段:

      apiVersion: apps.3scale.net/v1alpha1
      kind: APIManager
      metadata:
        name: example-apimanager
      spec:
       imagePullSecrets:
        - name: threescale-registry-auth
        - name: custom-registry-auth
       system:
        image: "myregistry.example.com/system-oracle:2.11.0-1"
       highAvailability:
        enabled: true