在 Oracle Kubernetes Engine 上部署 Oracle SOA Suite

在此步驟中,您將在 Oracle Kubernetes 引擎上佈建 Kubernetes 叢集,其中包含 SOA Suite 綱要的資料庫,以及用於儲存 SOA Suite 網域檔案的檔案儲存掛載路徑,以及 Kubernetes 中的 Oracle SOA Suite。

下列程序假設您已安裝下列項目:
  • Git
  • OCI 命令行介面 (CLI)
  • Terraform
  • Helm 3.x 語言

接受 Docker 映像檔的使用條款

此圖表是使用 Oracle Container Registry 之 Oracle SOA Suite Docker 映像檔的必要項目;因此,您必須接受 Oracle SOA Suite Docker 映像檔的條款與條件,否則將無法從登錄提取映像檔。

若要接受條款,請執行下列作業:

  1. 前往 Oracle Container Registry 並搜尋 SOA。
  2. 按一下 soasuite
  3. 按一下以接受右側的「授權」條款與條件。
  4. 填入您的資訊 (如果您還沒有的話)。
  5. 請接受授權。
  6. 或者,如果您打算將資料庫部署為 kubernetes 叢集內的容器 (選擇性;非生產環境),則必須接受 Oracle Database Docker 映像檔條款與條件。Terraform 命令檔會從 Oracle Cloud Database Cloud Service 部署 Oracle 資料庫,因此只有在想要將資料庫部署為 Kubernetes 叢集中的容器時,才需要此步驟。
    1. 搜尋資枓庫。
    2. 按一下「企業」。
    3. 按一下以接受右側的「授權」條款與條件。
    4. 填入您的資訊 (如果您還沒有的話)。
    5. 請接受「授權」。

取得 Terraform 程式碼

Terraform 程式碼可讓您部署必要的基礎架構 (Kubernetes 叢集、檔案儲存體),以及部署 SOA Helm 圖表及其先決條件。

