Skip to content

Deploying OpenAirInterface Core and RAN in k8s

Angelo Feraudo edited this page Aug 30, 2024 · 15 revisions

Creating k8s namespaces

Create core namespace

kubectl create ns oai-core

kubectl create ns oai-ran

Deploying Core

Clone repository with helm charts:

# Chart definitions (k8s deployments)
git clone https://gitlab.eurecom.fr/oai/cn5g/oai-cn5g-fed 

Change branch

cd oai-cn5g-fed 

# Be sure to be in the master branch
git status

❗ Note: Core side the version used of each nfv is v2.0.1. However, this is useful for RAN side pods (UEs and gNB)

It will be good to configure an image pull secret to pull images from docker-hub because of the anonymous pull limit of 100 in docker-hub. This may cause some pods to remain in NOT READY state.

Screenshot 2024-08-14 153243

To configure docker-hub image pull secret:

kubectl create secret docker-registry regcred --docker-server=https://index.docker.io/v1/ --docker-username=<your-name> --docker-password=<your-pword> --docker-email=<your-email>`

Fetch missing dependencies

cd oai-cn5g-fed/charts/oai-5g-core/oai-5g-basic/
helm dependency update

Install charts

helm install basic oai-5g-basic/ -n oai-core

Check the logs smf and upf to see that the PFCP session is properly configured

kubectl logs -l app.kubernetes.io/name=oai-smf -n oai-core | grep 'handle_receive(16 bytes)' | wc -l
kubectl logs -l app.kubernetes.io/name=oai-upf -n oai-core | grep 'handle_receive(16 bytes)' | wc -l

If the value is more than 1 for both then it will verify that smf and upf have successfully registered to nrf and there is a PFCP session.

❗ Note: This tutorial is extracted from this oai tutorial.

Deploying RAN

❗ Note: We worked with this commit f1c08ed2 for the E2Agent

Deploying gNB Using a pre-built Image

We will use the charts provided by the previous repo, but we need to make some changes.

cd oai-cn5g-fed/charts/oai-5g-ran
nano oai-gnb/values.yaml
nfimage:   # image name either locally present or in a public/private repository
  # repository: docker.io/oaisoftwarealliance/oai-gnb
  # version: 2023.w49 # image tag or develop
  repository: angeloferaudo/oai-gnb-sim
  version: latest
  pullPolicy: IfNotPresent
#...

config:
  amfhost: "oai-amf.oai-core"
  #...

You can find the values.yaml file with the needed changes here.

Now, we can deploy the gNB in minikube using helm

helm install gnb oai-gnb --namespace oai-ran

To test that the gNB is correctly connected to the amf run the following command

kubectl logs --namespace oai-core $(kubectl get pods --namespace oai-core | grep oai-amf| awk '{print $1}') | grep 'Connected'

You should have an output like the following

[2024-08-19 13:55:42.274] [amf_app] [info] |      1      |    Connected     |        0xe000        |       oai-gnb-rfsim           |               001, 01              |

Deploying gNB using a custom image

Deploying UE

Go to the directory containing the charts for RAN deployments

cd oai-cn5g-fed/charts/oai-5g-ran

Change the charts to use the develop version of the nrue image

nfimage:
  repository: docker.io/oaisoftwarealliance/oai-nr-ue           # dockehub oaisoftwarealliance/oai-nr-ue
  version: develop # image tag or develop
  # pullPolicy: IfNotPresent or Never or Always
  pullPolicy: IfNotPresent

#...
# Comment also the following line
config:
#  sd: "16777215"
# ...

The values.yaml file can be found here.

Now, you can deploy the UE using helm

helm install nrue oai-nr-ue/ -n oai-ran

To verify that the UE received an IP address run

kubectl exec -it -n oai-ran -c nr-ue $(kubectl get pods -n oai-ran | grep oai-nr-ue | awk '{print $1}') -- ifconfig oaitun_ue1 |grep -E '(^|\s)inet($|\s)' | awk {'print $2'}

Clone this wiki locally