Try   HackMD
作者: 史啜林
撰寫日期:2021/11/24

<5G O-RAN 筆記2> O-RAN 元件平台

為因應計畫要用的 Demo,先把我做過的事情紀錄一下

部署架構如下圖所示

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

實驗環境

  • Ubuntu 18.04
  • docker 20.10.7
  • kubectl 1.16.0
  • kubeadm 1.16.0
  • kubelet 1.16.0

Step 1: 取得 O-RAN 官方 github 內容

O-RAN 官方提供的 script 包含了 k8s 的安裝,所以其實可以不用先手動安裝 k8s,但如果已經有的話,你可以減少很多步驟,很棒~!

以下範例我們用 B 版本示範與說明 (我在寫得時候已經更新到 D 了)

$ cd /home/user
$ sudo -i
$ git clone http://gerrit.o-ran-sc.org/r/it/dep -b bronze
$ cd dep
$ git submodule update --init --recursive --remote

Step 2: 產生 cloud-init 腳本

此步驟將生成一個腳本,該腳本將設置單節點 Kubernetes 集群

## 將版本需求設定調整為Frankfurt
$ cd tools/k8s/etc
$ vim infra.rc

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

生成部署K8S叢集腳本

$ cd ../bin
$ ./gen-cloud-init.sh
$ ls

產生之腳本 「k8s-1node-cloud-init-k_1_15-h_2_16-d_18_09.sh」

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

Step 3: 安裝Kubernetes、Helm、Docker等

執行官方提供的腳本安裝k8s、Helm、Docker等套件

$ ./k8s-1node-cloud-init-k_1_15-h_2_16-d_18_09.sh

完成後主機將進行重啟,重啟完畢後便可檢查是否有啟動9個pod

$ sudo su
$ kubectl get pods --all-namespaces

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

Step 4 : 安裝Near-RT RIC相關套件

部署Near-RT RIC相關套件之前,要先修改一些設定檔
首先,修正kong下載的image檔

$ cd ~/dep/ric-dep/helm/infrastructure/subcharts/kong
$ vim values.yaml
repository: kong/kubernetes-ingress-controller

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

完成後便可以執行安裝腳本

$ cd ~/dep/bin
$ ./deploy-ric-platform -f ../RECIPE_EXAMPLE/PLATFORM/example_recipe.yaml

完成後可以看到這個畫面

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

此時便可透過指令看目前所有的pod,應有16個pod起在ricplt namespace

$ kubectl get pod -A

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

理論上到這裡部署就結束了