取得 Terraform 程式碼:

  1. 按一下此手冊 (https://github.com/oracle-quickstart/oke-soa) 左側導覽列中的 Github 儲存區域
    這樣會開啟 Kubernetes Github 儲存區域上的 Oracle SOA Suite。
  2. 按一下程式碼並將它下載為壓縮檔,或使用您所選本機資料夾中的 git 命令行複製儲存區域
    git clone https://github.com/oracle-quickstart/oke-soa
  3. 輸入下列程式碼資料夾:
    cd oke-soa

收集必要資訊

現在,尋找並複製適當的租用戶和區間 OCID。

  1. 按一下您的「使用者」圖示 (右上角),然後按一下租用戶,從 Oracle Cloud 主控台取得租用戶 OCID。複製租用戶的 OCID (租用戶欄位),然後貼到您的環境檔案中。
  2. 從 Oracle Cloud 主控台依序按一下識別區間,取得您的區間 OCID。瀏覽至要部署基礎架構的區間,並複製該區間的 OCID.

建立 terraform.tfvars 組態檔

若要執行部署,您必須建立名為 terraform.tfvars 的檔案,並在其中定義一些設定值。

  1. 輸入下列資訊,從樣板建立名為 terraform.tfvars 的檔案:
    cp terraform.tfvars.template terraform.tfvars
  2. 使用您選擇的編輯器編輯檔案,並提供下列值:

    附註:

    步驟 3 到步驟 9 描述此組態檔的必要資訊。請確定輸入適當的證明資料值。
    ## Copyright © 2021, Oracle and/or its affiliates. 
    ## All rights reserved. The Universal Permissive License (UPL), Version 1.0 as shown at http://oss.oracle.com/licenses/upl
    
    tenancy_ocid     = "ocid1.tenancy.oc1..."
    compartment_ocid = "ocid1.compartment.oc1..."
    region           = "us-ashburn-1"
    
    deployment_name = "SOA-k8s"
    soa_domain_name = "mysoa"
    
    # Domain Type must be one of soa, soaess, soaosb, soaessosb
    soa_domain_type = "soaessosb"
    
    ## Things to provision
    
    # VCN, OKE cluster, node_pool(s)
    # if false, the template assumes the cluster is provisioned and that kubectl has access to the cluster.
    provision_cluster = true
    
    # File Storage and mount point export 
    provision_filesystem = true
    provision_export = true
    
    # Database (DBaaS on OCI)
    # If false, a database jdbc_connection URL needs to be provided, and the database needs to be reachable from this VCN
    provision_database = true
    # WebLogic Operator
    provision_weblogic_operator = true
    # Ingress controller
    provision_traefik = true
    provision_secrets = true
    provision_soa = true
    
    ## File storage details
    # If the VCN is not provided by this template, the following variables must be provided
    fss_subnet_id = null
    # If the cluster and VCN are not provided by this template,
    fss_source_cidr = "0.0.0.0/0"
    # File Storage mount target Availability Domain index
    ad_number = 2
    
    ## Credentials
    # Input your Container registry login credentials
    container_registry_email    = ""
    container_registry_password = ""
    
    # Create SOA Suite domain Admin Console credentials
    soa_domain_admin_username = ""
    # Password must contain 1 Upper, 1 number and be at least 8 characters long
    soa_domain_admin_password = ""
    
    # Create Database credentials
    # Password must be 9 to 30 characters and contain at least 2 uppercase, 2 lowercase, 2 special, and 2 numeric characters. 
    # The special characters must be _, #, or -.
    db_sys_password = ""
    
    # Create RCU Schema credentials
    rcu_prefix = "SOA"
    rcu_username = "rcu"
    # Password must be 9 to 30 characters and contain at least 2 uppercase, 2 lowercase, 2 special, and 2 numeric characters. 
    # The special characters must be _, #, or -.
    rcu_password = ""
    
    # If connecting to an external DB, specify the jdbc_connection_url
    # !!! You will need to adjust the security list on your database VCN/subnet to authorize access from the OKE cluster nodes,
    # which may require VCN peering (not provided here)
    jdbc_connection_url = null
    
    # Database information
    database_name        = "SOA"
    database_unique_name = "SOA"
    
    # Kubernetes namespaces
    soa_kubernetes_namespace     = "soans"
    weblogic_operator_namespace  = "opns"
    ingress_controller_namespace = "traefik"
    
    # VCN config
    vcn_cidr = "10.0.0.0/16"
    
    # SSH key to access database and Kubernetes nodes
    ssh_authorized_key = ""
    
    # Cluster config
    oke_cluster = {
    name                                                    = "OKE_Cluster"
    k8s_version                                             = "v1.18.10"
    pods_cidr                                               = "10.1.0.0/16"
    services_cidr                                           = "10.2.0.0/16"
    cluster_options_add_ons_is_kubernetes_dashboard_enabled = true
    cluster_options_add_ons_is_tiller_enabled               = true
    }
    
    # defaults to 1 pool, feel free to add more if needed.
    node_pools = [
    {
        pool_name  = "pool1"
        node_shape = "VM.Standard2.4"
        node_count = 3
        node_labels = {
        "pool_name" = "pool1"
        }
    }
    ]
    
    # Optional parameter,
            requires a vault and key to be created in the account.secrets_encryption_key_ocid = null
  3. 檔案系統的預設可用性網域通常會低於 AD-1,因此設為 AD-2。如果您位於單一 AD 區域,這可能會失敗,因此您需要變更預設變數以變更可用性網域索引
    ad_number = 2
    到:
    ad_number = 1 
  4. 請提供有效的證明資料,以便存取 Oracle Container Registry (您的帳戶電子郵件和密碼) 以提取映像檔。
  5. 提供符合 WebLogic 網域密碼需求的使用者名稱和密碼;亦即,必須包含一個大寫字母、一個數字,而且長度至少要有 8 個字元:
    soa_domain_admin_username = "" 
    soa_domain_admin_password = ""
  6. 提供資料庫 SYS 使用者和 RCU 綱要密碼的證明資料。兩者都必須包含 16 到 30 個字元,包括一個大寫字母、一個數字以及兩個特殊字元 (例如 #!%)。
    db_sys_password = "" 
    rcu_password = ""
  7. 新增 rcu_prefix。每個網域的這個值必須是唯一的 (在部署多個網域時)。
  8. 新增網域名稱。此名稱必須是唯一的 (在部署多個網域時)。
  9. 使用您的 ssh 公用金鑰設定 ssh_authorized_key。您可以輸入下列內容,取得先前建立之公用金鑰的輸出:
    cat ~/.ssh/id_rsa.pub
  10. 儲存 terraform.tfvars 檔案。

執行部署

在所有初步工作完成之後,您現在就可以執行部署。

  1. 初始化專案:
    terraform init 
  2. 2.或者,檢查 plan.To 可判斷會發生什麼情況,您可以執行計畫作業:
    terraform plan 
  3. 套用計畫:
    terraform apply
    系統會提示您輸入 yes 來套用計畫:
     Do you want to perform these actions? 
    Terraform will perform the actions described above. 
    Only 'yes' will be accepted to approve. 
    Enter a value: yes 
    佈建資源需要數分鐘的時間。
這會佈建 Oracle Kubernetes Engine 叢集,其中:
  • 3 個節點的節點集區。
  • 儲存 Oracle SOA Suite 綱要的資料庫。
  • 儲存 Oracle SOA Suite 網域檔案的檔案儲存檔案系統和掛載目標。
它也會安裝 Kubernetes 安裝 Oracle SOA Suite 的先決條件:
  • Oracle WebLogic Kubernetes 操作員。
  • Traefik 傳入控制器。
它會為 SOA 網域的各種元件建立加密密碼。它會在 Kubernetes 上部署 Oracle SOA。

存取部署

如果 Oracle SOA Suite on 已順利部署在 Oracle Kubernetes 上,您現在可以存取它。

  1. 取得傳入控制器所建立之負載平衡器的公用 IP
    kubectl get services -n traefik
    這應該輸出如下:
    NAME      TYPE           CLUSTER-IP     EXTERNAL-IP      PORT(S)                                          AGE
    traefik   LoadBalancer   10.2.170.178   123.456.789.123  9000:31242/TCP,30305:30305/TCP,30443:30443/TCP   3m
    如果還在等待,請稍候幾分鐘後再檢查一次。

    取得負載平衡器的 EXTERNAL-IP 值。

  2. 請確定 SOA 網域伺服器正在執行中:如果您尚未變更 SOA 命名空間的名稱,您可以輸入以下資訊來檢查執行中的 Pod:
    kubectl get pods -n soans
    您應該會看到:
    NAME                READY   STATUS    RESTARTS   AGE    IP          NODE          NOMINATED NODE   READINESS GATES
    mysoa-adminserver   1/1     Running   0          179m   10.1.1.9    10.0.10.211   <none>           <none>
    mysoa-osb-server1   1/1     Running   0          172m   10.1.1.10   10.0.10.211   <none>           <none>
    mysoa-osb-server2   1/1     Running   0          172m   10.1.1.12   10.0.10.211   <none>           <none>
    mysoa-soa-server1   1/1     Running   0          172m   10.1.1.11   10.0.10.211   <none>           <none>
    mysoa-soa-server2   1/1     Running   0          172m   10.1.0.6    10.0.10.16    <none>           <none>
    檢查 URL 之前,請先確定 STATUSRUNNING,且上述 Pod 的 READY1/1
  3. 在稍早收集的公用 IP 之後,瀏覽至 http://PUBLIC_IP:30305/console 以進入 WebLogic 主控台。如果您看到「無效的閘道」訊息,管理伺服器尚未執行。
  4. 使用您在 terraform.tfvars file 中指定的 soa_domain_usernamesoa_domain_password 登入主控台。
  5. 瀏覽 http://PUBLIC_IP:30305/ess 以檢查 /ess 端點。使用者名稱與密碼與您用於主控台的使用者名稱與密碼相同。
  6. 瀏覽 http://PUBLIC_IP:30305/em 以檢查 /em 端點。
  7. 瀏覽至 http://PUBLIC_IP:30305/soa/composer 檢查 /soa/composer 端點。