Add docs for pti o2 service
[pti/o2.git] / docs / installation-guide.rst
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.
4
5
6 Installation Guide
7 ==================
8
9 .. contents::
10    :depth: 3
11    :local:
12
13 Abstract
14 --------
15
16 This document describes how to install O-RAN O2 service over O-RAN INF platform.
17
18 The audience of this document is assumed to have basic knowledge in kubernetes cli, helm chart cli.
19
20
21 Preface
22 -------
23
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.
25
26
27 ORAN O2 Service in E Release
28 ============================
29
30 1. Provision remote cli for kubernetes over INF platform
31 --------------------------------------------------------
32
33
34 1.1 Setup Service Account over O-RAN INF platform
35 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
36
37 The following instruction must be done over INF platform controller host (controller-0)
38
39 -  Please see the O-RAN INF documentation to find out how to ssh to controller host of INF platform.
40
41 ::
42
43   USER="admin-user"
44   NAMESPACE="kube-system"
45
46   cat <<EOF > admin-login.yaml
47   apiVersion: v1
48   kind: ServiceAccount
49   metadata:
50     name: ${USER}
51     namespace: kube-system
52   ---
53   apiVersion: rbac.authorization.k8s.io/v1
54   kind: ClusterRoleBinding
55   metadata:
56     name: ${USER}
57   roleRef:
58     apiGroup: rbac.authorization.k8s.io
59     kind: ClusterRole
60     name: cluster-admin
61   subjects:
62   - kind: ServiceAccount
63     name: ${USER}
64     namespace: kube-system
65   EOF
66
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}')
69   echo $TOKEN_DATA
70
71
72 1.2 Setup remote cli over another linux host (ubuntu as example)
73 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
74
75 The following instruction should be done outside of INF platform controller host
76
77 ::
78
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   sudo apt-get update
83   sudo apt-get install -y kubectl
84
85   source <(kubectl completion bash) # setup autocomplete in bash into the current shell, bash-completion package should be installed first.
86   echo "source <(kubectl completion bash)" >> ~/.bashrc # add autocomplete permanently to your bash shell.
87
88   https://get.helm.sh/helm-v3.5.3-linux-amd64.tar.gz
89   tar xvf helm-v3.5.3-linux-amd64.tar.gz
90   sudo cp linux-amd64/helm /usr/local/bin
91
92   source <(helm completion bash)
93   echo "source <(helm completion bash)" >> ~/.bashrc
94
95   OAM_IP=<INF OAM IP>
96   NAMESPACE=orano2
97   TOKEN_DATA=<TOKEN_DATA from INF>
98
99   USER="admin-user"
100
101   kubectl config set-cluster inf-cluster --server=https://${OAM_IP}:6443 --insecure-skip-tls-verify
102   kubectl config set-credentials ${USER} --token=$TOKEN_DATA
103   kubectl config  set-context ${USER}@inf-cluster --cluster=inf-cluster --user ${USER} --namespace=${NAMESPACE}
104   kubectl config use-context ${USER}@inf-cluster
105
106   kubectl get pods -A
107
108
109 2. Deploy O2 service
110 --------------------
111
112 2.1 Retrieve Helm chart for deploying of O2 service
113 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
114
115 ::
116
117   git clone  -b e-release "https://gerrit.o-ran-sc.org/r/pti/o2"
118
119
120
121 2.2 Prepare override yaml
122 ~~~~~~~~~~~~~~~~~~~~~~~~~
123
124 ::
125
126   export NAMESPACE=orano2
127   kubectl create ns ${NAMESPACE}
128
129   cd /home/sysadmin/
130   source /etc/platform/openrc
131   cat <<EOF>o2service-override.yaml
132   o2ims:
133     imagePullSecrets: admin-orano2-registry-secret
134     image:
135       repository: registry.local:9001/admin/o2imsdms
136       tag: 0.1.4
137       pullPolicy: IfNotPresent
138     logginglevel: "DEBUG"
139
140   ocloud:
141     OS_AUTH_URL: "${OS_AUTH_URL}"
142     OS_USERNAME: "${OS_USERNAME}"
143     OS_PASSWORD: "${OS_PASSWORD}"
144   EOF
145
146
147 2.3 Deploy by helm cli
148 ~~~~~~~~~~~~~~~~~~~~~~
149
150 ::
151
152   helm install o2service o2/charts/ -f o2service-override.yaml
153   helm list |grep o2service
154   kubectl -n ${NAMESPACE} get pods |grep o2service
155   kubectl -n ${NAMESPACE} get services |grep o2service
156
157
158 2.4 Verify O2 service
159 ~~~~~~~~~~~~~~~~~~~~~
160
161 ::
162
163   curl -k http(s)://<OAM IP>:30205
164   curl -k http(s)://<OAM IP>:30205/o2ims_infrastructureInventory/v1
165
166
167 3 Register O-Cloud to SMO
168
169 - assumed you have setup SMO O2 endpoint for registration
170 - O2 service will post the O-Cloud registration data to that SMO O2 endpoint
171
172 ::
173
174   curl -k -X POST http(s)://<OAM IP>:30205/provision/smo-endpoint/v1 -d '{"smo-o2-endpoint": "<SMO O2 endpoint for registration>"}'
175
176
177 References
178 ----------
179
180 - `O-RAN-SC INF`_
181
182 .. _`O-RAN-SC INF`: https://docs.o-ran-sc.org/en/latest/projects.html#infrastructure-inf