Gradiant / 5g-charts

Helm charts for 5G Technologies
Apache License 2.0
110 stars 43 forks source link

GNB_IP is set to null leading to UERANSIM UE crash while deploying #116

Closed ragusv closed 1 year ago

ragusv commented 1 year ago

In the Values.yaml, there is no option to set the GNB_IP and this value is set to NULL and deployment of UE crashes with below error

GNB_IP: Launching ue: nr-ue -c ue.yaml UERANSIM v3.2.6 terminate called after throwing an instance of 'LibError' what(): Bad Inet address: null Invalid argument /entrypoint.sh: line 41: 15 Aborted (core dumped) nr-ue -c ue.yaml $@

As a workaround, if the GNB_IP is manually editted on the configMap and then restarting the POD makes it work, setting up the GNB_IP needs to be allowed in the values.yaml file, it is currently missing...

https://github.com/Gradiant/openverso-charts/blob/master/charts/ueransim-gnb/values.yaml

ues: enabled: false count: 1 initialMSISDN: '0000000001' key: 465B5CE8B199B49FAA5F0A2EE238A6BC op: E8ED289DEBA952E4283B54E88E6183CA opType: OPC apnList:

ragusv commented 1 year ago

Here in the ue.yaml file within the resources (this file is fetched while the UE configMap is created), it has a reference to the $GNB_IP for the gnbSearchList but there is no way to config this leading to UE POD crash during deployment

IMSI number of the UE. IMSI = [MCC|MNC|MSISDN] (In total 15 or 16 digits)

supi: 'imsi-{{ .Values.mcc }}{{ .Values.mnc }}{{ .Values.ues.initialMSISDN }}' mcc: '{{ .Values.mcc }}' mnc: '{{ .Values.mnc }}'

Permanent subscription key

key: '{{ .Values.ues.key }}'

Operator code (OP or OPC) of the UE

op: '{{ .Values.ues.op }}'

This value specifies the OP type and it can be either 'OP' or 'OPC'

opType: '{{ .Values.ues.opType }}'

Authentication Management Field (AMF) value

amf: '8000'

IMEI number of the device. It is used if no SUPI is provided

imei: '356938035643803'

IMEISV number of the device. It is used if no SUPI and IMEI is provided

imeiSv: '4370816125816151'

List of gNB IP addresses for Radio Link Simulation

gnbSearchList:

ragusv commented 1 year ago

Got to add as below in the ues config of values.yaml

gnb: hostname: ueransim-gnb

ues: enabled: false count: 1 initialMSISDN: '0000000001' key: 465B5CE8B199B49FAA5F0A2EE238A6BC op: E8ED289DEBA952E4283B54E88E6183CA gnb: hostname: ueransim-gnb opType: OPC

Also, there is an appropriate change needed in the templates "ues-deployment.yaml" file to fetch the GNB hostname from the values.yaml file

  containers:
    - name: ues
      image: {{ template "ueransim.image" . }}
      imagePullPolicy: {{ .Values.image.pullPolicy }}
      securityContext:
        privileged: true
        capabilities:
          add: ["NET_ADMIN"]
      env:
        - name: GNB_HOSTNAME
          value: {{ .Values.ues.gnb.hostname }}
cgiraldo commented 1 year ago

Sorry, but there is a missunderstanding here.

If you want to provide a GNB_IP or GNB_HOSTNAME to the ues, you have to use the ueransim-ues chart.

The expected behavior of ueransim-gnb with ues.enabled: true is the expected. ues are automatically configured to reach the gnb through the name of its kubernetes service (GNB_HOSTNAME). GNB_IP must be null, and the entrypoint.sh of openverso/ueransim image resolves the gnb service IP on runtime (https://github.com/Gradiant/openverso-images/blob/c723e45d45cc2e4d19454b0414c0941b05af63d8/images/ueransim/entrypoint.sh#L34).

ragusv commented 1 year ago

Hi Carlos,

Without providing the gnb.hostname in the values of the ueransim-gnb chart with ues.enabled: true, the UE POD crashes as it tries to fetch the GNB_IP and it is always blank, ue.yaml files in the resources folder makes a reference to gnbsearchlist is set to ${GNB_IP} and this goes in the k8s configMap as-is (there is no IP fetched whatsoever) and the POD gets killed with a core, there were 2 ways to get this working,

  1. Edit the k8s configMap specific to ueransim-gnb-ue --> replace ${GNB_IP} in the pod annotation with actual gnb IP and restart the ueransim-gnb-ue POD
  2. To make it an automated way, bring in the gnb.hostname under the ues container of the ueransim-gnb chart (values.yaml) and also make appropriate changes in the templates of ues-deployment of same chart
cgiraldo commented 1 year ago

Please, take a look to the entrypoint.sh of openverso/ueransim image.

The configMap content must be ${GNB_IP}, since the entrypoint.sh use envsubst and modify it with the content of the GNB_IP env variable. The GNB_IP env variable of the container is also created at runtime by the entrypoint.sh resolving the hostname vaule of GNB_HOSTNAME. The GNB_HOSTNAME env variable is configured in the ues-deployment.yaml template to be the kubernetes service name of the gnb.

If you want an advance configuration and manually set the GNB_HOSTNAME or the GNB_IP, please, run ueransim-gnb with ues.enabled: false and install ueransim-ues with the manual configuration you want.