在 Azure Red Hat OpenShift 上部署 Oracle Blockchain Platform Enterprise Edition

您可以在 Azure Red Hat OpenShift 上安装 Oracle Blockchain Platform Enterprise Edition。OpenShift 是 Red Hat 的企业 Kubernetes 平台,该平台通过一套工具来增强标准 Kubernetes,可用于大规模构建、部署和管理容器化应用。Azure Red Hat OpenShift 是 Microsoft Azure 上完全托管的 OpenShift 服务。

本主题中的说明是一条准则,建议您如何在 Azure Red Hat OpenShift 上部署 Oracle Blockchain Platform Enterprise Edition。在实际尝试这一点之前,特别是对于生产环境,您应该熟悉 Azure Red Hat OpenShift 文档,该文档取代了本主题中的任何信息。

在 Microsoft Azure 上创建 Red Hat OpenShift 集群

建议的 Azure Red Hat OpenShift 集群的最低规范。

使用 Azure 文档作为指南创建 Azure Red Hat OpenShift 集群:创建 Azure Red Hat OpenShift 集群

您将需要创建以下项:
  • 控制层 VM:三个 Standard_D8s_v3
  • Worker 节点 VM:四个 Standard_D4s_v3
  • 生成 Red Hat 提取密钥。

安装 Oracle Blockchain Platform Enterprise Edition

Oracle Blockchain Platform 部署所需的映像将存储在 Docker 资料档案库中,然后再推送到 Microsoft Azure VM。我们建议从云 Linux VM 进行安装,该 VM 的地理位置尽可能接近您的软件安装区域。Docker 映像的本地存储应大约为 100GB。

  1. 打开 OpenShift 集群控制台。
  2. 依次选择 kube:adminCopy login command。系统将提示您输入您的用户 ID 和密码。
    单击显示标记。复制 Log in with this token 命令并将其粘贴到 OpenShift 命令行界面中。
    $ oc login --token=<token> --server=<openshift_cluster_url>
  3. 验证您是否已连接到 OpenShift。
    oc get nodes
    此命令应返回主节点和 worker 节点的列表及其状态。
  4. 设置 istio 配置文件。在运行以下命令之前,必须先完成 Install Istio 中的步骤。
    istioctl install --set profile=openshift --set
    values.pilot.env.ENABLE_TLS_ON_SIDECAR_INGRESS=true --set components.cni.enabled=true --set
    values.cni.repair.deletePods="true"
  5. 下载 Oracle Blockchain Platform:Oracle Blockchain Platform
  6. 提取 zip 软件包并查找 OpenShift 的 runme 脚本。
  7. 使用必需的值更新 runme-input.yaml 文件。以下示例 runme-input.yaml 文件可以用作引用:
    imageRegistryConfiguration:
      registry: <container_registry_name.azurecr.io>
      imageTagPrefix: <container-image-repository-prefix.azurecr.io/bcs-k8s-dev  >
      username: <container-registry-username>
     
    imageReleaseVersion: 24.1.3-20240723083137
     
    # storageClassName should be set to create a dynamic persistent volume. If empty, default storageClass is used.
     
    controlPlaneStorage:
      storageClassName: 
      # Example 500Mi, 5Gi
      size: 10Gi
      
    parentDomainName: example.com
    #imagePullTimeout: Use this field to customize the wait time (in seconds) for pulling the required container images from the repository. Default is 1800 seconds.
      imagePullTimeout: 1800
    在前面的示例中,变量按如下列表中所示进行定义:
    • imageRegistryConfiguration.registry:要使用的容器注册表服务器。
    • imageRegistryConfiguration.imageTagPrefix :容器基本资料档案库路径和注册表,其中映像将被推送到并拉出。示例:registryname.azurecr.io/obpee/bcs
    • imageRegistryConfiguration.username:容器注册表登录用户名。对于 Azure,它是容器注册表标记。
    • imageReleaseVersionOracle Blockchain Platform Enterprise Edition 版本
    • controlPlaneStorage.storageClassName:要用于 PVC 的 Kubernetes 存储类 (PersistentVolumeClaim )。如果为空,则使用缺省 storageClass
    • controlPlaneStorage.size :Blockchain Platform Manager(控制平面)服务的 PVC 大小
    • parentDomainName:用于区块链平台管理器服务的域名。示例:example.com
    • imagePullTimeout:在 Oracle Blockchain Platform Enterprise Edition 安装期间,图像提取等待超时(以秒为单位)。默认值为 1800 秒。
  8. 在编辑器中打开 runme_openshift.sh,并注释掉以下两行:
    • openshift_status_check
    • check_software_exists "crc"
  9. 运行 runme_openshift.sh 并按提示完成这些步骤:
    chmod +x runme_openshift.sh
    
    ./runme_openshift.sh --publish-images
    # The publish-images option uploads the containers to the container image registry specified in runme-input.yaml
    # Running the script without this option pulls images you've already pre-uploaded from the repository specified in runme-input.yaml
    您将遇到的提示:
    • 输入 OpenLDAP 管理员密码 - 这将由 Blockchain Platform Manager 使用,用户将在此 OpenLDAP 服务器上创建。
    • 输入控制层管理员密码 - 此密码将由 Oracle Blockchain Platform 管理员用户使用,并首次登录 Blockhain Platform Manager 控制台。
    • 输入 run-input.yaml 中指定用户的注册表登录密码 - 此密码用于连接到容器资料档案库。
    • 该脚本将以下服务安装在 obp-cp 名称空间下:
      • control-plane
      • openldap
      • obp-auth-server
      • obp-operator
      • hlf-operator
  10. 获取 Istio 入站网关服务的外部 IP 地址:
    kubectl get svc/istio-ingressgateway -n istio-system
  11. 根据需要在用于连接到 Blockchain Platform Manager 控制台的主机上向这些文件之一添加以下行:
    • Linux 或 macOS:/etc/hosts
    • Windows:C:\Windows\system32\drivers\etc\hosts
    <public_svc_ip> controlplane.<parentDomainName> openldap.<parentDomainName> auth.<parentDomainName>
    其中 <public_svc_ip> 是上一步骤中的公共外部 IP 地址。

后续条件

您现在可以首次登录 Oracle Blockchain Platform 并预配实例。