1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
2 .. SPDX-License-Identifier: CC-BY-4.0
3 .. Copyright (C) 2021 Wind River Systems, Inc.
16 This document describes how to install INF O2 service over O-RAN INF platform.
18 The audience of this document is assumed to have basic knowledge in kubernetes cli, helm chart cli.
24 Before starting the installation and deployment of O-RAN O2 service, you should have already deployed O-RAN INF platform, and you need to download the helm charts or build from source as described in developer-guide.
27 INF O2 Service in E Release
28 ===========================
30 1. Provision remote cli for kubernetes over INF platform
31 --------------------------------------------------------
34 1.1 Setup Service Account over O-RAN INF platform
35 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37 The following instruction must be done over INF platform controller host (controller-0)
39 - Please see the O-RAN INF documentation to find out how to ssh to controller host of INF platform.
44 NAMESPACE="kube-system"
46 cat <<EOF > admin-login.yaml
51 namespace: kube-system
53 apiVersion: rbac.authorization.k8s.io/v1
54 kind: ClusterRoleBinding
58 apiGroup: rbac.authorization.k8s.io
62 - kind: ServiceAccount
64 namespace: kube-system
67 kubectl apply -f admin-login.yaml
68 TOKEN_DATA=$(kubectl -n kube-system describe secret $(kubectl -n kube-system get secret | grep ${USER} | awk '{print $1}') | grep "token:" | awk '{print $2}')
72 1.2 Setup remote cli over another linux host (ubuntu as example)
73 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
75 The following instruction should be done outside of INF platform controller host
79 sudo apt-get install -y apt-transport-https
80 echo "deb http://mirrors.ustc.edu.cn/kubernetes/apt kubernetes-xenial main" | \
81 sudo tee -a /etc/apt/sources.list.d/kubernetes.list
82 gpg --keyserver keyserver.ubuntu.com --recv-keys 836F4BEB
83 gpg --export --armor 836F4BEB | sudo apt-key add -
85 sudo apt-get install -y kubectl
87 source <(kubectl completion bash) # setup autocomplete in bash into the current shell, bash-completion package should be installed first.
88 echo "source <(kubectl completion bash)" >> ~/.bashrc # add autocomplete permanently to your bash shell.
90 curl -O https://get.helm.sh/helm-v3.5.3-linux-amd64.tar.gz
91 tar xvf helm-v3.5.3-linux-amd64.tar.gz
92 sudo cp linux-amd64/helm /usr/local/bin/
94 source <(helm completion bash)
95 echo "source <(helm completion bash)" >> ~/.bashrc
99 TOKEN_DATA=<TOKEN_DATA from INF>
103 kubectl config set-cluster inf-cluster --server=https://${OAM_IP}:6443 --insecure-skip-tls-verify
104 kubectl config set-credentials ${USER} --token=$TOKEN_DATA
105 kubectl config set-context ${USER}@inf-cluster --cluster=inf-cluster --user ${USER} --namespace=${NAMESPACE}
106 kubectl config use-context ${USER}@inf-cluster
111 2. Deploy INF O2 service
112 ------------------------
114 2.1 Retrieve Helm chart for deploying of INF O2 service
115 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
119 git clone -b e-release "https://gerrit.o-ran-sc.org/r/pti/o2"
123 2.2 Prepare override yaml
124 ~~~~~~~~~~~~~~~~~~~~~~~~~
128 export NAMESPACE=orano2
129 kubectl create ns ${NAMESPACE}
131 # default kube config location is ~/.kube/config
132 cp ~/.kube/config o2/charts/resources/scripts/init/k8s_kube.conf
134 export OS_AUTH_URL=<INF OAM Auth URL e.g.: http://OAM_IP:5000/v3>
135 export OS_USERNAME=<INF username e.g.: admin>
136 export OS_PASSWORD=<INF password for user e.g.: adminpassword>
138 # If the external OAM IP same as OS_AUTH_URL's IP address, you can use the below command to set the environment
139 # export API_HOST_EXTERNAL_FLOATING=$(echo ${OS_AUTH_URL} | sed -e s,`echo ${OS_AUTH_URL} | grep :// | sed -e's,^\(.*//\).*,\1,g'`,,g | cut -d/ -f1 | sed -e 's,:.*,,g')
140 export API_HOST_EXTERNAL_FLOATING=<INF external_oam_floating_address e.g.: 128.10.10.10>
142 # please specify the smo service account yaml file
143 export SMO_SERVICEACCOUNT=<your input here eg.: smo>
144 # service account and binding for smo yaml file
146 cat <<EOF >smo-serviceaccount.yaml
147 apiVersion: rbac.authorization.k8s.io/v1
153 - apiGroups: [""] # "" indicates the core API group
155 verbs: ["get", "watch", "list"]
160 name: ${SMO_SERVICEACCOUNT}
163 apiVersion: rbac.authorization.k8s.io/v1
169 apiGroup: rbac.authorization.k8s.io
173 - kind: ServiceAccount
174 name: ${SMO_SERVICEACCOUNT}
179 kubectl apply -f smo-serviceaccount.yaml
181 #export the smo account token data
182 export SMO_TOKEN_DATA=$(kubectl -n default describe secret $(kubectl -n default get secret | grep ${SMO_SERVICEACCOUNT} | awk '{print $1}') | grep "token:" | awk '{print $2}')
184 cat <<EOF>o2service-override.yaml
186 imagePullSecrets: admin-orano2-registry-secret
188 repository: nexus3.o-ran-sc.org:10004/o-ran-sc/pti-o2imsdms
190 pullPolicy: IfNotPresent
191 logginglevel: "DEBUG"
194 OS_AUTH_URL: "${OS_AUTH_URL}"
195 OS_USERNAME: "${OS_USERNAME}"
196 OS_PASSWORD: "${OS_PASSWORD}"
197 K8S_KUBECONFIG: "/opt/k8s_kube.conf"
198 API_HOST_EXTERNAL_FLOATING: "${API_HOST_EXTERNAL_FLOATING}"
203 2.3 Deploy by helm cli
204 ~~~~~~~~~~~~~~~~~~~~~~
208 helm install o2service o2/charts/ -f o2service-override.yaml
209 helm list |grep o2service
210 kubectl -n ${NAMESPACE} get pods |grep o2api
211 kubectl -n ${NAMESPACE} get services |grep o2api
214 2.4 Verify INF O2 service
215 ~~~~~~~~~~~~~~~~~~~~~~~~~
219 curl -k http(s)://<OAM IP>:30205/o2ims_infrastructureInventory/v1/
222 2.5 INF O2 Service API Swagger
223 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
225 - Swagger UI can be found with URL: http(s)://<OAM IP>:30205
228 3. Register INF O2 Service to SMO
229 ---------------------------------
231 - assumed you have setup SMO O2 endpoint for registration
232 - INF O2 service will post the INF platform registration data to that SMO O2 endpoint
238 'http(s)://<OAM IP>:30205/provision/v1/smo-endpoint' \
239 -H 'accept: application/json'
242 'http(s)://<OAM IP>:30205/provision/v1/smo-endpoint' \
243 -H 'accept: application/json' \
244 -H 'Content-Type: application/json' \
245 -d '{"endpoint": "<SMO O2 endpoint for registration>"}'
247 # Confirm SMO endpoint provision status
249 'http(s)://<OAM IP>:30205/provision/v1/smo-endpoint' \
250 -H 'accept: application/json'
258 .. _`O-RAN-SC INF`: https://docs.o-ran-sc.org/en/latest/projects.html#infrastructure-inf