2.8. 使用 Oracle 作为系统数据库的操作器安装 3scale
作为红帽 3scale API 管理管理员,您可以使用 Oracle 数据库使用操作器安装 3scale。默认情况下,3scale 2.10 有一个名为 system
的组件,它将在 MySQL 数据库中存储配置数据 。您可以覆盖默认数据库,并将信息存储在外部 Oracle 数据库中。按照以下步骤,使用您自己的 Oracle 数据库客户端二进制文件构建自定义系统容器镜像,并将 3scale 部署到 OpenShift。
- 当您只执行 3scale 的 Operator 安装时,OpenShift Container Platform(OCP)版本 4.2 和 4.3 不支持 Oracle 数据库。如需更多信息,请参阅 Red Hat 3scale API 管理支持的配置 页面。
先决条件
- 一个容器 registry,用于推送容器镜像,该镜像可由安装 3scale 的 OCP 集群访问。
- 不要安装 APIManager 自定义资源,因为它将在以下步骤中创建。
- 3scale 的 Registry 服务帐户。
要使用 Oracle 作为系统数据库通过操作器安装 3scale,请执行以下步骤:
步骤
通过从 GitHub 存储库克隆 3scale 的 OCP 模板,构建基于 Oracle 的系统镜像。
git clone --branch 3scale-2.10.0-GA https://github.com/3scale/3scale-amp-openshift-templates.git
按照使用 Oracle 数据库设置 3scale 系统镜像的先决条件操作。
注意如果本地下载并存储的客户端软件包版本与 3scale 期望不匹配,3scale 将自动下载并使用以下步骤中的相应版本。
-
将您的 Oracle Database Instant 客户端软件包文件放在
3scale-amp-openshift-templates/amp/system-oracle/oracle-client-files
目录中。 使用您在创建 registry 服务帐户中创建的凭证登录到
registry.redhat.io
帐户。docker login registry.redhat.io
构建基于 Oracle 的自定义系统镜像.镜像标签必须是固定镜像标签,如下例所示:
docker build . --tag myregistry.example.com/system-oracle:2.10.0-1
将基于 Oracle 的系统镜像推送到 OCP 集群可访问的容器注册表。此容器 registry 是安装 3scale 解决方案的位置:
docker push myregistry.example.com/system-oracle:2.10.0-1
-
通过使用对应字段创建
system-database
secret,设置 Oracle Database URL 连接字符串和 Oracle Database 系统密码。请参阅为 Oracle 数据库安装外部数据库。 通过创建 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.10.0-1" highAvailability: enabled: true