在 minikube 上部署 Oracle Blockchain Platform Enterprise Edition

minikube 可用於測試和內部開發目的。不建議在生產環境執行。

必備條件:
  • CPU:8 或更高
  • 記憶體:16GB
  • 可用磁碟空間:50GB 或更高
  • 具有超級使用者權限的非 root 使用者
  • 確定 minikube 節點可以存取網際網路,這是在 Oracle Blockchain Platform 執行個體上安裝鏈碼所必需的。
  • minikube v1.33.1 或更新版本

安裝 minikube

本節提供安裝 minikube 測試版本的逐步解說範例。如需詳細資訊,請參閱 Kubernetes 安裝工具

#Download the latest minikube binary
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64

#Install
sudo install minikube-linux-amd64 /usr/local/bin/minikube

#Verify Installation
minikube version

#Start Minikube
minikube start

#Verify Minikube Installation
minikube status
#Install Homebrew (if not already installed)
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

#Install minikube using Homebrew
brew install minikube

#Start minikube
minikube start

#Verify minikube Installation
minikube status

完成 Istio 安裝

Oracle Blockchain Platform Enterprise Edition 支援版本 1.20.2 和更新版本。您必須先完成安裝 Istio 中的步驟,才能完成下列作業。


# Install
    istioctl install --set profile=default --set values.pilot.env.ENABLE_TLS_ON_SIDECAR_INGRESS=true --set components.cni.enabled=true --set values.cni.repair.deletePods="true"
    ## Enter "y" when prompted for "Proceed? (y/N)"
 
# Verify:
    $ istioctl version
    client version: 1.22.1
    control plane version: 1.22.1
    data plane version: 1.22.1 (1 proxies)

安裝 Oracle Blockchain Platform Enterprise Edition

若要在您的 minikube 實例上下載並安裝 Oracle Blockchain Platform Enterprise Edition ,請執行下列動作:

  1. Oracle Blockchain Platform Enterprise Edition 頁面上,按一下下載,然後依照步驟下載 Oracle Blockchain Platform Enterprise Edition 套件。解壓縮套件,然後從下載的封存檔案擷取套件。
    tar -xzf <distribution-package-file>
    # example tar -xzf obpee_package_24.1.3-20240723083137.tgz
  2. 以必要的值更新 runme-input.yaml。此範例為 runme-input.yaml,可作為參照:
    imageRegistryConfiguration:
      registry: <container_registry_name>
      imageTagPrefix: <container-image-repository-prefix>
      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: 4Gi
      
    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:要使用的容器登錄伺服器。範例:iad.ocir.io
    • imageRegistryConfiguration.imageTagPrefix :含有登錄的容器基本儲存區域路徑,其中會將影像推送 (推送) 至 (從)。範例:iad.ocir.io/obpee/bcs
    • imageRegistryConfiguration.username:容器登錄登入使用者名稱
    • imageReleaseVersion - Oracle Blockchain Platform Enterprise Edition 發行版本
    • controlPlaneStorage.storageClassName:用於 PVC 的 Kubernetes 儲存類別 (PersistentVolumeClaim)。如果空白,則使用預設 storageClass
    • controlPlaneStorage.size :區塊鏈平台管理程式 (控制層) 服務的 PVC 大小
    • parentDomainName:用於區塊鏈平台管理程式服務的網域名稱。範例:example.com
    • imagePullTimeout:在 Oracle Blockchain Platform Enterprise Edition 安裝期間,影像提取等待逾時 (秒)。預設值為 1800 秒。
  3. 確定 minikube 正在執行中。
  4. 開啟新的終端機視窗,並移至發行套件目錄。執行 runme_minikube.sh,然後依照命令檔輸出所提示的步驟執行:
    ./runme_minikube.sh [--publish-image]

    附註:

    選擇性的 --publish-image 命令會將容器上傳至容器映像檔登錄檔,例如 Oracle Cloud Infrastructure Registry
    • 輸入預設的 LDAP 管理員密碼 (不會顯示密碼):這是用來設定內建 LDAP 認證伺服器的管理員使用者密碼。
    • 輸入預設控制層管理員使用者密碼 (不會顯示密碼):這是用來設定區塊鏈平台管理程式管理員使用者的密碼。
    • 如果 runme-input.yaml 中未提供 StorageClass,系統將會檢查是否已設定預設儲存類別,並詢問您是否要使用它。
    • 確認 Istio 輸入閘道服務 HTTPS 連接埠:LoadBalancer 服務類型的預設值為 443。
    • 輸入登錄 <registry name> 密碼:這是用來連線至您的容器映像檔登錄 (如 runme-input.yaml 中所指定) 以下載映像檔。
  5. 在其他終端機視窗中,執行下列命令:
    export KUBECONFIG=/<path_to>/.kube/minikube
  6. 確定 minikube 通道可用於存取 Blockchain Platform Manager 和執行處理:
    minikube tunnel --bind-address 0.0.0.0
  7. 此程序檔應繼續在 obp-cp 命名空間下安裝下列服務:
    • control-plane
    • openldap
    • obp-auth-server
    • obp-operator
    • hlf-operator
  8. 此命令檔將輸出可存取控制層 UI 的區塊鏈平台管理程式 URL。

存取區塊鏈平台管理程式

安裝之後,請為產生的區塊鏈平台管理程式主機名稱設定主機名稱解析。
  1. 執行此命令以取得已設定的主機名稱清單:
    kubectl get virtualservice -n obp-cp -o json | jq -r .items[].spec.hosts[0]
  2. 使用 minikube 主機的 IPv4 位址作為所產生主機名稱的對應 IP 位址。
  3. 確保 minikube 通道有效,以存取 Blockchain Platform Manager 和 Oracle Blockchain Platform 執行處理。