diff --git a/charts/oai-5g-core/mysql/templates/deployment.yaml b/charts/oai-5g-core/mysql/templates/deployment.yaml index 84f7406b0c7f139a3e841ade57fc6ddda321cf02..543e4012058f9da05eaa3213278aace7e36831c8 100644 --- a/charts/oai-5g-core/mysql/templates/deployment.yaml +++ b/charts/oai-5g-core/mysql/templates/deployment.yaml @@ -12,8 +12,8 @@ metadata: annotations: {{ toYaml . | indent 4 }} {{- end }} - spec: + replicas: {{ .Values.replicas }} strategy: {{ toYaml .Values.strategy | indent 4 }} selector: diff --git a/charts/oai-5g-core/mysql/values.yaml b/charts/oai-5g-core/mysql/values.yaml index 26d89046aecff61f58b9837d4589d2949605a46d..0624268ced27f908c0de16996e8d4b9d7bec0570 100644 --- a/charts/oai-5g-core/mysql/values.yaml +++ b/charts/oai-5g-core/mysql/values.yaml @@ -2,7 +2,9 @@ ## ref: https://hub.docker.com/r/library/mysql/tags/ ## image: "docker.io/mysql" -imageTag: "8.0" +imageTag: "5.7" + +replicas: 1 strategy: type: Recreate @@ -97,7 +99,7 @@ livenessProbe: failureThreshold: 3 readinessProbe: - initialDelaySeconds: 15 + initialDelaySeconds: 10 periodSeconds: 15 timeoutSeconds: 5 successThreshold: 1 diff --git a/charts/oai-5g-core/oai-5g-basic/Chart.yaml b/charts/oai-5g-core/oai-5g-basic/Chart.yaml index 8b41858afcd9725c1725543cd0906911c14bcf31..2dffc57b6bec0b9d61d4f69c8ced3a18ffec3323 100644 --- a/charts/oai-5g-core/oai-5g-basic/Chart.yaml +++ b/charts/oai-5g-core/oai-5g-basic/Chart.yaml @@ -2,10 +2,10 @@ apiVersion: v2 name: oai-5g-basic type: application icon: http://www.openairinterface.org/wp-content/uploads/2015/06/cropped-oai_final_logo.png -version: v1.5.0 +version: v1.5.1 description: OAI 5G Release 16 Core Network -appVersion: master-v1.5.0 +appVersion: develop-v1.5.1 keywords: - 5GCN @@ -16,6 +16,7 @@ keywords: - UDM - UDR - AUSF +# - Traffic_server maintainers: - name: OPENAIRINTERFACE @@ -29,28 +30,33 @@ dependencies: - condition: oai-nrf.enabled name: oai-nrf repository: "file://../oai-nrf" - version: v1.5.0 + version: v1.5.1 - condition: oai-udr.enabled name: oai-udr repository: "file://../oai-udr" - version: v1.5.0 + version: v1.5.1 - condition: oai-udm.enabled name: oai-udm repository: "file://../oai-udm" - version: v1.5.0 + version: v1.5.1 - condition: oai-ausf.enabled name: oai-ausf repository: "file://../oai-ausf" - version: v1.5.0 + version: v1.5.1 - condition: oai-amf.enabled name: oai-amf repository: "file://../oai-amf" - version: v1.5.0 + version: v1.5.1 - condition: oai-smf.enabled name: oai-smf repository: "file://../oai-smf" - version: v1.5.0 + version: v1.5.1 - condition: oai-spgwu-tiny.enabled name: oai-spgwu-tiny repository: "file://../oai-spgwu-tiny" - version: v1.5.0 + version: v1.5.1 +#- condition: oai-traffic-server.enabled +# name: oai-traffic-server +# repository: "file://../oai-traffic-server" +# version: v1 + diff --git a/charts/oai-5g-core/oai-5g-basic/README.md b/charts/oai-5g-core/oai-5g-basic/README.md new file mode 100644 index 0000000000000000000000000000000000000000..cf86a30302c0d3da1b21d5c705f2fbdbf23edddf --- /dev/null +++ b/charts/oai-5g-core/oai-5g-basic/README.md @@ -0,0 +1,36 @@ +# Parent Helm Charts for Deploying Basic OAI-5G Core Network + +Basic deployment contains + +1. OAI-AMF +2. OAI-SMF +3. OAI-NRF +4. OAI-UDR +5. OAI-AUSF +6. OAI-UDM +7. OAI-SPGWU-TINY +8. MYSQL (Subscriber database) + +To change the configuration of any core network component you can use `values.yaml`. To change the parameters which are missing from `values.yaml` you can change them in the helm-chart of the respective network function. + +If the gNB is in a different cluster or different subnet than pod subnet. Then you need to make sure AMF and SPGWU/UPF is reachable from the gNB host machine. You can use AMF and SPGWU/UPF multus interface. In SPGWU/UPF `n3Interface` should be able to reach gNB host machine/pod/container. + +Once you are sure with the configuration parameters you can deploy these charts following the below steps. + +1. Make sure you have [helm-spray plugin](https://github.com/ThalesGroup/helm-spray) if you don't then you can download like this + +```bash +helm plugin install https://github.com/ThalesGroup/helm-spray +``` + +2. Perform a dependency update whenever you change anything in the sub-charts or if you have recently clone the repository. + +```bash +helm dependency update +``` + +3. Deploy the helm-charts + +``` +helm spray . +``` \ No newline at end of file diff --git a/charts/oai-5g-core/oai-5g-basic/values.yaml b/charts/oai-5g-core/oai-5g-basic/values.yaml index db8c8fbffac01a43151bb039b2537562bc656b32..afe20533f87e6e0e8758244fbce3972cf6101eaa 100644 --- a/charts/oai-5g-core/oai-5g-basic/values.yaml +++ b/charts/oai-5g-core/oai-5g-basic/values.yaml @@ -13,11 +13,14 @@ oai-nrf: kubernetesType: Vanilla #Openshift/Vanilla Vanilla for Upstream Kubernetes nfimage: # image name either locally present or in a public/private repository repository: docker.io/oaisoftwarealliance/oai-nrf ## The image will be pulled from dockerhub - version: v1.5.0 ## The branch to be used to pull from dockerhub + version: v1.5.1 ## The branch to be used to pull from dockerhub # pullPolicy: IfNotPresent or Never or Always pullPolicy: IfNotPresent + includeTcpDumpContainer: false #only for taking pcaps inside network function pod imagePullSecrets: - name: "regcred" + config: + logLevel: "debug" #allowed info/error/debug nodeSelector: {} oai-udr: enabled: true @@ -25,11 +28,14 @@ oai-udr: kubernetesType: Vanilla #Openshift/Vanilla Vanilla for Upstream Kubernetes nfimage: # image name either locally present or in a public/private repository repository: docker.io/oaisoftwarealliance/oai-udr ## The image will be pulled from dockerhub - version: v1.5.0 ## The branch to be used to pull from dockerhub + version: v1.5.1 ## The branch to be used to pull from dockerhub # pullPolicy: IfNotPresent or Never or Always pullPolicy: IfNotPresent + includeTcpDumpContainer: false #only for taking pcaps inside network function pod imagePullSecrets: - name: "regcred" + config: + logLevel: "debug" #allowed info/error/debug nodeSelector: {} oai-udm: enabled: true @@ -37,11 +43,14 @@ oai-udm: kubernetesType: Vanilla #Openshift/Vanilla Vanilla for Upstream Kubernetes nfimage: # image name either locally present or in a public/private repository repository: docker.io/oaisoftwarealliance/oai-udm ## The image will be pulled from dockerhub - version: v1.5.0 ## The branch to be used to pull from dockerhub + version: v1.5.1 ## The branch to be used to pull from dockerhub # pullPolicy: IfNotPresent or Never or Always pullPolicy: IfNotPresent + includeTcpDumpContainer: false #only for taking pcaps inside network function pod imagePullSecrets: - name: "regcred" + config: + logLevel: "debug" #allowed info/error/debug nodeSelector: {} oai-ausf: enabled: true @@ -49,11 +58,14 @@ oai-ausf: kubernetesType: Vanilla #Openshift/Vanilla Vanilla for Upstream Kubernetes nfimage: # image name either locally present or in a public/private repository repository: docker.io/oaisoftwarealliance/oai-ausf ## The image will be pulled from dockerhub - version: v1.5.0 ## The branch to be used to pull from dockerhub + version: v1.5.1 ## The branch to be used to pull from dockerhub # pullPolicy: IfNotPresent or Never or Always pullPolicy: IfNotPresent + includeTcpDumpContainer: false #only for taking pcaps inside network function pod imagePullSecrets: - name: "regcred" + config: + logLevel: "debug" #allowed info/error/debug nodeSelector: {} oai-amf: enabled: true @@ -61,35 +73,42 @@ oai-amf: kubernetesType: Vanilla #Openshift/Vanilla Vanilla for Upstream Kubernetes nfimage: # image name either locally present or in a public/private repository repository: docker.io/oaisoftwarealliance/oai-amf ## The image will be pulled from dockerhub - version: v1.5.0 ## The branch to be used to pull from dockerhub + version: v1.5.1 ## The branch to be used to pull from dockerhub # pullPolicy: IfNotPresent or Never or Always pullPolicy: IfNotPresent + includeTcpDumpContainer: false #only for taking pcaps inside network function pod imagePullSecrets: - name: "regcred" multus: - create: false - n1IPadd: "172.21.6.200" - n1Netmask: "22" - n1Gateway: "172.21.7.254" - hostInterface: "bond0" # Interface of the host machine on which this pod will be scheduled + ## If you don't want to add a default route in your pod then leave this field empty + defaultGateway: "172.21.7.254" + n2Interface: + create: false + Ipadd: "172.21.6.94" + Netmask: "22" + ## If you do not have a gateway leave the field empty + Gateway: + ## If you do not want to add any routes in your pod then leave this field empty + routes: [{'dst': '10.8.0.0/24','gw': '172.21.7.254'}] + hostInterface: "bond0" # Interface of the host machine on which this pod will be scheduled config: - amfInterfaceNameForNGAP: "eth0" # If multus creation is true then net1 else eth0 - amfInterfaceNameForN11: "eth0" # Service based interface + amfInterfaceNameForNGAP: "eth0" # If oai-amf.multus.n2Interface.create is true then n2 else eth0 + amfInterfaceNameForSBI: "eth0" # Service based interface externalAusf: "yes" + logLevel: "debug" #allowed info/error/debug # Mandatory - sst0: "1" - sd0: "0xFFFFFF" - # Optional upto 4 slices can be define using below template + sst0: "1" ## 1 slice/SST is mandatory + sd0: "0xFFFFFF" ## Optional 0xFFFFFF means no SD as per 3GPP + ## Can add upto 3 more slices. More than that you can do it in the configmap of amf templates/configmap.yaml + # Note only SST is mandatory for a slice SD is optional sst1: "1" sd1: "1" - mcc: "001" - mnc: "01" tac: "0x0001" nfRegistration: "yes" smfSelection: "no" #Bug in SMF can not have SMF selection when using UDR to fetch user-information useHttp2: "no" intAlgoList: '[ "NIA1" , "NIA1" , "NIA2" ]' - ciphAlgoList: '[ "NEA1" , "NEA1" , "NEA2" ]' + ciphAlgoList: '[ "NEA0" , "NEA1" , "NEA2" ]' nodeSelector: {} oai-spgwu-tiny: enabled: true @@ -97,25 +116,54 @@ oai-spgwu-tiny: kubernetesType: Vanilla #Openshift/Vanilla Vanilla for Upstream Kubernetes nfimage: # image name either locally present or in a public/private repository repository: docker.io/oaisoftwarealliance/oai-spgwu-tiny ## The image will be pulled from dockerhub - version: v1.5.0 ## The branch to be used to pull from dockerhub + version: v1.5.1 ## The branch to be used to pull from dockerhub # pullPolicy: IfNotPresent or Never or Always pullPolicy: IfNotPresent + includeTcpDumpContainer: false #only for taking pcaps inside network function pod imagePullSecrets: - name: "regcred" + # create an extra interface for N3 incase the gNB is outside the cluster network or there is a need to have dedicated interface for N3 + ## Change these ip-addresses according to your environment + ## N4, N6 are optional only if you want that UPF uses different subnets for different 3gpp interfaces. multus: - create: false - n3Ip: "172.21.6.201" - n3Netmask: "22" - n6Gw: "172.21.7.254" - hostInterface: "bond0" + defaultGateway: "172.21.7.254" + n3Interface: + create: false + Ipadd: "172.21.6.95" + Netmask: "22" + ## If you do not have a gateway leave the field empty + Gateway: "172.21.7.254" + ## If you do not want to add any routes in your pod then leave this field empty + routes: [{'dst': '10.8.0.0/24','gw': '172.21.7.254'}, {'dst': '10.9.0.0/24','gw': '172.21.7.254'}] + hostInterface: "bond0" + n4Interface: + create: false + Ipadd: "172.21.16.89" + Netmask: "22" + ## If you do not have a gateway leave the field empty + Gateway: "172.21.19.254" + ## If you do not want to add any routes in your pod then leave this field empty + routes: + hostInterface: "bond1" + n6Interface: + create: false + Ipadd: "172.21.8.80" + Netmask: "22" + ## If you do not have a gateway leave the field empty + Gateway: "172.21.11.254" + ## If you do not want to add any routes in your pod then leave this field empty + routes: + hostInterface: "bond2" + #NOTE: If the interface you selected for n6If is wrong then traffic will not be routed towards internet config: - n3If: "eth0" # net1 if gNB is outside the cluster network and multus creation is true else eth0 - n4If: "eth0" # use for SMF communication - n6If: "eth0" # net1 if gNB is outside the cluster network and multus creation is true else eth0 (important because it sends the traffic towards internet) + n3If: "eth0" # n3 if multus.n3Interface.create is true + n4If: "eth0" # n4 if multus.n4Interface.create is true + n6If: "eth0" # n6 multus.n6Interface.create is true + logLevel: "info" #allowed info/error/debug threadsN3Ul: "1" threadsN6Dl: "1" - threadsN6Prio: 98 - threadsN3Prio: 88 + threadsN6Prio: 99 + threadsN3Prio: 98 threadsN4Prio: 88 netUeIp: "12.1.1.0/24" # The range in which UE ip-address will be allocated should be configured the same in SMF registerNRF: "yes" @@ -129,23 +177,52 @@ oai-spgwu-tiny: nssaiSd1: "0xFFFFFF" # should match with SMF information (Optional, if removed sd value will be 0xFFFFFF only if nssaiSst1 is configured) dnn1: "ims" # should match with SMF information nodeSelector: {} +#oai-traffic-server: +# enabled: false +# weight: 6 +# kubernetesType: Vanilla +# trafficServer: +# repository: docker.io/oaisoftwarealliance/trf-gen-cn5g +# version: latest +# #pullPolicy: IfNotPresent or Never or Always +# pullPolicy: IfNotPresent +# #Without multus traffic server won't be able to forward packets to spgwu if can't use server then add an extra container in spgwu with iperf3 or install iperf3 package in tcpdump container +# multus: +# create: true +# IPadd: "172.21.6.99" +# Netmask: "22" +# defaultGateway: "172.21.7.254" +# hostInterface: "bond0" # Interface of the host machine on which this pod will be scheduled +# config: +# ueroute: 12.1.1.0/24 +# upfIpadd: 172.21.6.95 +# noOfIperf3Server: 10 oai-smf: enabled: true weight: 6 kubernetesType: Vanilla #Openshift/Vanilla Vanilla for Upstream Kubernetes nfimage: # image name either locally present or in a public/private repository repository: docker.io/oaisoftwarealliance/oai-smf ## The image will be pulled from dockerhub - version: v1.5.0 ## The branch to be used to pull from dockerhub + version: v1.5.1 ## The branch to be used to pull from dockerhub # pullPolicy: IfNotPresent or Never or Always pullPolicy: IfNotPresent + includeTcpDumpContainer: false #only for taking pcaps inside network function pod + multus: + create: false + n4IPadd: "172.21.6.98" + n4Netmask: "22" + ## If you don't have a gateway leave the field empty or commented + defaultGateway: "172.21.7.254" + hostInterface: "bond0" # Interface of the host machine on which this pod will be scheduled imagePullSecrets: - name: "regcred" config: useLocalSubscriptionInfo: "no" #this means ip-address information will be fetched from UDR ueMtu: 1500 + logLevel: "debug" #allowed info/error/debug dnsIpv4Address: "172.21.3.100" # configure the dns for UE don't use Kubernetes DNS dnsSecIpv4Address: "172.21.3.100" # configure the dns for UE don't use Kubernetes DNS - defaultCSCFIpv4Address: "172.21.6.13" # For IMS server if needed + defaultCSCFIpv4Address: "172.21.6.96" # For IMS server if needed discoverUpf: "yes" # if NRF is used then it can be used for UPF discovery # You can define maximum 4 slices from here in case of more please change the configuration file. dnnNi0: "oai" diff --git a/charts/oai-5g-core/oai-5g-mini/Chart.yaml b/charts/oai-5g-core/oai-5g-mini/Chart.yaml index 728651a14e13ad3a763eff1cc12603c657634c4b..99fe6735a253ea2287467792aa6fc8198dafc400 100644 --- a/charts/oai-5g-core/oai-5g-mini/Chart.yaml +++ b/charts/oai-5g-core/oai-5g-mini/Chart.yaml @@ -2,10 +2,10 @@ apiVersion: v2 name: oai-5g-mini type: application icon: http://www.openairinterface.org/wp-content/uploads/2015/06/cropped-oai_final_logo.png -version: v1.5.0 +version: v1.5.1 description: OAI 5G Release 16 Core Network -appVersion: master-v1.5.0 +appVersion: develop-v1.5.1 keywords: - 5GCN @@ -26,16 +26,16 @@ dependencies: - condition: oai-nrf.enabled name: oai-nrf repository: "file://../oai-nrf" - version: v1.5.0 + version: v1.5.1 - condition: oai-amf.enabled name: oai-amf repository: "file://../oai-amf" - version: v1.5.0 + version: v1.5.1 - condition: oai-smf.enabled name: oai-smf repository: "file://../oai-smf" - version: v1.5.0 + version: v1.5.1 - condition: oai-spgwu-tiny.enabled name: oai-spgwu-tiny repository: "file://../oai-spgwu-tiny" - version: v1.5.0 + version: v1.5.1 \ No newline at end of file diff --git a/charts/oai-5g-core/oai-5g-mini/README.md b/charts/oai-5g-core/oai-5g-mini/README.md new file mode 100644 index 0000000000000000000000000000000000000000..718e2f81e299449623cf587e75cc82c2b4bbacc6 --- /dev/null +++ b/charts/oai-5g-core/oai-5g-mini/README.md @@ -0,0 +1,33 @@ +# Parent Helm Charts for Deploying Mini OAI-5G Core Network + +Mini deployment contains + +1. OAI-AMF +2. OAI-SMF +3. OAI-NRF +4. OAI-SPGWU-TINY +5. MYSQL (Subscriber database) + +To change the configuration of any core network component you can use `values.yaml`. To change the parameters which are missing from `values.yaml` you can change them in the helm-chart of the respective network function. + +If the gNB is in a different cluster or different subnet than pod subnet. Then you need to make sure AMF and SPGWU/UPF is reachable from the gNB host machine. You can use AMF and SPGWU/UPF multus interface. In SPGWU/UPF `n3Interface` should be able to reach gNB host machine/pod/container. + +Once you are sure with the configuration parameters you can deploy these charts following the below steps. + +1. Make sure you have [helm-spray plugin](https://github.com/ThalesGroup/helm-spray) if you don't then you can download like this + +```bash +helm plugin install https://github.com/ThalesGroup/helm-spray +``` + +2. Perform a dependency update whenever you change anything in the sub-charts or if you have recently clone the repository. + +```bash +helm dependency update +``` + +3. Deploy the helm-charts + +``` +helm spray . +``` \ No newline at end of file diff --git a/charts/oai-5g-core/oai-5g-mini/values.yaml b/charts/oai-5g-core/oai-5g-mini/values.yaml index a69b1b90982cade12526c7e3b0bffd98cf56a6fd..e39da794b29c68d52bba7067737f1ef3e9cd8ba8 100644 --- a/charts/oai-5g-core/oai-5g-mini/values.yaml +++ b/charts/oai-5g-core/oai-5g-mini/values.yaml @@ -13,11 +13,14 @@ oai-nrf: kubernetesType: Vanilla #Openshift/Vanilla Vanilla for Upstream Kubernetes nfimage: # image name either locally present or in a public/private repository repository: docker.io/oaisoftwarealliance/oai-nrf ## The image will be pulled from dockerhub - version: v1.5.0 ## The branch to be used to pull from dockerhub + version: v1.5.1 ## The branch to be used to pull from dockerhub # pullPolicy: IfNotPresent or Never or Always pullPolicy: IfNotPresent + includeTcpDumpContainer: false #only for taking pcaps inside network function pod imagePullSecrets: - name: "regcred" + config: + logLevel: "debug" #allowed info/error/debug nodeSelector: {} oai-amf: enabled: true @@ -25,24 +28,34 @@ oai-amf: kubernetesType: Vanilla #Openshift/Vanilla Vanilla for Upstream Kubernetes nfimage: # image name either locally present or in a public/private repository repository: docker.io/oaisoftwarealliance/oai-amf ## The image will be pulled from dockerhub - version: v1.5.0 ## The branch to be used to pull from dockerhub + version: v1.5.1 ## The branch to be used to pull from dockerhub # pullPolicy: IfNotPresent or Never or Always pullPolicy: IfNotPresent + includeTcpDumpContainer: false #only for taking pcaps inside network function pod imagePullSecrets: - name: "regcred" nodeSelector: {} multus: - create: false - n1IPadd: "172.21.6.201" - n1Netmask: "22" - n1Gateway: "172.21.7.254" - hostInterface: "bond0" # Interface of the host machine on which this pod will be scheduled + ## If you don't want to add a default route in your pod then leave this field empty + defaultGateway: "172.21.7.254" + n2Interface: + create: false + Ipadd: "172.21.6.94" + Netmask: "22" + ## If you do not have a gateway leave the field empty + Gateway: + ## If you do not want to add any routes in your pod then leave this field empty + routes: [{'dst': '10.8.0.0/24','gw': '172.21.7.254'}] + hostInterface: "bond0" # Interface of the host machine on which this pod will be scheduled config: - amfInterfaceNameForNGAP: "eth0" # If multus creation is true then net1 else eth0 - amfInterfaceNameForN11: "eth0" # Service based interface + amfInterfaceNameForNGAP: "eth0" # If oai-amf.multus.n2Interface.create is true then n2 else eth0 + amfInterfaceNameForSBI: "eth0" # Service based interface externalAusf: "no" - sst0: "1" - sd0: "0xFFFFFF" + logLevel: "debug" #allowed info/error/debug + sst0: "1" ## 1 slice/SST is mandatory + sd0: "0xFFFFFF" ## Optional 0xFFFFFF means no SD as per 3GPP + ## Can add upto 3 more slices. More than that you can do it in the configmap of amf templates/configmap.yaml + # Note only SST is mandatory for a slice SD is optional sst1: "1" sd1: "1" mcc: "001" @@ -52,7 +65,7 @@ oai-amf: smfSelection: "yes" useHttp2: "no" intAlgoList: '[ "NIA1" , "NIA1" , "NIA2" ]' - ciphAlgoList: '[ "NEA1" , "NEA1" , "NEA2" ]' + ciphAlgoList: '[ "NEA0" , "NEA1" , "NEA2" ]' mySqlServer: "mysql" mySqlUser: "root" mySqlPass: "linux" @@ -63,28 +76,57 @@ oai-spgwu-tiny: kubernetesType: Vanilla #Openshift/Vanilla Vanilla for Upstream Kubernetes nfimage: # image name either locally present or in a public/private repository repository: docker.io/oaisoftwarealliance/oai-spgwu-tiny ## The image will be pulled from dockerhub - version: v1.5.0 ## The branch to be used to pull from dockerhub + version: v1.5.1 ## The branch to be used to pull from dockerhub # pullPolicy: IfNotPresent or Never or Always pullPolicy: IfNotPresent + includeTcpDumpContainer: false #only for taking pcaps inside network function pod imagePullSecrets: - name: "regcred" nodeSelector: {} + # create an extra interface for N3 incase the gNB is outside the cluster network or there is a need to have dedicated interface for N3 + ## Change these ip-addresses according to your environment + ## N4, N6 are optional only if you want that UPF uses different subnets for different 3gpp interfaces. multus: - create: false - n3Ip: "172.21.6.200" - n3Netmask: "22" - n6Gw: "172.21.7.254" - hostInterface: "bond0" + defaultGateway: "172.21.7.254" + n3Interface: + create: false + Ipadd: "172.21.6.95" + Netmask: "22" + ## If you do not have a gateway leave the field empty + Gateway: "172.21.7.254" + ## If you do not want to add any routes in your pod then leave this field empty + routes: [{'dst': '10.8.0.0/24','gw': '172.21.7.254'}, {'dst': '10.9.0.0/24','gw': '172.21.7.254'}] + hostInterface: "bond0" + n4Interface: + create: false + Ipadd: "172.21.16.89" + Netmask: "22" + ## If you do not have a gateway leave the field empty + Gateway: "172.21.19.254" + ## If you do not want to add any routes in your pod then leave this field empty + routes: + hostInterface: "bond1" + n6Interface: + create: false + Ipadd: "172.21.8.80" + Netmask: "22" + ## If you do not have a gateway leave the field empty + Gateway: "172.21.11.254" + ## If you do not want to add any routes in your pod then leave this field empty + routes: + hostInterface: "bond2" + #NOTE: If the interface you selected for n6If is wrong then traffic will not be routed towards internet config: - n3If: "eth0" # net1 if gNB is outside the cluster network and multus creation is true else eth0 - n4If: "eth0" # use for SMF communication - n6If: "eth0" # net1 if gNB is outside the cluster network and multus creation is true else eth0 (important because it sends the traffic towards internet) + n3If: "eth0" # n3 if multus.n3Interface.create is true + n4If: "eth0" # n4 if multus.n4Interface.create is true + n6If: "eth0" # n6 multus.n6Interface.create is true threadsN3Ul: "1" threadsN6Dl: "1" - threadsN6Prio: 98 - threadsN3Prio: 88 + threadsN6Prio: 99 + threadsN3Prio: 98 threadsN4Prio: 88 netUeIp: "12.1.1.0/24" # The range in which UE ip-address will be allocated should be configured the same in SMF + logLevel: "info" #allowed info/error/debug registerNRF: "yes" nrfFqdn: "oai-nrf-svc" # make sure this can be resolved by container dns #Mandatory to configure atlease one slice @@ -101,9 +143,19 @@ oai-smf: kubernetesType: Vanilla #Openshift/Vanilla Vanilla for Upstream Kubernetes nfimage: # image name either locally present or in a public/private repository repository: docker.io/oaisoftwarealliance/oai-smf ## The image will be pulled from dockerhub - version: v1.5.0 ## The branch to be used to pull from dockerhub + version: v1.5.1 ## The branch to be used to pull from dockerhub # pullPolicy: IfNotPresent or Never or Always pullPolicy: IfNotPresent + multus: + create: false + n4IPadd: "172.21.6.98" + n4Netmask: "22" + ## If you don't want to add a gateway in your pod then leave this field empty + gateway: 172.21.7.254 + ## If you don't want to add a default route in your pod then leave this field empty + defaultGateway: "172.21.7.254" + hostInterface: "bond0" # Interface of the host machine on which this pod will be scheduled + includeTcpDumpContainer: false #only for taking pcaps inside network function pod imagePullSecrets: - name: "regcred" nodeSelector: {} @@ -113,6 +165,7 @@ oai-smf: dnsSecIpv4Address: "172.21.3.100" # configure the dns for UE don't use Kubernetes DNS defaultCSCFIpv4Address: "172.21.6.13" # For IMS server if needed discoverUpf: "yes" # if NRF is used then it can be used for UPF discovery + logLevel: "debug" #allowed info/error/debug # You can define maximum 4 slices from here in case of more please change the configuration file. dnnNi0: "oai" pdusessiontype0: "IPv4" diff --git a/charts/oai-5g-core/oai-5g-slicing/Chart.yaml b/charts/oai-5g-core/oai-5g-slicing/Chart.yaml index e11fd9958521a6a8f8adfe461b441f2e988f9299..1032e4d456f7ced993495377772bd8999be6cf5b 100644 --- a/charts/oai-5g-core/oai-5g-slicing/Chart.yaml +++ b/charts/oai-5g-core/oai-5g-slicing/Chart.yaml @@ -1,14 +1,11 @@ apiVersion: v2 name: oai-5g-slicing -appVersion: master-v1.4.0 +version: v1.5.1 +appVersion: develop-v1.5.1 icon: http://www.openairinterface.org/wp-content/uploads/2015/06/cropped-oai_final_logo.png description: OAI 5G Release 16 Core Network type: application -version: v1.4.0 - -appVersion: v1.4.0 - keywords: - 5GCN - SLICING @@ -34,32 +31,32 @@ dependencies: - condition: oai-nssf.enabled name: oai-nssf repository: "file://../oai-nssf" - version: v1.4.0 + version: v1.5.1 - condition: oai-nrf.enabled name: oai-nrf repository: "file://../oai-nrf" - version: v1.4.0 + version: v1.5.1 - condition: oai-udr.enabled name: oai-udr repository: "file://../oai-udr" - version: v1.4.0 + version: v1.5.1 - condition: oai-udm.enabled name: oai-udm repository: "file://../oai-udm" - version: v1.4.0 + version: v1.5.1 - condition: oai-ausf.enabled name: oai-ausf repository: "file://../oai-ausf" - version: v1.4.0 + version: v1.5.1 - condition: oai-amf.enabled name: oai-amf repository: "file://../oai-amf" - version: v1.4.0 + version: v1.5.1 - condition: oai-smf.enabled name: oai-smf repository: "file://../oai-smf" - version: v1.4.0 + version: v1.5.1 - condition: oai-spgwu-tiny.enabled name: oai-spgwu-tiny repository: "file://../oai-spgwu-tiny" - version: v1.4.0 + version: v1.5.1 diff --git a/charts/oai-5g-core/oai-5g-slicing/README.md b/charts/oai-5g-core/oai-5g-slicing/README.md new file mode 100644 index 0000000000000000000000000000000000000000..bfcf56a6321a7c796def9de06a270384ff7532f8 --- /dev/null +++ b/charts/oai-5g-core/oai-5g-slicing/README.md @@ -0,0 +1,37 @@ +# Parent Helm Charts for Deploying Slicing OAI-5G Core Network (Includes NSSF) + +Slicing deployment contains + +1. OAI-AMF +2. OAI-SMF +3. OAI-NRF +4. OAI-UDR +5. OAI-AUSF +6. OAI-UDM +7. OAI-NSSF +8. OAI-SPGWU-TINY +9. MYSQL (Subscriber database) + +To change the configuration of any core network component you can use `values.yaml`. To change the parameters which are missing from `values.yaml` you can change them in the helm-chart of the respective network function. + +Once you are sure with the configuration parameters you can deploy these charts following the below steps. + +You can read this [tutorial](../../../docs/DEPLOY_SA5G_SLICING.md) on how to use NSSF with multiple instances of SMF/UPF but it is for docker-compose + +1. Make sure you have [helm-spray plugin](https://github.com/ThalesGroup/helm-spray) if you don't then you can download like this + +```bash +helm plugin install https://github.com/ThalesGroup/helm-spray +``` + +2. Perform a dependency update whenever you change anything in the sub-charts or if you have recently clone the repository. + +```bash +helm dependency update +``` + +3. Deploy the helm-charts + +``` +helm spray . +``` \ No newline at end of file diff --git a/charts/oai-5g-core/oai-5g-slicing/values.yaml b/charts/oai-5g-core/oai-5g-slicing/values.yaml index 4d4a4e0a1ab9e351856e7ea7b352999d5f8acaa2..c34d55b5879a5a96f525f1b1fb3a7eb014e7148d 100644 --- a/charts/oai-5g-core/oai-5g-slicing/values.yaml +++ b/charts/oai-5g-core/oai-5g-slicing/values.yaml @@ -13,11 +13,14 @@ oai-nssf: kubernetesType: Vanilla #Openshift/Vanilla Vanilla for Upstream Kubernetes nfimage: # image name either locally present or in a public/private repository repository: docker.io/oaisoftwarealliance/oai-nssf ## The image will be pulled from dockerhub - version: v1.5.0 ## The branch to be used to pull from dockerhub + version: v1.5.1 ## The branch to be used to pull from dockerhub # pullPolicy: IfNotPresent or Never or Always pullPolicy: IfNotPresent imagePullSecrets: - name: "regcred" + includeTcpDumpContainer: false #only for taking pcaps inside network function pod + config: + logLevel: "debug" #allowed info/error/debug nodeSelector: {} oai-nrf: enabled: true @@ -25,11 +28,14 @@ oai-nrf: kubernetesType: Vanilla #Openshift/Vanilla Vanilla for Upstream Kubernetes nfimage: # image name either locally present or in a public/private repository repository: docker.io/oaisoftwarealliance/oai-nrf ## The image will be pulled from dockerhub - version: v1.5.0 ## The branch to be used to pull from dockerhub + version: v1.5.1 ## The branch to be used to pull from dockerhub # pullPolicy: IfNotPresent or Never or Always pullPolicy: IfNotPresent + includeTcpDumpContainer: false #only for taking pcaps inside network function pod imagePullSecrets: - name: "regcred" + config: + logLevel: "debug" #allowed info/error/debug nodeSelector: {} oai-udr: enabled: true @@ -37,11 +43,14 @@ oai-udr: kubernetesType: Vanilla #Openshift/Vanilla Vanilla for Upstream Kubernetes nfimage: # image name either locally present or in a public/private repository repository: docker.io/oaisoftwarealliance/oai-udr ## The image will be pulled from dockerhub - version: v1.5.0 ## The branch to be used to pull from dockerhub + version: v1.5.1 ## The branch to be used to pull from dockerhub # pullPolicy: IfNotPresent or Never or Always pullPolicy: IfNotPresent + includeTcpDumpContainer: false #only for taking pcaps inside network function pod imagePullSecrets: - name: "regcred" + config: + logLevel: "debug" #allowed info/error/debug nodeSelector: {} oai-udm: enabled: true @@ -49,11 +58,14 @@ oai-udm: kubernetesType: Vanilla #Openshift/Vanilla Vanilla for Upstream Kubernetes nfimage: # image name either locally present or in a public/private repository repository: docker.io/oaisoftwarealliance/oai-udm ## The image will be pulled from dockerhub - version: v1.5.0 ## The branch to be used to pull from dockerhub + version: v1.5.1 ## The branch to be used to pull from dockerhub # pullPolicy: IfNotPresent or Never or Always pullPolicy: IfNotPresent + includeTcpDumpContainer: false #only for taking pcaps inside network function pod imagePullSecrets: - name: "regcred" + config: + logLevel: "debug" #allowed info/error/debug nodeSelector: {} oai-ausf: enabled: true @@ -61,11 +73,14 @@ oai-ausf: kubernetesType: Vanilla #Openshift/Vanilla Vanilla for Upstream Kubernetes nfimage: # image name either locally present or in a public/private repository repository: docker.io/oaisoftwarealliance/oai-ausf ## The image will be pulled from dockerhub - version: v1.5.0 ## The branch to be used to pull from dockerhub + version: v1.5.1 ## The branch to be used to pull from dockerhub # pullPolicy: IfNotPresent or Never or Always pullPolicy: IfNotPresent + includeTcpDumpContainer: false #only for taking pcaps inside network function pod imagePullSecrets: - name: "regcred" + config: + logLevel: "debug" #allowed info/error/debug nodeSelector: {} oai-amf: enabled: true @@ -73,20 +88,27 @@ oai-amf: kubernetesType: Vanilla #Openshift/Vanilla Vanilla for Upstream Kubernetes nfimage: # image name either locally present or in a public/private repository repository: docker.io/oaisoftwarealliance/oai-amf ## The image will be pulled from dockerhub - version: v1.5.0 ## The branch to be used to pull from dockerhub + version: v1.5.1 ## The branch to be used to pull from dockerhub # pullPolicy: IfNotPresent or Never or Always pullPolicy: IfNotPresent + includeTcpDumpContainer: false #only for taking pcaps inside network function pod imagePullSecrets: - name: "regcred" multus: - create: false - n1IPadd: "172.21.6.201" - n1Netmask: "22" - n1Gateway: "172.21.7.254" - hostInterface: "bond0" # Interface of the host machine on which this pod will be scheduled + ## If you don't want to add a default route in your pod then leave this field empty + defaultGateway: "172.21.7.254" + n2Interface: + create: false + Ipadd: "172.21.6.94" + Netmask: "22" + ## If you do not have a gateway leave the field empty + Gateway: + ## If you do not want to add any routes in your pod then leave this field empty + routes: [{'dst': '10.8.0.0/24','gw': '172.21.7.254'}] + hostInterface: "bond0" # Interface of the host machine on which this pod will be scheduled config: - amfInterfaceNameForNGAP: "eth0" # If multus creation is true then net1 else eth0 - amfInterfaceNameForN11: "eth0" # Service based interface + amfInterfaceNameForNGAP: "eth0" # If oai-amf.multus.n2Interface.create is true then n2 else eth0 + amfInterfaceNameForSBI: "eth0" # Service based interface externalAusf: "yes" externalNssf: "yes" nrfSelection: "yes" @@ -95,10 +117,11 @@ oai-amf: useHttp2: "no" nssfFqdn: "oai-nssf-svc" nrfSelection: "yes" - # Mandatory - sst0: "1" - sd0: "0xFFFFFF" - # Optional upto 4 slices can be define using below template + logLevel: "debug" #allowed info/error/debug + sst0: "1" ## 1 slice/SST is mandatory + sd0: "0xFFFFFF" ## Optional 0xFFFFFF means no SD as per 3GPP + ## Can add upto 3 more slices. More than that you can do it in the configmap of amf templates/configmap.yaml + # Note only SST is mandatory for a slice SD is optional sst1: "1" sd1: "1" mcc: "001" @@ -113,21 +136,50 @@ oai-spgwu-tiny: kubernetesType: Vanilla #Openshift/Vanilla Vanilla for Upstream Kubernetes nfimage: # image name either locally present or in a public/private repository repository: docker.io/oaisoftwarealliance/oai-spgwu-tiny ## The image will be pulled from dockerhub - version: v1.5.0 ## The branch to be used to pull from dockerhub + version: v1.5.1 ## The branch to be used to pull from dockerhub # pullPolicy: IfNotPresent or Never or Always pullPolicy: IfNotPresent + includeTcpDumpContainer: false #only for taking pcaps inside network function pod imagePullSecrets: - name: "regcred" + # create an extra interface for N3 incase the gNB is outside the cluster network or there is a need to have dedicated interface for N3 + ## Change these ip-addresses according to your environment + ## N4, N6 are optional only if you want that UPF uses different subnets for different 3gpp interfaces. multus: - create: false - n3Ip: "172.21.6.200" - n3Netmask: "22" - n6Gw: "172.21.7.254" - hostInterface: "bond0" + defaultGateway: "172.21.7.254" + n3Interface: + create: false + Ipadd: "172.21.6.95" + Netmask: "22" + ## If you do not have a gateway leave the field empty + Gateway: "172.21.7.254" + ## If you do not want to add any routes in your pod then leave this field empty + routes: [{'dst': '10.8.0.0/24','gw': '172.21.7.254'}, {'dst': '10.9.0.0/24','gw': '172.21.7.254'}] + hostInterface: "bond0" + n4Interface: + create: false + Ipadd: "172.21.16.89" + Netmask: "22" + ## If you do not have a gateway leave the field empty + Gateway: "172.21.19.254" + ## If you do not want to add any routes in your pod then leave this field empty + routes: + hostInterface: "bond1" + n6Interface: + create: false + Ipadd: "172.21.8.80" + Netmask: "22" + ## If you do not have a gateway leave the field empty + Gateway: "172.21.11.254" + ## If you do not want to add any routes in your pod then leave this field empty + routes: + hostInterface: "bond2" + #NOTE: If the interface you selected for n6If is wrong then traffic will not be routed towards internet config: - n3If: "eth0" # net1 if gNB is outside the cluster network and multus creation is true else eth0 - n4If: "eth0" # use for SMF communication - n6If: "eth0" # net1 if gNB is outside the cluster network and multus creation is true else eth0 (important because it sends the traffic towards internet) + n3If: "eth0" # n3 if multus.n3Interface.create is true + n4If: "eth0" # n4 if multus.n4Interface.create is true + n6If: "eth0" # n6 multus.n6Interface.create is true + logLevel: "info" #allowed info/error/debug threadsN3Ul: "1" threadsN6Dl: "1" threadsN6Prio: 98 @@ -152,9 +204,16 @@ oai-smf: kubernetesType: Vanilla #Openshift/Vanilla Vanilla for Upstream Kubernetes nfimage: # image name either locally present or in a public/private repository repository: docker.io/oaisoftwarealliance/oai-smf ## The image will be pulled from dockerhub - version: v1.5.0 ## The branch to be used to pull from dockerhub + version: v1.5.1 ## The branch to be used to pull from dockerhub # pullPolicy: IfNotPresent or Never or Always pullPolicy: IfNotPresent + multus: + create: false + n4IPadd: "172.21.6.98" + n4Netmask: "22" + defaultGateway: "172.21.7.254" + hostInterface: "bond0" # Interface of the host machine on which this pod will be scheduled + includeTcpDumpContainer: false #only for taking pcaps inside network function pod imagePullSecrets: - name: "regcred" config: @@ -165,6 +224,7 @@ oai-smf: defaultCSCFIpv4Address: "172.21.6.200" # For IMS server if needed discoverUpf: "yes" # if NRF is used then it can be used for UPF discovery # You can define maximum 4 slices from here in case of more please change the configuration file. + logLevel: "debug" #allowed info/error/debug dnnNi0: "oai" pdusessiontype0: "IPv4" ipv4dnnRange0: "12.1.1.2 - 12.1.1.40" diff --git a/charts/oai-5g-core/oai-amf/Chart.yaml b/charts/oai-5g-core/oai-amf/Chart.yaml index d50fce3c76e82eb9b2b60cbb13a99d8fb886f307..df1c7a3e35fcd753ed8691383fb8033e3315c2e6 100644 --- a/charts/oai-5g-core/oai-amf/Chart.yaml +++ b/charts/oai-5g-core/oai-amf/Chart.yaml @@ -26,9 +26,9 @@ type: application icon: http://www.openairinterface.org/wp-content/uploads/2015/06/cropped-oai_final_logo.png -version: v1.5.0 +version: v1.5.1 -appVersion: v1.5.0 +appVersion: develop-v1.5.1 keywords: - 5GCN @@ -41,4 +41,4 @@ sources: maintainers: - name: OPENAIRINTERFACE - email: contact@openairinterface.org + email: contact@openairinterface.org \ No newline at end of file diff --git a/charts/oai-5g-core/oai-amf/README.md b/charts/oai-5g-core/oai-amf/README.md new file mode 100644 index 0000000000000000000000000000000000000000..816bf9ec27fb4abaa6163257116672f01de21309 --- /dev/null +++ b/charts/oai-5g-core/oai-amf/README.md @@ -0,0 +1,134 @@ +# Helm Chart for OAI Access and Mobility Function (AMF) + +The helm-chart is tested on [Minikube](https://minikube.sigs.k8s.io/docs/) and [Red Hat Openshift](https://www.redhat.com/fr/technologies/cloud-computing/openshift) 4.10 and 4.12. There are no special resource requirements for AMF. + +**NOTE**: All the extra interfaces/multus interfaces created inside the pod are using `macvlan` mode. If your environment does not allow using `macvlan` then you need to change the multus definations. + +## Introduction + +OAI-AMF follows 3GPP release 16, more information about the feature set can be found on [AMFs WiKi page](https://gitlab.eurecom.fr/oai/cn5g/oai-cn5g-amf/-/wikis/home). The source code be downloaded from [GitLab](https://gitlab.eurecom.fr/oai/cn5g/oai-cn5g-amf) + +OAI [Jenkins Platform](https://jenkins-oai.eurecom.fr/job/OAI-CN5G-AMF/) publishes every `develop` and `master` branch image of OAI-AMF on [docker-hub](https://hub.docker.com/r/oaisoftwarealliance/oai-amf) with tag `develop` and `latest` respectively. Apart from that you can find tags for every release `VX.X.X`. We only publish Ubuntu 18.04/20.04/22.04 images. We do not publish RedHat/UBI images. These images you have to build from the source code on your RedHat systems or Openshift Platform. You can follow this [tutorial](../../../openshift/README.md) for that. + +The helm chart of OAI-AMF creates multiples Kubernetes resources, + +1. Service +2. Role Base Access Control (RBAC) (role and role bindings) +3. Deployment +4. Configmap (Contains the configuration file for AMF) +5. Service account +6. Network-attachment-definition (Optional only when multus is used) + +The directory structure + +``` +├── Chart.yaml +├── README.md +├── templates +│  ├── configmap.yaml +│  ├── deployment.yaml +│  ├── _helpers.tpl +│  ├── multus.yaml +│  ├── NOTES.txt +│  ├── rbac.yaml +│  ├── serviceaccount.yaml +│  └── service.yaml +└── values.yaml (Parent file contains all the configurable parameters) +``` + +## Parameters + +[Values.yaml](./values.yaml) contains all the configurable parameters. Below table defines the configurable parameters. + + +|Parameter |Allowed Values |Remark | +|-----------------------------|-------------------------------|-----------------------------------------| +|kubernetesType |Vanilla/Openshift |Vanilla Kubernetes or Openshift | +|nfimage.repository |Image Name | | +|nfimage.version |Image tag | | +|nfimage.pullPolicy |IfNotPresent or Never or Always| | +|imagePullSecrets.name |String |Good to use for docker hub | +|serviceAccount.create |true/false | | +|serviceAccount.annotations |String | | +|serviceAccount.name |String | | +|podSecurityContext.runAsUser |Integer (0,65534) |Mandatory to use 0 | +|podSecurityContext.runAsGroup|Integer (0,65534) |Mandatory to use 0 | +|multus.create |true/false |default false | +|multus.n2IPadd |IPV4 |NA | +|multus.n2Netmask |Netmask |NA | +|multus.defaultGateway |IPV4 |Default route inside container (optional)| +|multus.hostInterface |HostInterface Name |NA | + + +### Configuration parameter + +|Parameter |Mandatory/Optional |Remark | +|-------------------------------|----------------------------|--------------------------------------------| +|config.mcc |Mandatory |Mobile Country Code | +|config.mnc |Mandatory |Mobile Network Code | +|config.regionId |Mandatory |Region ID | +|config.amfSetId |Mandatory |AMF SetID | +|config.logLevel |Optional |Default info, select info/debug/error | +|config.tac |Hexadecimal/Mandatory |Tracking aread code | +|config.sst0 |Integer 1-256/Mandatory |Slice Service Type 0 | +|config.sd0 |Integer/Hexadecimal/Optional| | +|config.sst1 |Optional | | +|config.sd1 |Optional | | +|config.amfInterfaceNameForNGAP |eth0/net1/Mandatory |net1 when multus is used | +|config.amfInterfaceNameForSBI |eth0/Mandatory | | +|config.amfInterfaceSBIHTTPPort |Integer/Mandatory |Standard port 80 | +|config.amfInterfaceSBIHTTP2Port|Integer/Mandatory |8080 if 80 is already inused | +|config.smfFqdn |Mandatory |SMF ip-address/FQDN | +|config.nrfFqdn |Mandatory |NRF ip-address/FQDN | +|config.ausfFqdn |Mandatory |AUSF ip-address/FQDN | +|config.nfRegistration |Mandatory |yes/no | +|config.nrfSelection |Optional |yes/no | +|config.smfSelection |Mandatory |It helps in selecting the SMF via NRF | +|config.externalAusf |Mandatory |Always yes when using AUSF | +|config.useHttp2 |Mandatory (yes/no) |if using HTTP/2 change the port for HTTP/1.1| +|config.mySqlServer |Optional |if not using AUSF | +|config.mySqlUser |Optional |if not using AUSF | +|config.externalNssf |Optional |if not using AUSF | +|config.mySqlPass |Optional |if not using AUSF | + +## Advanced Debugging Parameters + +Only needed if you are doing advanced debugging + + +|Parameter |Allowed Values |Remark | +|---------------------------------|-------------------------------|----------------------------------------------| +|start.amf |true/false |If true amf container will go in sleep mode | +|start.tcpdump |true/false |If true tcpdump container will go in sleepmode| +|includeTcpDumpContainer |true/false |If false no tcpdump container will be there | +|tcpdumpimage.repository |Image Name | | +|tcpdumpimage.version |Image tag | | +|tcpdumpimage.pullPolicy |IfNotPresent or Never or Always| | +|persistent.sharedvolume |true/false |Save the pcaps in a shared volume with NRF | +|resources.define |true/false | | +|resources.limits.tcpdump.cpu |string |Unit m for milicpu or cpu | +|resources.limits.tcpdump.memory |string |Unit Mi/Gi/MB/GB | +|resources.limits.nf.cpu |string |Unit m for milicpu or cpu | +|resources.limits.nf.memory |string |Unit Mi/Gi/MB/GB | +|resources.requests.tcpdump.cpu |string |Unit m for milicpu or cpu | +|resources.requests.tcpdump.memory|string |Unit Mi/Gi/MB/GB | +|resources.requests.nf.cpu |string |Unit m for milicpu or cpu | +|resources.requests.nf.memory |string |Unit Mi/Gi/MB/GB | +|readinessProbe |true/false |default true | +|livenessProbe |true/false |default false | +|terminationGracePeriodSeconds |5 |In seconds (default 5) | +|nodeSelector |Node label | | +|nodeName |Node Name | | + +## Installation + +Better to use the parent charts from: + +1. [oai-5g-basic](../oai-5g-basic/README.md) for basic deployment of OAI-5G Core +2. [oai-5g-mini](../oai-5g-mini/README.md) for mini deployment (AMF, SMF, NRF, UPF) of OAI-5G Core. In this type of deployment AMF plays the role of AUSF and UDR +3. [oai-5g-slicing](../oai-5g-slicing/README.md) for basic deployment with NSSF extra + +## Note + +1. If you are using multus then make sure it is properly configured and if you don't have a gateway for your multus interface then avoid using gateway and defaultGateway parameter. Either comment them or leave them empty. Wrong gateway configuration can create issues with pod networking and pod will not be able to resolve service names. +2. If you are using tcpdump container to take pcaps automatically (`start.tcpdump` is true) you can enable `persistent.sharedvolume` and [presistent volume](./oai-nrf/values.yaml) in NRF. To store the pcaps of all the NFs in one location. It is to ease the automated collection of pcaps. \ No newline at end of file diff --git a/charts/oai-5g-core/oai-amf/templates/configmap.yaml b/charts/oai-5g-core/oai-amf/templates/configmap.yaml index 91e0fee35e22e80ebffca6d4781d4da3839f115f..7b9e08c3ff5478c0fcae4a4181064e7504ffc2b6 100644 --- a/charts/oai-5g-core/oai-amf/templates/configmap.yaml +++ b/charts/oai-5g-core/oai-amf/templates/configmap.yaml @@ -10,6 +10,7 @@ data: PID_DIRECTORY = "/var/run"; # /var/run is the default AMF_NAME = "OAI-AMF"; + LOG_LEVEL = "{{ .Values.config.logLevel }}"; RELATIVE_CAPACITY = 30; # Display statistics about whole system (in seconds) diff --git a/charts/oai-5g-core/oai-amf/templates/deployment.yaml b/charts/oai-5g-core/oai-amf/templates/deployment.yaml index 300f4a62c4b409c3177b27e3b43d4b501a5d2c11..e9dd84d6db6b7419e3691a52ab0fae77053152c5 100644 --- a/charts/oai-5g-core/oai-amf/templates/deployment.yaml +++ b/charts/oai-5g-core/oai-amf/templates/deployment.yaml @@ -15,12 +15,18 @@ spec: metadata: labels: {{- include "oai-amf.selectorLabels" . | nindent 8 }} - {{- if .Values.multus.create }} + {{- if .Values.multus.n2Interface.create }} annotations: k8s.v1.cni.cncf.io/networks: >- [{ - "name": "{{ .Chart.Name }}-n2-net1", - "default-route": ["{{ .Values.multus.n2Gateway }}"] + "name": "{{ .Chart.Name }}-n2", + "interface": "n2" + {{- if .Values.multus.defaultGateway }} + ,"default-route": ["{{ .Values.multus.defaultGateway }}"] + {{- end }} + {{- if .Values.multus.n2Interface.Gateway }} + ,"gateway": "{{ .Values.multus.n2Interface.Gateway }}" + {{- end }} }] {{- end }} spec: @@ -31,35 +37,44 @@ spec: {{ toYaml .Values.imagePullSecrets | indent 8 }} {{- end }} containers: + {{- if .Values.includeTcpDumpContainer }} - name: tcpdump image: "{{ .Values.tcpdumpimage.repository }}:{{ .Values.tcpdumpimage.version }}" imagePullPolicy: {{ .Values.tcpdumpimage.pullPolicy }} {{- if .Values.resources.define}} resources: requests: - memory: {{ .Values.resources.tcpdump.requests.memory | quote }} - cpu: {{ .Values.resources.tcpdump.requests.cpu | quote }} + memory: {{ .Values.resources.requests.tcpdump.memory | quote }} + cpu: {{ .Values.resources.requests.tcpdump.cpu | quote }} limits: - memory: {{ .Values.resources.tcpdump.limits.memory | quote }} - cpu: {{ .Values.resources.tcpdump.limits.cpu | quote }} + memory: {{ .Values.resources.limits.tcpdump.memory | quote }} + cpu: {{ .Values.resources.limits.tcpdump.cpu | quote }} {{- end}} securityContext: - {{- toYaml .Values.securityContext | nindent 12 }} + privileged: true + capabilities: + add: + - NET_ADMIN + drop: + - ALL {{- if .Values.start.tcpdump}} command: - /bin/sh - -c - - /usr/sbin/tcpdump -i any -w /pcap/{{ .Chart.Name }}_`date +%Y-%m-%d_%H_%M-%S-%Z`.pcap + - /usr/sbin/tcpdump -i any -w /tmp/pcap/{{ .Chart.Name }}_`date +%Y-%m-%d_%H_%M-%S-%Z`.pcap {{- else}} command: - /bin/sleep - infinity {{- end}} + {{- if .Values.includeTcpDumpContainer}} {{- if .Values.persistent.sharedvolume}} volumeMounts: - - mountPath: "/pcap" - name: cn5g-pv + - mountPath: "/tmp/pcap" + name: cn5g-pvc {{- end}} + {{- end}} + {{- end }} - name: amf image: "{{ .Values.nfimage.repository }}:{{ .Values.nfimage.version }}" imagePullPolicy: {{ .Values.nfimage.pullPolicy }} @@ -69,14 +84,12 @@ spec: {{- if .Values.resources.define}} resources: requests: - memory: {{ .Values.resources.nf.requests.memory | quote }} - cpu: {{ .Values.resources.nf.requests.cpu | quote }} + memory: {{ .Values.resources.requests.nf.memory | quote }} + cpu: {{ .Values.resources.requests.nf.cpu | quote }} limits: - memory: {{ .Values.resources.nf.limits.memory | quote }} - cpu: {{ .Values.resources.nf.limits.cpu | quote }} + memory: {{ .Values.resources.limits.nf.memory | quote }} + cpu: {{ .Values.resources.limits.nf.cpu | quote }} {{- end}} - securityContext: - {{- toYaml .Values.securityContext | nindent 12 }} {{- if .Values.readinessProbe}} readinessProbe: exec: @@ -84,7 +97,7 @@ spec: - /bin/bash - /openair-amf/bin/healthcheck.sh initialDelaySeconds: 2 - periodSeconds: 3 + periodSeconds: 5 {{- end}} {{- if .Values.livenessProbe}} livenessProbe: @@ -117,11 +130,13 @@ spec: - infinity {{- end}} volumes: + {{- if .Values.includeTcpDumpContainer}} {{- if .Values.persistent.sharedvolume}} - - name: cn5g-pv + - name: cn5g-pvc persistentVolumeClaim: claimName: cn5g-pvc {{- end }} + {{- end }} - configMap: name: {{ .Chart.Name }}-configmap name: configuration diff --git a/charts/oai-5g-core/oai-amf/templates/multus.yaml b/charts/oai-5g-core/oai-amf/templates/multus.yaml index 8a6ade5e9004f153763711e72c60663f55d83d07..beef1679d9f32b486178c33545308013106fa1f0 100644 --- a/charts/oai-5g-core/oai-amf/templates/multus.yaml +++ b/charts/oai-5g-core/oai-amf/templates/multus.yaml @@ -1,22 +1,26 @@ --- -{{- if .Values.multus.create }} +{{- if .Values.multus.n2Interface.create }} apiVersion: "k8s.cni.cncf.io/v1" -kind: NetworkAttachmentDefinition +kind: NetworkAttachmentDefinition metadata: - name: {{ .Chart.Name }}-n2-net1 + name: {{ .Chart.Name }}-n2 spec: - config: '{ - "cniVersion": "0.3.0", + config: '{ + "cniVersion": "0.3.1", "type": "macvlan", - "master": {{- cat .Values.multus.hostInterface | nospace | quote }}, + "master": {{- cat .Values.multus.n2Interface.hostInterface | nospace | quote }}, "mode": "bridge", "ipam": { "type": "static", "addresses": [ { - "address": {{- cat .Values.multus.n2IPadd "/" .Values.multus.n2Netmask | nospace | quote }} + "address": {{- cat .Values.multus.n2Interface.Ipadd "/" .Values.multus.n2Interface.Netmask | nospace | quote }} } ] + {{- if .Values.multus.n2Interface.routes }} + ,"routes": {{- .Values.multus.n2Interface.routes | toJson }} + {{- end }} } }' {{- end }} +--- \ No newline at end of file diff --git a/charts/oai-5g-core/oai-amf/templates/rbac.yaml b/charts/oai-5g-core/oai-amf/templates/rbac.yaml index aed4d16a89647719ce3fc71eea05ca8fdde0e2ac..e218d4fcd61c95de8f1aea047c38b3b0a4c81ade 100644 --- a/charts/oai-5g-core/oai-amf/templates/rbac.yaml +++ b/charts/oai-5g-core/oai-amf/templates/rbac.yaml @@ -7,8 +7,13 @@ metadata: rules: - apiGroups: - security.openshift.io +{{- if .Values.includeTcpDumpContainer }} resourceNames: - privileged +{{- else }} + resourceNames: + - anyuid +{{- end }} resources: - securitycontextconstraints verbs: @@ -26,4 +31,4 @@ roleRef: kind: Role name: {{ .Chart.Name }}-{{ .Release.Namespace }}-role apiGroup: rbac.authorization.k8s.io -{{- end }} \ No newline at end of file +{{- end }} diff --git a/charts/oai-5g-core/oai-amf/values.yaml b/charts/oai-5g-core/oai-amf/values.yaml index 4cd06bf79c3857f4d87e812d1e595ee3e4caae68..04f777b8ce688baa9e73b749b0661c8338e784a8 100644 --- a/charts/oai-5g-core/oai-amf/values.yaml +++ b/charts/oai-5g-core/oai-amf/values.yaml @@ -1,17 +1,13 @@ -kubernetesType: Vanilla #Vanilla for community kubernetes distribution +kubernetesType: Vanilla #Vanilla for community kubernetes distribution else Openshift for Openshift +## In case of using these charts on Openshift then please use UBI images +## To know more about them follow this tutorial https://gitlab.eurecom.fr/oai/cn5g/oai-cn5g-fed/-/tree/master/openshift nfimage: # image name either locally present or in a public/private repository repository: docker.io/oaisoftwarealliance/oai-amf ## The image will be pulled from dockerhub - version: v1.5.0 #image tag, develop tag for experimental features + version: develop #image tag, develop tag for experimental features # pullPolicy: IfNotPresent or Never or Always pullPolicy: IfNotPresent -tcpdumpimage: - repository: docker.io/corfr/tcpdump - version: latest - #pullPolicy: IfNotPresent or Never or Always - pullPolicy: IfNotPresent - ## good to use when pulling images from docker-hub mention imagePullSecrets: - name: "regcred" @@ -24,20 +20,10 @@ serviceAccount: name: "oai-amf-sa" #service type is fixed to clusterIP, it is only support for non multus interface (eth0) - -## OPENSHIFT terminology podSecurityContext: runAsUser: 0 runAsGroup: 0 -## OPENSHIFT terminology -securityContext: - privileged: false - -start: - amf: true - tcpdump: false # WARNING: start tcpdump collection to analyse but beware it will take a lot of space in the container/persistent volume - # AMF needs two seperate interface one for http (for SBI) and other one for SCTP (N1/N2) to communicate with gNB. # But for experimentation only one interface can be used. # When you need multus: @@ -45,70 +31,98 @@ start: # 2. Your gnB is outside the cluster and the host machine can communicate but pods can not then you can provide ip-address in the same range as your host machine # 3. You want static ip-address for N1/N2 interface, Namf can be discovered by its service name - +## Change these ip-addresses according to your environment multus: - create: false - n2IPadd: "172.21.10.6" - n2Netmask: "22" - n2Gateway: "172.21.11.254" - hostInterface: "bond0" # Interface of the host machine on which this pod will be scheduled - -## Incase the pod is not able to resolve the FQDN of other network functions example nrf then you can disable useFqdnDns feature this way AMF will talk to other network functions using their ip-address. + ## If you don't want to add a default route in your pod then leave this field empty + defaultGateway: "172.21.7.254" + n2Interface: + create: false + Ipadd: "172.21.6.94" + Netmask: "22" + ## If you do not have a gateway leave the field empty + Gateway: + ## If you do not want to add any routes in your pod then leave this field empty + routes: [{'dst': '10.8.0.0/24','gw': '172.21.7.254'}] + hostInterface: "bond0" # Interface of the host machine on which this pod will be scheduled + +## Incase the pod is not able to resolve the FQDN of other network +## functions example nrf then you can disable useFqdnDns feature this way AMF will talk to other network functions using their ip-address. config: + logLevel: "debug" #info/debug/error + amfInterfaceNameForNGAP: "eth0" # If multus.n2Interface.create is true then n2 else eth0 + amfInterfaceNameForSBI: "eth0" # Service based interface + amfInterfaceSBIHTTPPort: 80 # Service based interface + amfInterfaceSBIHTTP2Port: 8080 # Service based interface mcc: "001" mnc: "01" regionId: "128" amfSetId: "1" tac: "0x0001" - sst0: "1" - sd0: "0xFFFFFF" + sst0: "1" ## 1 slice/SST is mandatory + sd0: "0xFFFFFF" ## Optional 0xFFFFFF means no SD as per 3GPP + ## Can add upto 3 more slices. More than that you can do it in the configmap of amf templates/configmap.yaml + # Note only SST is mandatory for a slice SD is optional sst1: "1" sd1: "1" - amfInterfaceNameForNGAP: "eth0" # If multus creation is true then net1 else eth0 - amfInterfaceNameForSBI: "eth0" # Service based interface - amfInterfaceSBIHTTPPort: 80 # Service based interface - amfInterfaceSBIHTTP2Port: 8080 # Service based interface - smfFqdn: "oai-smf-svc" - nrfFqdn: "oai-nrf-svc" # amf communicates using FQDN + smfFqdn: "oai-smf-svc" # amf communicates using FQDN/Service Name + nrfFqdn: "oai-nrf-svc" # amf communicates using FQDN/Service Name ausfFqdn: "oai-ausf-svc" #only needed if ausf is used and externalAusf is true else internal ausf will be used nfRegistration: "yes" nrfSelection: "no" smfSelection: "yes" - externalAusf: "yes" + externalAusf: "yes" #Ausf will be used instead of using internal AUSF for mini deployment externalUdm: "no" externalNrf: "no" externalNssf: "no" useHttp2: "no" intAlgoList: '[ "NIA1" , "NIA1" , "NIA2" ]' - ciphAlgoList: '[ "NEA1" , "NEA1" , "NEA2" ]' + ciphAlgoList: '[ "NEA0" , "NEA1" , "NEA2" ]' mySqlServer: "mysql" # OPTIONAL: used only if not using AUSF mySqlUser: "root" # OPTIONAL: used only if not using AUSF mySqlPass: "linux" # OPTIONAL: used only if not using AUSF mySqlDb: "oai_db" # OPTIONAL: used only if not using AUSF +## Debugging section +start: + amf: true #If false the network function container will run in sleep mode for manually testing + tcpdump: false + +includeTcpDumpContainer: false #If true it will add a tcpdump container inside network function pod for debugging +## For openshift you can use rhel8/support-tools:8.7-13 +tcpdumpimage: + repository: docker.io/corfr/tcpdump + version: latest + #pullPolicy: IfNotPresent or Never or Always + pullPolicy: IfNotPresent + +#To store PCAP of NF in a sharedVolume so it can be easily fetched (PVC is created with NRF charts so make sure in NRF it is true) persistent: sharedvolume: false - volumneName: managed-nfs-storage - size: 1Gi +## NF is the network function and tcpdump is the tcpdump container. +## To know more about request and limit it is better to understand that how Kubernetes QoS works. +## https://kubernetes.io/docs/concepts/configuration/manage-resources-containers +## https://kubernetes.io/docs/concepts/workloads/pods/pod-qos resources: define: false limits: - tcpdump: - cpu: 100m - memory: 128Mi nf: cpu: 100m memory: 128Mi - requests: + #If tcpdump container is disabled this value will not be used tcpdump: cpu: 100m memory: 128Mi + requests: nf: cpu: 100m memory: 128Mi + #If tcpdump container is disabled this value will not be used + tcpdump: + cpu: 100m + memory: 128Mi readinessProbe: true @@ -118,4 +132,4 @@ terminationGracePeriodSeconds: 5 nodeSelector: {} -nodeName: +nodeName: \ No newline at end of file diff --git a/charts/oai-5g-core/oai-ausf/Chart.yaml b/charts/oai-5g-core/oai-ausf/Chart.yaml index ead290671aa8906184b11368ea340079d1ccd20c..be640679c93a733c6ea93b6a54812788d49106bf 100644 --- a/charts/oai-5g-core/oai-ausf/Chart.yaml +++ b/charts/oai-5g-core/oai-ausf/Chart.yaml @@ -26,9 +26,9 @@ type: application icon: http://www.openairinterface.org/wp-content/uploads/2015/06/cropped-oai_final_logo.png -version: v1.5.0 +version: v1.5.1 -appVersion: v1.5.0 +appVersion: develop-v1.5.1 keywords: - 5GCN diff --git a/charts/oai-5g-core/oai-ausf/README.md b/charts/oai-5g-core/oai-ausf/README.md new file mode 100644 index 0000000000000000000000000000000000000000..0e629a93a26f9d05780a0f5820690f7ad7ec049b --- /dev/null +++ b/charts/oai-5g-core/oai-ausf/README.md @@ -0,0 +1,92 @@ +# Helm Chart for OAI Authentication Server Function (AUSF) + +The helm-chart is tested on [Minikube](https://minikube.sigs.k8s.io/docs/) and [Red Hat Openshift](https://www.redhat.com/fr/technologies/cloud-computing/openshift) 4.10 and 4.12. There are no special resource requirements for AUSF. + +## Introduction + +OAI-AUSF follows 3GPP release 16, more information about the feature set can be found on [AUSFs WiKi page](https://gitlab.eurecom.fr/oai/cn5g/oai-cn5g-ausf/-/wikis/home). The source code be downloaded from [GitLab](https://gitlab.eurecom.fr/oai/cn5g/oai-cn5g-ausf) + +OAI [Jenkins Platform](https://jenkins-oai.eurecom.fr/job/OAI-CN5G-AUSF/) publishes every `develop` and `master` branch image of OAI-AMF on [docker-hub](https://hub.docker.com/r/oaisoftwarealliance/oai-amf) with tag `develop` and `latest` respectively. Apart from that you can find tags for every release `VX.X.X`. We only publish Ubuntu 18.04/20.04/22.04 images. We do not publish RedHat/UBI images. These images you have to build from the source code on your RedHat systems or Openshift Platform. You can follow this [tutorial](../../../openshift/README.md) for that. + +The helm chart of OAI-AUSF creates multiples Kubernetes resources, + +1. Service +2. Role Base Access Control (RBAC) (role and role bindings) +3. Deployment +4. Configmap (Contains the configuration file for AMF) +5. Service account + +The directory structure + +``` +├── Chart.yaml +├── README.md +├── templates +│  ├── configmap.yaml +│  ├── deployment.yaml +│  ├── _helpers.tpl +│  ├── NOTES.txt +│  ├── rbac.yaml +│  ├── serviceaccount.yaml +│  └── service.yaml +└── values.yaml (Parent file contains all the configurable parameters) +``` + +## Parameters + +[Values.yaml](./values.yaml) contains all the configurable parameters. Below table defines the configurable parameters. + + +|Parameter |Allowed Values |Remark | +|-----------------------------|-------------------------------|-----------------------------------------| +|kubernetesType |Vanilla/Openshift |Vanilla Kubernetes or Openshift | +|nfimage.repository |Image Name | | +|nfimage.version |Image tag | | +|nfimage.pullPolicy |IfNotPresent or Never or Always| | +|imagePullSecrets.name |String |Good to use for docker hub | +|serviceAccount.create |true/false | | +|serviceAccount.annotations |String | | +|serviceAccount.name |String | | +|podSecurityContext.runAsUser |Integer (0,65534) |Mandatory to use 0 | +|podSecurityContext.runAsGroup|Integer (0,65534) |Mandatory to use 0 | + + +## Advanced Debugging Parameters + +Only needed if you are doing advanced debugging + + +|Parameter |Allowed Values |Remark | +|---------------------------------|-------------------------------|----------------------------------------------| +|start.ausf |true/false |If true ausf container will go in sleep mode | +|start.tcpdump |true/false |If true tcpdump container will go in sleepmode| +|includeTcpDumpContainer |true/false |If false no tcpdump container will be there | +|tcpdumpimage.repository |Image Name | | +|tcpdumpimage.version |Image tag | | +|tcpdumpimage.pullPolicy |IfNotPresent or Never or Always| | +|persistent.sharedvolume |true/false |Save the pcaps in a shared volume with NRF | +|resources.define |true/false | | +|resources.limits.tcpdump.cpu |string |Unit m for milicpu or cpu | +|resources.limits.tcpdump.memory |string |Unit Mi/Gi/MB/GB | +|resources.limits.nf.cpu |string |Unit m for milicpu or cpu | +|resources.limits.nf.memory |string |Unit Mi/Gi/MB/GB | +|resources.requests.tcpdump.cpu |string |Unit m for milicpu or cpu | +|resources.requests.tcpdump.memory|string |Unit Mi/Gi/MB/GB | +|resources.requests.nf.cpu |string |Unit m for milicpu or cpu | +|resources.requests.nf.memory |string |Unit Mi/Gi/MB/GB | +|readinessProbe |true/false |default true | +|livenessProbe |true/false |default false | +|terminationGracePeriodSeconds |5 |In seconds (default 5) | +|nodeSelector |Node label | | +|nodeName |Node Name | | + +## Installation + +Better to use the parent charts from: + +1. [oai-5g-basic](../oai-5g-basic/README.md) for basic deployment of OAI-5G Core +2. [oai-5g-slicing](../oai-5g-slicing/README.md) for basic deployment with NSSF extra + +## Note + +1. If you are using tcpdump container to take pcaps automatically (`start.tcpdump` is true) you can enable `persistent.sharedvolume` and [presistent volume](./oai-nrf/values.yaml) in NRF. To store the pcaps of all the NFs in one location. It is to ease the automated collection of pcaps. \ No newline at end of file diff --git a/charts/oai-5g-core/oai-ausf/templates/deployment.yaml b/charts/oai-5g-core/oai-ausf/templates/deployment.yaml index a9d6ca12a6c74092daca36901e9237fdf6e1715d..c16c94e445d4c345ce45da233972650322a27d0b 100644 --- a/charts/oai-5g-core/oai-ausf/templates/deployment.yaml +++ b/charts/oai-5g-core/oai-ausf/templates/deployment.yaml @@ -23,49 +23,56 @@ spec: {{ toYaml .Values.imagePullSecrets | indent 8 }} {{- end }} containers: + {{- if .Values.includeTcpDumpContainer }} - name: tcpdump image: "{{ .Values.tcpdumpimage.repository }}:{{ .Values.tcpdumpimage.version }}" - securityContext: - {{- toYaml .Values.securityContext | nindent 12 }} + imagePullPolicy: {{ .Values.tcpdumpimage.pullPolicy }} {{- if .Values.resources.define}} resources: requests: - memory: {{ .Values.resources.tcpdump.requests.memory | quote }} - cpu: {{ .Values.resources.tcpdump.requests.cpu | quote }} + memory: {{ .Values.resources.requests.tcpdump.memory | quote }} + cpu: {{ .Values.resources.requests.tcpdump.cpu | quote }} limits: - memory: {{ .Values.resources.tcpdump.limits.memory | quote }} - cpu: {{ .Values.resources.tcpdump.limits.cpu | quote }} + memory: {{ .Values.resources.limits.tcpdump.memory | quote }} + cpu: {{ .Values.resources.limits.tcpdump.cpu | quote }} {{- end}} - imagePullPolicy: {{ .Values.tcpdumpimage.pullPolicy }} + securityContext: + privileged: true + capabilities: + add: + - NET_ADMIN + drop: + - ALL {{- if .Values.start.tcpdump}} command: - /bin/sh - -c - - /usr/sbin/tcpdump -i any -w /pcap/oai-ausf_`date +%Y-%m-%d_%H_%M-%S-%Z`.pcap + - /usr/sbin/tcpdump -i any -w /tmp/pcap/{{ .Chart.Name }}_`date +%Y-%m-%d_%H_%M-%S-%Z`.pcap {{- else}} command: - /bin/sleep - infinity {{- end}} - {{- if .Values.persistence.sharedvolume}} + {{- if .Values.includeTcpDumpContainer}} + {{- if .Values.persistent.sharedvolume}} volumeMounts: - - mountPath: "/pcap" - name: cn5g-pv + - mountPath: "/tmp/pcap" + name: cn5g-pvc + {{- end}} {{- end}} + {{- end }} - name: ausf image: "{{ .Values.nfimage.repository }}:{{ .Values.nfimage.version }}" imagePullPolicy: {{ .Values.nfimage.pullPolicy }} {{- if .Values.resources.define}} resources: requests: - memory: {{ .Values.resources.nf.requests.memory | quote }} - cpu: {{ .Values.resources.nf.requests.cpu | quote }} + memory: {{ .Values.resources.requests.nf.memory | quote }} + cpu: {{ .Values.resources.requests.nf.cpu | quote }} limits: - memory: {{ .Values.resources.nf.limits.memory | quote }} - cpu: {{ .Values.resources.nf.limits.cpu | quote }} + memory: {{ .Values.resources.limits.nf.memory | quote }} + cpu: {{ .Values.resources.limits.nf.cpu | quote }} {{- end}} - securityContext: - {{- toYaml .Values.securityContext | nindent 12 }} {{- if .Values.readinessProbe}} readinessProbe: exec: @@ -116,6 +123,11 @@ spec: configMapKeyRef: name: {{ .Chart.Name }}-configmap key: ausfName + - name: LOG_LEVEL + valueFrom: + configMapKeyRef: + name: {{ .Chart.Name }}-configmap + key: logLevel - name: SBI_IF_NAME valueFrom: configMapKeyRef: @@ -187,12 +199,14 @@ spec: - /bin/sleep - infinity {{- end}} + {{- if .Values.includeTcpDumpContainer}} + {{- if .Values.persistent.sharedvolume}} volumes: - {{- if .Values.persistence.sharedvolume}} - - name: cn5g-pv - persistenceVolumeClaim: + - name: cn5g-pvc + persistentVolumeClaim: claimName: cn5g-pvc {{- end }} + {{- end }} dnsPolicy: ClusterFirst restartPolicy: Always schedulerName: default-scheduler diff --git a/charts/oai-5g-core/oai-ausf/templates/rbac.yaml b/charts/oai-5g-core/oai-ausf/templates/rbac.yaml index b8369fac5cf4493cad7e51582eb33d5a6aede5e7..e218d4fcd61c95de8f1aea047c38b3b0a4c81ade 100644 --- a/charts/oai-5g-core/oai-ausf/templates/rbac.yaml +++ b/charts/oai-5g-core/oai-ausf/templates/rbac.yaml @@ -7,7 +7,7 @@ metadata: rules: - apiGroups: - security.openshift.io -{{- if .Values.securityContext.privileged }} +{{- if .Values.includeTcpDumpContainer }} resourceNames: - privileged {{- else }} @@ -31,4 +31,4 @@ roleRef: kind: Role name: {{ .Chart.Name }}-{{ .Release.Namespace }}-role apiGroup: rbac.authorization.k8s.io -{{- end }} \ No newline at end of file +{{- end }} diff --git a/charts/oai-5g-core/oai-ausf/values.yaml b/charts/oai-5g-core/oai-ausf/values.yaml index 878c1b76e90e2ef35fe5ace30474495199a1c92b..fd6af0ebc1b3420fedacbd21007c6b355b68d456 100644 --- a/charts/oai-5g-core/oai-ausf/values.yaml +++ b/charts/oai-5g-core/oai-ausf/values.yaml @@ -1,14 +1,10 @@ -kubernetesType: Vanilla #Vanilla for community kubernetes distribution +kubernetesType: Vanilla #Vanilla for community kubernetes distribution else Openshift for Openshift +## In case of using these charts on Openshift then please use UBI images +## To know more about them follow this tutorial https://gitlab.eurecom.fr/oai/cn5g/oai-cn5g-fed/-/tree/master/openshift nfimage: repository: docker.io/oaisoftwarealliance/oai-ausf ## oaisoftwarealliance/oai-ausf # image name either locally present or in a public/private repository - version: v1.5.0 #image tag, develop tag for experimental features - #pullPolicy: IfNotPresent or Never or Always - pullPolicy: IfNotPresent - -tcpdumpimage: - repository: docker.io/corfr/tcpdump - version: latest + version: develop #image tag, develop tag for experimental features #pullPolicy: IfNotPresent or Never or Always pullPolicy: IfNotPresent @@ -31,17 +27,11 @@ podSecurityContext: runAsUser: 0 runAsGroup: 0 -securityContext: - privileged: false - -start: - ausf: true - tcpdump: false #start tcpdump collection to analyse but beware it will take a lot of space in the container/persistent volume - config: tz: "Europe/Paris" instanceId: "0" pidDirectory: "/var/run" + logLevel: "debug" ausfName: "OAI_AUSF" sbiIfName: "eth0" sbiPortHttp1: "80" @@ -58,27 +48,47 @@ config: nrfFqdn: "oai-nrf-svc" registerNrf: "no" -persistence: +## Debugging section +start: + ausf: true #If false the network function container will run in sleep mode for manually testing + tcpdump: false + +includeTcpDumpContainer: false #If true it will add a tcpdump container inside network function pod for debugging + +## For openshift you can use rhel8/support-tools:8.7-13 +tcpdumpimage: + repository: docker.io/corfr/tcpdump + version: latest + #pullPolicy: IfNotPresent or Never or Always + pullPolicy: IfNotPresent + + +#To store PCAP of NF in a sharedVolume so it can be easily fetched (PVC is created with NRF charts so make sure in NRF it is true) +persistent: sharedvolume: false - volumneName: managed-nfs-storage - size: 1Gi +## NF is the network function and tcpdump is the tcpdump container. +## To know more about request and limit it is better to understand that how Kubernetes QoS works. +## https://kubernetes.io/docs/concepts/configuration/manage-resources-containers +## https://kubernetes.io/docs/concepts/workloads/pods/pod-qos resources: define: false limits: - tcpdump: - cpu: 100m - memory: 128Mi nf: cpu: 100m memory: 128Mi - requests: + #If tcpdump container is disabled this value will not be used tcpdump: cpu: 100m memory: 128Mi + requests: nf: cpu: 100m memory: 128Mi + #If tcpdump container is disabled this value will not be used + tcpdump: + cpu: 100m + memory: 128Mi readinessProbe: true @@ -88,4 +98,4 @@ terminationGracePeriodSeconds: 5 nodeSelector: {} -nodeName: +nodeName: diff --git a/charts/oai-5g-core/oai-nrf/Chart.yaml b/charts/oai-5g-core/oai-nrf/Chart.yaml index c58f3088453abd3e665d4dcbdae50adc35f698cf..1fa7d6f61bc124d4142d669e2fc18fbb217d7d45 100644 --- a/charts/oai-5g-core/oai-nrf/Chart.yaml +++ b/charts/oai-5g-core/oai-nrf/Chart.yaml @@ -26,9 +26,9 @@ type: application icon: http://www.openairinterface.org/wp-content/uploads/2015/06/cropped-oai_final_logo.png -version: v1.5.0 +version: v1.5.1 -appVersion: v1.5.0 +appVersion: develop-v1.5.1 keywords: - 5GCN diff --git a/charts/oai-5g-core/oai-nrf/README.md b/charts/oai-5g-core/oai-nrf/README.md new file mode 100644 index 0000000000000000000000000000000000000000..564d5bd6a1a1912e95c4263f87078632b9d6dc2f --- /dev/null +++ b/charts/oai-5g-core/oai-nrf/README.md @@ -0,0 +1,101 @@ +# Helm Chart for OAI Network Registry Function (NRF) + +The helm-chart is tested on [Minikube](https://minikube.sigs.k8s.io/docs/) and [Red Hat Openshift](https://www.redhat.com/fr/technologies/cloud-computing/openshift) 4.10 and 4.12. There are no special resource requirements for NRF. + +## Introduction + +OAI-NRF follows 3GPP release 16, more information about the feature set can be found on [NRFs WiKi page](https://gitlab.eurecom.fr/oai/cn5g/oai-cn5g-nrf/-/wikis/home). The source code be downloaded from [GitLab](https://gitlab.eurecom.fr/oai/cn5g/oai-cn5g-nrf) + +OAI [Jenkins Platform](https://jenkins-oai.eurecom.fr/job/OAI-CN5G-NRF/) publishes every `develop` and `master` branch image of OAI-NRF on [docker-hub](https://hub.docker.com/r/oaisoftwarealliance/oai-nrf) with tag `develop` and `latest` respectively. Apart from that you can find tags for every release `VX.X.X`. We only publish Ubuntu 18.04/20.04/22.04 images. We do not publish RedHat/UBI images. These images you have to build from the source code on your RedHat systems or Openshift Platform. You can follow this [tutorial](../../../openshift/README.md) for that. + +The helm chart of OAI-NRF creates multiples Kubernetes resources, + +1. Service +2. Role Base Access Control (RBAC) (role and role bindings) +3. Deployment +4. Configmap +5. Service account +6. PVC (optional only when enabled): It is used for saving pcaps. + +The directory structure + +``` +├── Chart.yaml +├── templates +│  ├── configmap.yaml +│  ├── deployment.yaml +│  ├── _helpers.tpl +│  ├── NOTES.txt +│  ├── pvc.yaml (optional only when enabled): It is used for saving pcaps. +│  ├── rbac.yaml +│  ├── serviceaccount.yaml +│  └── service.yaml +└── values.yaml + +1 directory, 10 files +``` + +## Parameters + +[Values.yaml](./values.yaml) contains all the configurable parameters. Below table defines the configurable parameters. + + +|Parameter |Allowed Values |Remark | +|-----------------------------|-------------------------------|-----------------------------------------| +|kubernetesType |Vanilla/Openshift |Vanilla Kubernetes or Openshift | +|nfimage.repository |Image Name | | +|nfimage.version |Image tag | | +|nfimage.pullPolicy |IfNotPresent or Never or Always| | +|imagePullSecrets.name |String |Good to use for docker hub | +|serviceAccount.create |true/false | | +|serviceAccount.annotations |String | | +|serviceAccount.name |String | | +|podSecurityContext.runAsUser |Integer (0,65534) |Mandatory to use 0 | +|podSecurityContext.runAsGroup|Integer (0,65534) |Mandatory to use 0 | + + +Only needed if you are doing advanced debugging + + +|Parameter |Allowed Values |Remark | +|---------------------------------|-------------------------------|----------------------------------------------| +|start.ausf |true/false |If true nrf container will go in sleep mode | +|start.tcpdump |true/false |If true tcpdump container will go in sleepmode| +|includeTcpDumpContainer |true/false |If false no tcpdump container will be there | +|tcpdumpimage.repository |Image Name | | +|tcpdumpimage.version |Image tag | | +|tcpdumpimage.pullPolicy |IfNotPresent or Never or Always| | +|persistent.sharedvolume |true/false |Save the pcaps in a shared volume with NRF | +|persistent.storageClass |String |Storage class else default SC of your cluster will be used| +|persistent.size |In Gi/Mi |Size of PVC | +|resources.define |true/false | | +|resources.limits.tcpdump.cpu |string |Unit m for milicpu or cpu | +|resources.limits.tcpdump.memory |string |Unit Mi/Gi/MB/GB | +|resources.limits.nf.cpu |string |Unit m for milicpu or cpu | +|resources.limits.nf.memory |string |Unit Mi/Gi/MB/GB | +|resources.requests.tcpdump.cpu |string |Unit m for milicpu or cpu | +|resources.requests.tcpdump.memory|string |Unit Mi/Gi/MB/GB | +|resources.requests.nf.cpu |string |Unit m for milicpu or cpu | +|resources.requests.nf.memory |string |Unit Mi/Gi/MB/GB | +|readinessProbe |true/false |default true | +|livenessProbe |true/false |default false | +|terminationGracePeriodSeconds |5 |In seconds (default 5) | +|nodeSelector |Node label | | +|nodeName |Node Name | | + + +## Installation + +Better to use the parent charts from: + +1. [oai-5g-basic](../oai-5g-basic/README.md) for basic deployment of OAI-5G Core +2. [oai-5g-mini](../oai-5g-mini/README.md) for mini deployment (AMF, SMF, NRF, UPF) of OAI-5G Core. In this type of deployment AMF plays the role of AUSF and UDR +3. [oai-5g-slicing](../oai-5g-slicing/README.md) for basic deployment with NSSF extra + +```bash +helm install oai-nrf . +``` + +## Note + +1. If you are using tcpdump container to take pcaps automatically (`start.tcpdump` is true) you can enable `persistent.sharedvolume` and configure the storage class. To store the pcaps of all the NFs in one location. It is to ease the automated collection of pcaps. \ No newline at end of file diff --git a/charts/oai-5g-core/oai-nrf/templates/deployment.yaml b/charts/oai-5g-core/oai-nrf/templates/deployment.yaml index 8b8ebfc2042d17f050ad6f9edbec02b582cd3285..e8d6401d01c875bd7efd0dc2c42d8b214dbb13c5 100644 --- a/charts/oai-5g-core/oai-nrf/templates/deployment.yaml +++ b/charts/oai-5g-core/oai-nrf/templates/deployment.yaml @@ -23,47 +23,56 @@ spec: {{ toYaml .Values.imagePullSecrets | indent 8 }} {{- end }} containers: + {{- if .Values.includeTcpDumpContainer }} - name: tcpdump image: "{{ .Values.tcpdumpimage.repository }}:{{ .Values.tcpdumpimage.version }}" imagePullPolicy: {{ .Values.tcpdumpimage.pullPolicy }} {{- if .Values.resources.define}} resources: requests: - memory: {{ .Values.resources.tcpdump.requests.memory | quote }} - cpu: {{ .Values.resources.tcpdump.requests.cpu | quote }} + memory: {{ .Values.resources.requests.tcpdump.memory | quote }} + cpu: {{ .Values.resources.requests.tcpdump.cpu | quote }} limits: - memory: {{ .Values.resources.tcpdump.limits.memory | quote }} - cpu: {{ .Values.resources.tcpdump.limits.cpu | quote }} + memory: {{ .Values.resources.limits.tcpdump.memory | quote }} + cpu: {{ .Values.resources.limits.tcpdump.cpu | quote }} {{- end}} + securityContext: + privileged: true + capabilities: + add: + - NET_ADMIN + drop: + - ALL {{- if .Values.start.tcpdump}} command: - /bin/sh - -c - - /usr/sbin/tcpdump -i any -w /pcap/{{ .Chart.Name }}_`date +%Y-%m-%d_%H_%M-%S-%Z`.pcap + - /usr/sbin/tcpdump -i any -w /tmp/pcap/{{ .Chart.Name }}_`date +%Y-%m-%d_%H_%M-%S-%Z`.pcap {{- else}} command: - /bin/sleep - infinity {{- end}} - {{- if .Values.persistent.sharedvolume}} + {{- if .Values.includeTcpDumpContainer}} + {{- if .Values.persistent.sharedvolume }} volumeMounts: - - mountPath: "/pcap" + - mountPath: "/tmp/pcap" name: cn5g-pvc {{- end}} + {{- end}} + {{- end }} - name: nrf image: "{{ .Values.nfimage.repository }}:{{ .Values.nfimage.version }}" imagePullPolicy: {{ .Values.nfimage.pullPolicy }} {{- if .Values.resources.define}} resources: requests: - memory: {{ .Values.resources.nf.requests.memory | quote }} - cpu: {{ .Values.resources.nf.requests.cpu | quote }} + memory: {{ .Values.resources.requests.nf.memory | quote }} + cpu: {{ .Values.resources.requests.nf.cpu | quote }} limits: - memory: {{ .Values.resources.nf.limits.memory | quote }} - cpu: {{ .Values.resources.nf.limits.cpu | quote }} + memory: {{ .Values.resources.limits.nf.memory | quote }} + cpu: {{ .Values.resources.limits.nf.cpu | quote }} {{- end}} - securityContext: - {{- toYaml .Values.securityContext | nindent 12 }} {{- if .Values.readinessProbe}} readinessProbe: exec: @@ -71,7 +80,7 @@ spec: - /bin/bash - /openair-nrf/bin/healthcheck.sh initialDelaySeconds: 2 - periodSeconds: 3 + periodSeconds: 2 {{- end}} {{- if .Values.livenessProbe}} livenessProbe: @@ -110,12 +119,19 @@ spec: configMapKeyRef: name: {{ .Chart.Name }}-configmap key: nrfApiVersion - volumes: + - name: LOG_LEVEL + valueFrom: + configMapKeyRef: + name: {{ .Chart.Name }}-configmap + key: logLevel + {{- if .Values.includeTcpDumpContainer}} {{- if .Values.persistent.sharedvolume}} + volumes: - name: cn5g-pvc persistentVolumeClaim: claimName: cn5g-pvc {{- end }} + {{- end }} dnsPolicy: ClusterFirst restartPolicy: Always serviceAccountName: {{ .Values.serviceAccount.name }} @@ -127,4 +143,3 @@ spec: {{- if .Values.nodeName}} nodeName: {{ .Values.nodeName }} {{- end }} - diff --git a/charts/oai-5g-core/oai-nrf/templates/pvc.yaml b/charts/oai-5g-core/oai-nrf/templates/pvc.yaml index c017fd0f88c6940d161f4518ba93ccbf1203b560..ff69c698aa4b7015ed44f9d7a64c2cedc55b415f 100644 --- a/charts/oai-5g-core/oai-nrf/templates/pvc.yaml +++ b/charts/oai-5g-core/oai-nrf/templates/pvc.yaml @@ -1,3 +1,4 @@ +{{- if .Values.includeTcpDumpContainer }} {{- if .Values.persistent.sharedvolume }} apiVersion: v1 kind: PersistentVolumeClaim @@ -6,8 +7,15 @@ metadata: spec: accessModes: - ReadWriteMany - storageClassName: {{ .Values.persistent.volumeName }} +{{- if not .Values.persistent.storageClass }} +{{- if (eq "-" .Values.persistent.storageClass) }} + storageClassName: "" +{{- else }} + storageClassName: "{{ .Values.persistent.storageClass }}" +{{- end }} +{{- end }} resources: requests: storage: {{ .Values.persistent.size }} {{- end }} +{{- end }} diff --git a/charts/oai-5g-core/oai-nrf/templates/rbac.yaml b/charts/oai-5g-core/oai-nrf/templates/rbac.yaml index aa869868b9fad08e0a9065f53c34c1db15e25983..e218d4fcd61c95de8f1aea047c38b3b0a4c81ade 100644 --- a/charts/oai-5g-core/oai-nrf/templates/rbac.yaml +++ b/charts/oai-5g-core/oai-nrf/templates/rbac.yaml @@ -7,8 +7,13 @@ metadata: rules: - apiGroups: - security.openshift.io +{{- if .Values.includeTcpDumpContainer }} + resourceNames: + - privileged +{{- else }} resourceNames: - anyuid +{{- end }} resources: - securitycontextconstraints verbs: @@ -26,4 +31,4 @@ roleRef: kind: Role name: {{ .Chart.Name }}-{{ .Release.Namespace }}-role apiGroup: rbac.authorization.k8s.io -{{- end }} \ No newline at end of file +{{- end }} diff --git a/charts/oai-5g-core/oai-nrf/values.yaml b/charts/oai-5g-core/oai-nrf/values.yaml index b17f46627ecb54eb549bad192a4fb85e0aabd78e..938cc9861b877412ce7641d1b6c92096338f1e0b 100644 --- a/charts/oai-5g-core/oai-nrf/values.yaml +++ b/charts/oai-5g-core/oai-nrf/values.yaml @@ -1,15 +1,10 @@ -kubernetesType: Vanilla #Vanilla for community kubernetes distribution +kubernetesType: Vanilla #Vanilla for community kubernetes distribution else Openshift for Openshift -# NF image +## In case of using these charts on Openshift then please use UBI images +## To know more about them follow this tutorial https://gitlab.eurecom.fr/oai/cn5g/oai-cn5g-fed/-/tree/master/openshift nfimage: repository: docker.io/oaisoftwarealliance/oai-nrf - version: v1.5.0 #image tag, develop tag for experimental features - # pullPolicy: IfNotPresent or Never or Always - pullPolicy: IfNotPresent - -tcpdumpimage: - repository: corfr/tcpdump - version: latest + version: develop #image tag, develop tag for experimental features # pullPolicy: IfNotPresent or Never or Always pullPolicy: IfNotPresent @@ -30,52 +25,63 @@ podSecurityContext: runAsUser: 0 runAsGroup: 0 -securityContext: - privileged: false - -#service type is fixed to clusterIP - -start: - nrf: true - tcpdump: false #start tcpdump collection to analyse but beware it will take a lot of space in the container/persistent volume - -# create multus interface in case the NRF wants to use a separate interface -# than kubernetes general CNI or it needs to be accessed from outside cluster network using ip-address (please use amf multus.yaml as an example). - config: nrfInterfaceNameForSBI: "eth0" # net1 if multus.create is set true nrfInterfacePortForSBI: "80" nrfInterfaceHttp2PortForSBI: "8080" nrfApiVersion: "v1" + logLevel: "debug" + +## Debugging section +start: + nrf: true #If false the network function container will run in sleep mode for manually testing + tcpdump: false +includeTcpDumpContainer: false #If true it will add a tcpdump container inside network function pod for debugging + +## For openshift you can use rhel8/support-tools:8.7-13 +tcpdumpimage: + repository: docker.io/corfr/tcpdump + version: latest + #pullPolicy: IfNotPresent or Never or Always + pullPolicy: IfNotPresent + +# To store PCAP of NF in a sharedVolume so it can be easily fetched persistent: sharedvolume: false - volumeName: managed-nfs-storage + storageClass: "-" + #storageClass: "nfs-client" #If value is "-" default storageClass will be used size: 1Gi +## NF is the network function and tcpdump is the tcpdump container. +## To know more about request and limit it is better to understand that how Kubernetes QoS works. +## https://kubernetes.io/docs/concepts/configuration/manage-resources-containers +## https://kubernetes.io/docs/concepts/workloads/pods/pod-qos resources: define: false limits: - tcpdump: - cpu: 100m - memory: 128Mi nf: cpu: 100m memory: 128Mi - requests: + #If tcpdump container is disabled this value will not be used tcpdump: cpu: 100m memory: 128Mi + requests: nf: cpu: 100m memory: 128Mi - -terminationGracePeriodSeconds: 5 + #If tcpdump container is disabled this value will not be used + tcpdump: + cpu: 100m + memory: 128Mi readinessProbe: true livenessProbe: false +terminationGracePeriodSeconds: 5 + nodeSelector: {} -nodeName: +nodeName: diff --git a/charts/oai-5g-core/oai-nssf/Chart.yaml b/charts/oai-5g-core/oai-nssf/Chart.yaml index 5b87332526bbab5b971b4e7c3dfb75099eec50ca..739a7b8bf390aace1c20e82717f716cf07246fa8 100644 --- a/charts/oai-5g-core/oai-nssf/Chart.yaml +++ b/charts/oai-5g-core/oai-nssf/Chart.yaml @@ -26,9 +26,9 @@ type: application icon: http://www.openairinterface.org/wp-content/uploads/2015/06/cropped-oai_final_logo.png -version: v1.5.0 +version: v1.5.1 -appVersion: v1.5.0 +appVersion: develop-v1.5.1 keywords: - 5GCN diff --git a/charts/oai-5g-core/oai-nssf/templates/deployment.yaml b/charts/oai-5g-core/oai-nssf/templates/deployment.yaml index e4e803b1370f260f21db861676673ee9862f238e..464bffb01675fd8193158bab7ebad19ffb2b74ef 100644 --- a/charts/oai-5g-core/oai-nssf/templates/deployment.yaml +++ b/charts/oai-5g-core/oai-nssf/templates/deployment.yaml @@ -21,44 +21,55 @@ spec: imagePullSecrets: {{ toYaml .Values.imagePullSecrets | indent 8 }} containers: + {{- if .Values.includeTcpDumpContainer }} - name: tcpdump image: "{{ .Values.tcpdumpimage.repository }}:{{ .Values.tcpdumpimage.version }}" imagePullPolicy: {{ .Values.tcpdumpimage.pullPolicy }} {{- if .Values.resources.define}} resources: requests: - memory: {{ .Values.resources.tcpdump.requests.memory | quote }} - cpu: {{ .Values.resources.tcpdump.requests.cpu | quote }} + memory: {{ .Values.resources.requests.tcpdump.memory | quote }} + cpu: {{ .Values.resources.requests.tcpdump.cpu | quote }} limits: - memory: {{ .Values.resources.tcpdump.limits.memory | quote }} - cpu: {{ .Values.resources.tcpdump.limits.cpu | quote }} + memory: {{ .Values.resources.limits.tcpdump.memory | quote }} + cpu: {{ .Values.resources.limits.tcpdump.cpu | quote }} {{- end}} + securityContext: + privileged: true + capabilities: + add: + - NET_ADMIN + drop: + - ALL {{- if .Values.start.tcpdump}} command: - /bin/sh - -c - - /usr/sbin/tcpdump -i any -w /pcap/oai-nssf_`date +%Y-%m-%d_%H_%M-%S-%Z`.pcap + - /usr/sbin/tcpdump -i any -w /pcap/{{ .Chart.Name }}_`date +%Y-%m-%d_%H_%M-%S-%Z`.pcap {{- else}} command: - /bin/sleep - infinity {{- end}} - {{- if .Values.persistence.sharedvolume}} + {{- if .Values.includeTcpDumpContainer}} + {{- if .Values.persistent.sharedvolume}} volumeMounts: - - mountPath: "/pcap" - name: cn5g-pv + - mountPath: "/tmp/pcap" + name: cn5g-pvc + {{- end}} {{- end}} + {{- end }} - name: nssf image: "{{ .Values.nfimage.repository }}:{{ .Values.nfimage.version }}" imagePullPolicy: {{ .Values.nfimage.pullPolicy }} {{- if .Values.resources.define}} resources: requests: - memory: {{ .Values.resources.nf.requests.memory | quote }} - cpu: {{ .Values.resources.nf.requests.cpu | quote }} + memory: {{ .Values.resources.requests.nf.memory | quote }} + cpu: {{ .Values.resources.requests.nf.cpu | quote }} limits: - memory: {{ .Values.resources.nf.limits.memory | quote }} - cpu: {{ .Values.resources.nf.limits.cpu | quote }} + memory: {{ .Values.resources.limits.nf.memory | quote }} + cpu: {{ .Values.resources.limits.nf.cpu | quote }} {{- end}} volumeMounts: - mountPath: /tmp/ @@ -81,8 +92,6 @@ spec: initialDelaySeconds: 10 periodSeconds: 5 {{- end}} - securityContext: - {{- toYaml .Values.securityContext | nindent 12 }} ports: - containerPort: {{ .Values.config.sbiPortHttp1 }} name: http1 @@ -115,6 +124,11 @@ spec: configMapKeyRef: name: {{ .Chart.Name }}-configmap key: pidDirectory + - name: LOG_LEVEL + valueFrom: + configMapKeyRef: + name: {{ .Chart.Name }}-configmap + key: logLevel - name: NSSF_FQDN valueFrom: configMapKeyRef: @@ -152,11 +166,13 @@ spec: - infinity {{- end}} volumes: - {{- if .Values.persistence.sharedvolume}} - - name: cn5g-pv + {{- if .Values.includeTcpDumpContainer}} + {{- if .Values.persistent.sharedvolume}} + - name: cn5g-pvc persistenceVolumeClaim: claimName: cn5g-pvc {{- end }} + {{- end }} - name: nssf-slice-config configMap: name: {{ .Chart.Name }}-yamlconfig diff --git a/charts/oai-5g-core/oai-nssf/templates/rbac.yaml b/charts/oai-5g-core/oai-nssf/templates/rbac.yaml index aa869868b9fad08e0a9065f53c34c1db15e25983..e218d4fcd61c95de8f1aea047c38b3b0a4c81ade 100644 --- a/charts/oai-5g-core/oai-nssf/templates/rbac.yaml +++ b/charts/oai-5g-core/oai-nssf/templates/rbac.yaml @@ -7,8 +7,13 @@ metadata: rules: - apiGroups: - security.openshift.io +{{- if .Values.includeTcpDumpContainer }} + resourceNames: + - privileged +{{- else }} resourceNames: - anyuid +{{- end }} resources: - securitycontextconstraints verbs: @@ -26,4 +31,4 @@ roleRef: kind: Role name: {{ .Chart.Name }}-{{ .Release.Namespace }}-role apiGroup: rbac.authorization.k8s.io -{{- end }} \ No newline at end of file +{{- end }} diff --git a/charts/oai-5g-core/oai-nssf/values.yaml b/charts/oai-5g-core/oai-nssf/values.yaml index 7a9a5f9db242f047d64f6d11f99dfb1d92694020..564bbc42e64b29e2a138878389a6bb3bac0f167f 100644 --- a/charts/oai-5g-core/oai-nssf/values.yaml +++ b/charts/oai-5g-core/oai-nssf/values.yaml @@ -1,14 +1,8 @@ -kubernetesType: Vanilla #Vanilla for community kubernetes distribution +kubernetesType: Vanilla # Vanilla (Community Kubernetes) or Openshift (For RedHat Openshift) nfimage: repository: docker.io/oaisoftwarealliance/oai-nssf # image name either locally present or in a public/private repository - version: v1.5.0 #image tag, develop tag for experimental features - #pullPolicy: IfNotPresent or Never or Always - pullPolicy: IfNotPresent - -tcpdumpimage: - repository: docker.io/corfr/tcpdump - version: latest + version: develop #image tag, develop tag for experimental features #pullPolicy: IfNotPresent or Never or Always pullPolicy: IfNotPresent @@ -28,16 +22,8 @@ podSecurityContext: runAsUser: 0 runAsGroup: 0 -securityContext: - privileged: false - #service type is fixed to clusterIP, it is only support for non multus interface (eth0) -start: - nssf: true - tcpdump: false #start tcpdump collection to analyse but beware it will take a lot of space in the container/persistent volume - - config: tz: "Europe/Paris" instance: "0" @@ -51,35 +37,50 @@ config: nssfSliceConfig: "/tmp/nssf_slice_config.yaml" # Do not change -persistence: - sharedvolume: false - volumneName: managed-nfs-storage - size: 1Gi - +## Debugging section +start: + nssf: true #If false the network function container will run in sleep mode for manually testing + tcpdump: false + +includeTcpDumpContainer: false #If true it will add a tcpdump container inside network function pod for debugging + +tcpdumpimage: + repository: docker.io/corfr/tcpdump + version: latest + #pullPolicy: IfNotPresent or Never or Always + pullPolicy: IfNotPresent + +#To store PCAP of NF in a sharedVolume so it can be easily fetched (PVC is created with NRF charts so make sure in NRF it is true) +persistent: + sharedvolume: true + +## NF is the network function and tcpdump is the tcpdump container. +## To know more about request and limit it is better to understand that how Kubernetes QoS works. +## https://kubernetes.io/docs/concepts/configuration/manage-resources-containers +## https://kubernetes.io/docs/concepts/workloads/pods/pod-qos resources: define: false limits: - tcpdump: - cpu: 100m - memory: 128Mi nf: cpu: 100m memory: 128Mi + # tcpdump: + # cpu: 100m + # memory: 128Mi requests: - tcpdump: - cpu: 100m - memory: 128Mi nf: cpu: 100m memory: 128Mi + # tcpdump: + # cpu: 100m + # memory: 128Mi readinessProbe: true -livenessProbe: false +livenessProbe: false terminationGracePeriodSeconds: 5 nodeSelector: {} nodeName: - diff --git a/charts/oai-5g-core/oai-smf/Chart.yaml b/charts/oai-5g-core/oai-smf/Chart.yaml index 8ce23998e945c1f78433212fefb1e25a40b3a239..3755ffb1debf6f835e004a1390d235915cdff784 100644 --- a/charts/oai-5g-core/oai-smf/Chart.yaml +++ b/charts/oai-5g-core/oai-smf/Chart.yaml @@ -26,9 +26,9 @@ type: application icon: http://www.openairinterface.org/wp-content/uploads/2015/06/cropped-oai_final_logo.png -version: v1.5.0 +version: v1.5.1 -appVersion: v1.5.0 +appVersion: develop-v1.5.1 keywords: - 5G diff --git a/charts/oai-5g-core/oai-smf/README.md b/charts/oai-5g-core/oai-smf/README.md new file mode 100644 index 0000000000000000000000000000000000000000..f2b156af121a5bbbb7638fab950bf72dea04e64c --- /dev/null +++ b/charts/oai-5g-core/oai-smf/README.md @@ -0,0 +1,107 @@ +# Helm Chart for OAI Session Management Function (SMF) + +The helm-chart is tested on [Minikube](https://minikube.sigs.k8s.io/docs/) and [Red Hat Openshift](https://www.redhat.com/fr/technologies/cloud-computing/openshift) 4.10 and 4.12. There are no special resource requirements for SMF. + +**NOTE**: All the extra interfaces/multus interfaces created inside the pod are using `macvlan` mode. If your environment does not allow using `macvlan` then you need to change the multus definations. + +## Introduction + +OAI-SMF follows 3GPP release 16, more information about the feature set can be found on [SMFs WiKi page](https://gitlab.eurecom.fr/oai/cn5g/oai-cn5g-amf/-/wikis/home). The source code be downloaded from [GitLab](https://gitlab.eurecom.fr/oai/cn5g/oai-cn5g-amf) + +OAI [Jenkins Platform](https://jenkins-oai.eurecom.fr/job/OAI-CN5G-SMF/) publishes every `develop` and `master` branch image of OAI-SMF on [docker-hub](https://hub.docker.com/r/oaisoftwarealliance/oai-smf) with tag `develop` and `latest` respectively. Apart from that you can find tags for every release `VX.X.X`. We only publish Ubuntu 18.04/20.04/22.04 images. We do not publish RedHat/UBI images. These images you have to build from the source code on your RedHat systems or Openshift Platform. You can follow this [tutorial](../../../openshift/README.md) for that. + +The helm chart of OAI-SMF creates multiples Kubernetes resources, + +1. Service +2. Role Base Access Control (RBAC) (role and role bindings) +3. Deployment +4. Configmap (Contains the configuration file for SMF) +5. Service account +6. Network-attachment-definition (Optional only when multus is used) + +The directory structure + +``` +├── Chart.yaml +├── README.md +├── templates +│  ├── configmap.yaml +│  ├── deployment.yaml +│  ├── _helpers.tpl +│  ├── multus.yaml +│  ├── NOTES.txt +│  ├── rbac.yaml +│  ├── serviceaccount.yaml +│  └── service.yaml +└── values.yaml (Parent file contains all the configurable parameters) +``` + +## Parameters + +[Values.yaml](./values.yaml) contains all the configurable parameters. Below table defines the configurable parameters. + + + +|Parameter |Allowed Values |Remark | +|--------------------------------|-------------------------------|-------------------------------------| +|kubernetesType |Vanilla/Openshift |Vanilla Kubernetes or Openshift | +|nfimage.repository |Image Name | | +|nfimage.version |Image tag | | +|nfimage.pullPolicy |IfNotPresent or Never or Always| | +|imagePullSecrets.name |String |Good to use for docker hub | +|serviceAccount.create |true/false | | +|serviceAccount.annotations |String | | +|serviceAccount.name |String | | +|podSecurityContext.runAsUser |Integer (0,65534) |Mandatory to use 0 | +|podSecurityContext.runAsGroup |Integer (0,65534) |Mandatory to use 0 | +|multus.create |true/false |default false | +|multus.n4Interface.create |true/false | | +|multus.n4Interface.Ipadd |Ip-Address | | +|multus.n4Interface.Netmask |Netmask | | +|multus.n4Interface.Gateway |Ip-Address | | +|multus.n4Interface.routes |Json |Routes if you want to add in your pod| +|multus.n4Interface.hostInterface|host interface |Host interface on which pod will run | +|multus.defaultGateway |Ip-Address |Default route inside pod | + + +## Advanced Debugging Parameters + +Only needed if you are doing advanced debugging + +|Parameter |Allowed Values |Remark | +|---------------------------------|-------------------------------|----------------------------------------------| +|start.smf |true/false |If true smf container will go in sleep mode | +|start.tcpdump |true/false |If true tcpdump container will go in sleepmode| +|includeTcpDumpContainer |true/false |If false no tcpdump container will be there | +|tcpdumpimage.repository |Image Name | | +|tcpdumpimage.version |Image tag | | +|tcpdumpimage.pullPolicy |IfNotPresent or Never or Always| | +|persistent.sharedvolume |true/false |Save the pcaps in a shared volume with NRF | +|resources.define |true/false | | +|resources.limits.tcpdump.cpu |string |Unit m for milicpu or cpu | +|resources.limits.tcpdump.memory |string |Unit Mi/Gi/MB/GB | +|resources.limits.nf.cpu |string |Unit m for milicpu or cpu | +|resources.limits.nf.memory |string |Unit Mi/Gi/MB/GB | +|resources.requests.tcpdump.cpu |string |Unit m for milicpu or cpu | +|resources.requests.tcpdump.memory|string |Unit Mi/Gi/MB/GB | +|resources.requests.nf.cpu |string |Unit m for milicpu or cpu | +|resources.requests.nf.memory |string |Unit Mi/Gi/MB/GB | +|readinessProbe |true/false |default true | +|livenessProbe |true/false |default false | +|terminationGracePeriodSeconds |5 |In seconds (default 5) | +|nodeSelector |Node label | | +|nodeName |Node Name | | + + +## Installation + +Better to use the parent charts from: + +1. [oai-5g-basic](../oai-5g-basic/README.md) for basic deployment of OAI-5G Core +2. [oai-5g-mini](../oai-5g-mini/README.md) for mini deployment (AMF, SMF, NRF, UPF) of OAI-5G Core. In this type of deployment AMF plays the role of AUSF and UDR +3. [oai-5g-slicing](../oai-5g-slicing/README.md) for basic deployment with NSSF extra + +## Note + +1. If you are using multus then make sure it is properly configured and if you don't have a gateway for your multus interface then avoid using gateway and defaultGateway parameter. Either comment them or leave them empty. Wrong gateway configuration can create issues with pod networking and pod will not be able to resolve service names. +2. If you are using tcpdump container to take pcaps automatically (`start.tcpdump` is true) you can enable `persistent.sharedvolume` and [presistent volume](./oai-nrf/values.yaml) in NRF. To store the pcaps of all the NFs in one location. It is to ease the automated collection of pcaps. \ No newline at end of file diff --git a/charts/oai-5g-core/oai-smf/templates/configmap.yaml b/charts/oai-5g-core/oai-smf/templates/configmap.yaml index e0dcc1e8af854ce50499b08ddd41794fa17a6c23..5e773d980a5ffeca9349e619ee0d6b6c02a7c767 100644 --- a/charts/oai-5g-core/oai-smf/templates/configmap.yaml +++ b/charts/oai-5g-core/oai-smf/templates/configmap.yaml @@ -7,26 +7,31 @@ data: SMF = { FQDN = "oai-smf"; - INSTANCE = 0; # 0 is the default - PID_DIRECTORY = "/var/run"; # /var/run is the default + INSTANCE = 0; + PID_DIRECTORY = "/var/run"; + LOG_LEVEL = "{{ .Values.config.logLevel }}" INTERFACES : { N4 : { # SMF binded interface for N4 communication (UPF) - INTERFACE_NAME = "{{ .Values.config.smfInterfaceNameForN4 }}"; # YOUR NETWORK CONFIG HERE + INTERFACE_NAME = "{{ .Values.config.smfInterfaceNameForN4 }}"; IPV4_ADDRESS = "read"; }; SBI : { # SMF binded interface for SBI interface (e.g., communication with AMF, UDM) - INTERFACE_NAME = "{{ .Values.config.smfInterfaceNameForSBI }}"; # YOUR NETWORK CONFIG HERE + # YOUR NETWORK CONFIG HERE + INTERFACE_NAME = "{{ .Values.config.smfInterfaceNameForSBI }}"; IPV4_ADDRESS = "read"; - PORT = {{ .Values.config.smfInterfacePortForSBI }}; # YOUR NETWORK CONFIG HERE (default: 80) - HTTP2_PORT = {{ .Values.config.smfInterfaceHttp2PortForSBI }}; # YOUR NETWORK CONFIG HERE - API_VERSION = "{{ .Values.config.smfApiVersion }}"; # YOUR SMF API VERSION CONFIG HERE + # YOUR NETWORK CONFIG HERE (default: 80) + PORT = {{ .Values.config.smfInterfacePortForSBI }}; + # YOUR NETWORK CONFIG HERE (default: 8080) + HTTP2_PORT = {{ .Values.config.smfInterfaceHttp2PortForSBI }}; + # YOUR SMF API VERSION CONFIG HERE (default: v1) + API_VERSION = "{{ .Values.config.smfApiVersion }}"; }; }; @@ -37,27 +42,48 @@ data: DNN_LIST = ( # PDU_SESSION_TYPE choice in {IPv4, IPv6, IPv4v6} # DNN IP ADDRESS RANGE format is for example: "12.2.1.2 - 12.2.1.128" - {DNN_NI = "{{ .Values.config.dnnNi0 }}"; PDU_SESSION_TYPE = "{{ .Values.config.pdusessiontype0 }}"; IPV4_RANGE = "{{ .Values.config.ipv4dnnRange0 }}"; IPV6_PREFIX = "2001:1:2::/64"} + { + DNN_NI = "{{ .Values.config.dnnNi0 }}"; + PDU_SESSION_TYPE = "{{ .Values.config.pdusessiontype0 }}"; + IPV4_RANGE = "{{ .Values.config.ipv4dnnRange0 }}"; + IPV6_PREFIX = "2001:1:2::/64" + } {{- if .Values.config.dnnNi1}} - ,{DNN_NI = "{{ .Values.config.dnnNi1 }}"; PDU_SESSION_TYPE = "{{ .Values.config.pdusessiontype1 }}"; IPV4_RANGE = "{{ .Values.config.ipv4dnnRange1 }}"; IPV6_PREFIX = "3001:1:2::/64"} + ,{ + DNN_NI = "{{ .Values.config.dnnNi1 }}"; + PDU_SESSION_TYPE = "{{ .Values.config.pdusessiontype1 }}"; + IPV4_RANGE = "{{ .Values.config.ipv4dnnRange1 }}"; + IPV6_PREFIX = "3001:1:2::/64" + } {{- end }} {{- if .Values.config.dnnNi2}} - ,{DNN_NI = "{{ .Values.config.dnnNi2 }}"; PDU_SESSION_TYPE = "{{ .Values.config.pdusessiontype2 }}"; IPV4_RANGE = "{{ .Values.config.ipv4dnnRange2 }}"; IPV6_PREFIX = "4001:1:2::/64"} + ,{ + DNN_NI = "{{ .Values.config.dnnNi2 }}"; + PDU_SESSION_TYPE = "{{ .Values.config.pdusessiontype2 }}"; + IPV4_RANGE = "{{ .Values.config.ipv4dnnRange2 }}"; + IPV6_PREFIX = "4001:1:2::/64" + } {{- end }} {{- if .Values.config.dnnNi3}} - {DNN_NI = "{{ .Values.config.dnnNi3 }}"; PDU_SESSION_TYPE = "{{ .Values.config.pdusessiontype3 }}"; IPV4_RANGE = "{{ .Values.config.ipv4dnnRange3 }}"; IPV6_PREFIX = "5001:1:2::/64"} + { + DNN_NI = "{{ .Values.config.dnnNi3 }}"; + PDU_SESSION_TYPE = "{{ .Values.config.pdusessiontype3 }}"; + IPV4_RANGE = "{{ .Values.config.ipv4dnnRange3 }}"; + IPV6_PREFIX = "5001:1:2::/64" + } {{- end }} ); # DNS address communicated to UEs - DEFAULT_DNS_IPV4_ADDRESS = "{{ .Values.config.dnsIpv4Address }}"; # YOUR DNS CONFIG HERE - DEFAULT_DNS_SEC_IPV4_ADDRESS = "{{ .Values.config.dnsSecIpv4Address }}"; # YOUR DNS CONFIG HERE + # YOUR DNS CONFIG HERE + DEFAULT_DNS_IPV4_ADDRESS = "{{ .Values.config.dnsIpv4Address }}"; + DEFAULT_DNS_SEC_IPV4_ADDRESS = "{{ .Values.config.dnsSecIpv4Address }}"; # IPV6 tunnels are not supported - DEFAULT_DNS_IPV6_ADDRESS = "2001:4860:4860::8888"; # YOUR DNS CONFIG HERE - DEFAULT_DNS_SEC_IPV6_ADDRESS = "2001:4860:4860::8844"; # YOUR DNS CONFIG HERE + DEFAULT_DNS_IPV6_ADDRESS = "2001:4860:4860::8888"; + DEFAULT_DNS_SEC_IPV6_ADDRESS = "2001:4860:4860::8844"; #Default P-CSCF server - DEFAULT_CSCF_IPV4_ADDRESS = "{{ .Values.config.defaultCSCFIpv4Address }}"; + DEFAULT_CSCF_IPV4_ADDRESS = "{{ .Values.config.defaultCSCFIpv4Address }}"; DEFAULT_CSCF_IPV6_ADDRESS = "fe80::7915:f408:1787:db8b"; #Default UE MTU @@ -67,20 +93,32 @@ data: SUPPORT_FEATURES: { # STRING, {"yes", "no"}, - REGISTER_NRF = "{{ .Values.config.registerNrf }}"; # Set to yes if SMF resgisters to an NRF - DISCOVER_UPF = "{{ .Values.config.discoverUpf }}"; # Set to yes to enable UPF discovery and selection - DISCOVER_PCF = "{{ .Values.config.discoverPcf }}"; # Set to yes to enable PCF discovery and selection - FORCE_PUSH_PROTOCOL_CONFIGURATION_OPTIONS = "no"; # Non standard feature, normally should be set to "no", - # but you may need to set to yes for UE that do not explicitly request a PDN address through NAS signalling - USE_LOCAL_SUBSCRIPTION_INFO = "{{ .Values.config.useLocalSubscriptionInfo }}"; # Set to yes if SMF uses local subscription information instead of from an UDM - USE_LOCAL_PCC_RULES = "{{ .Values.config.useLocalPCCRules }}"; # Set to yes if SMF uses local PCC rules instead of from an PCF - USE_FQDN_DNS = "{{ .Values.config.useFqdnDns }}"; # Set to yes if AMF/UDM/NRF/UPF will relying on a DNS to resolve FQDN - HTTP_VERSION = {{ .Values.config.httpVersion }}; # Default: 1 + # Set to yes if SMF resgisters to an NRF + REGISTER_NRF = "{{ .Values.config.registerNrf }}"; + # Set to yes to enable UPF discovery and selection + DISCOVER_UPF = "{{ .Values.config.discoverUpf }}"; + # Set to yes to enable PCF discovery and selection + DISCOVER_PCF = "{{ .Values.config.discoverPcf }}"; + # Non standard feature, normally should be set to "no", + # but you may need to set to yes for UE that do not explicitly request a PDN address through NAS signalling + FORCE_PUSH_PROTOCOL_CONFIGURATION_OPTIONS = "no"; + # Set to yes if SMF uses local subscription information instead of from an UDM + USE_LOCAL_SUBSCRIPTION_INFO = "{{ .Values.config.useLocalSubscriptionInfo }}"; + # Set to yes if SMF uses local PCC rules instead of from an PCF + USE_LOCAL_PCC_RULES = "{{ .Values.config.useLocalPCCRules }}"; + # Set to yes if AMF/UDM/NRF/UPF will relying on a DNS to resolve FQDN + USE_FQDN_DNS = "{{ .Values.config.useFqdnDns }}"; + # Default: 1 + HTTP_VERSION = {{ .Values.config.httpVersion }}; {{- if .Values.config.upfSpgwu}} ENABLE_USAGE_REPORTING = "no" # Set yes if UE USAGE REPORTING is to be done at UPF {{- else }} ENABLE_USAGE_REPORTING = "yes" # Set yes if UE USAGE REPORTING is to be done at UPF {{- end }} + # Set yes if Downlink PDR is to be included in PFCP session establishment message + ENABLE_DL_PDR_IN_PFCP_SESS_ESTAB = "{{ .Values.config.useDlPdrInPfcpSessEsta }}"; + # Set N3_LOCAL_IPV4_ADDRESS for SD-Fabric UPF + N3_LOCAL_IPV4_ADDRESS = "{{ .Values.config.localN3Ipv4Address }}"; } AMF : @@ -124,41 +162,77 @@ data: LOCAL_CONFIGURATION : { SESSION_MANAGEMENT_SUBSCRIPTION_LIST = ( - { NSSAI_SST = {{ .Values.config.nssaiSst0 }},DNN = "{{ .Values.config.dnnNi0 }}", DEFAULT_SESSION_TYPE = "{{ .Values.config.pdusessiontype0 }}", DEFAULT_SSC_MODE = 1, - QOS_PROFILE_5QI = {{ .Values.config.qosProfile5qi0 }}, QOS_PROFILE_PRIORITY_LEVEL = 1, QOS_PROFILE_ARP_PRIORITY_LEVEL = 15, QOS_PROFILE_ARP_PREEMPTCAP = "NOT_PREEMPT", - QOS_PROFILE_ARP_PREEMPTVULN = "NOT_PREEMPTABLE", SESSION_AMBR_UL = "{{ .Values.config.sessionAmbrUl0 }}", SESSION_AMBR_DL = "{{ .Values.config.sessionAmbrDl0 }}" + { + NSSAI_SST = {{ .Values.config.nssaiSst0 }}, {{- if .Values.config.nssaiSd0}} - ,NSSAI_SD = "{{ .Values.config.nssaiSd0 }}" + NSSAI_SD = "{{ .Values.config.nssaiSd0 }}", {{- end }} + DNN = "{{ .Values.config.dnnNi0 }}", + DEFAULT_SESSION_TYPE = "{{ .Values.config.pdusessiontype0 }}", + DEFAULT_SSC_MODE = 1, + QOS_PROFILE_5QI = {{ .Values.config.qosProfile5qi0 }}, + QOS_PROFILE_PRIORITY_LEVEL = 1, + QOS_PROFILE_ARP_PRIORITY_LEVEL = 15, + QOS_PROFILE_ARP_PREEMPTCAP = "NOT_PREEMPT", + QOS_PROFILE_ARP_PREEMPTVULN = "NOT_PREEMPTABLE", + SESSION_AMBR_UL = "{{ .Values.config.sessionAmbrUl0 }}", + SESSION_AMBR_DL = "{{ .Values.config.sessionAmbrDl0 }}" } {{- if .Values.config.dnnNi1}} - ,{ NSSAI_SST = {{ .Values.config.nssaiSst1 }},DNN = "{{ .Values.config.dnnNi1 }}", DEFAULT_SESSION_TYPE = "{{ .Values.config.pdusessiontype1 }}", DEFAULT_SSC_MODE = 1, - QOS_PROFILE_5QI = {{ .Values.config.qosProfile5qi1 }}, QOS_PROFILE_PRIORITY_LEVEL = 1, QOS_PROFILE_ARP_PRIORITY_LEVEL = 15, QOS_PROFILE_ARP_PREEMPTCAP = "NOT_PREEMPT", - QOS_PROFILE_ARP_PREEMPTVULN = "NOT_PREEMPTABLE", SESSION_AMBR_UL = "{{ .Values.config.sessionAmbrUl1 }}", SESSION_AMBR_DL = "{{ .Values.config.sessionAmbrDl1 }}" + ,{ + NSSAI_SST = {{ .Values.config.nssaiSst1 }}, {{- if .Values.config.nssaiSd1}} - ,NSSAI_SD = "{{ .Values.config.nssaiSd1 }}" + NSSAI_SD = "{{ .Values.config.nssaiSd1 }}", {{- end }} + DNN = "{{ .Values.config.dnnNi1 }}", + DEFAULT_SESSION_TYPE = "{{ .Values.config.pdusessiontype1 }}", + DEFAULT_SSC_MODE = 1, + QOS_PROFILE_5QI = {{ .Values.config.qosProfile5qi1 }}, + QOS_PROFILE_PRIORITY_LEVEL = 1, + QOS_PROFILE_ARP_PRIORITY_LEVEL = 15, + QOS_PROFILE_ARP_PREEMPTCAP = "NOT_PREEMPT", + QOS_PROFILE_ARP_PREEMPTVULN = "NOT_PREEMPTABLE", + SESSION_AMBR_UL = "{{ .Values.config.sessionAmbrUl1 }}", + SESSION_AMBR_DL = "{{ .Values.config.sessionAmbrDl1 }}" } {{- end }} {{- if .Values.config.dnnNi2}} - ,{ NSSAI_SST = {{ .Values.config.nssaiSst2 }},DNN = "{{ .Values.config.dnnNi2 }}", DEFAULT_SESSION_TYPE = "{{ .Values.config.pdusessiontype2 }}", DEFAULT_SSC_MODE = 1, - QOS_PROFILE_5QI = {{ .Values.config.qosProfile5qi2 }}, QOS_PROFILE_PRIORITY_LEVEL = 1, QOS_PROFILE_ARP_PRIORITY_LEVEL = 15, QOS_PROFILE_ARP_PREEMPTCAP = "NOT_PREEMPT", - QOS_PROFILE_ARP_PREEMPTVULN = "NOT_PREEMPTABLE", SESSION_AMBR_UL = "{{ .Values.config.sessionAmbrUl2 }}", SESSION_AMBR_DL = "{{ .Values.config.sessionAmbrDl2 }}" + ,{ + NSSAI_SST = {{ .Values.config.nssaiSst2 }}, {{- if .Values.config.nssaiSd2}} - ,NSSAI_SD = "{{ .Values.config.nssaiSd2 }}" + NSSAI_SD = "{{ .Values.config.nssaiSd2 }}", {{- end }} + DNN = "{{ .Values.config.dnnNi2 }}", + DEFAULT_SESSION_TYPE = "{{ .Values.config.pdusessiontype2 }}", + DEFAULT_SSC_MODE = 1, + QOS_PROFILE_5QI = {{ .Values.config.qosProfile5qi2 }}, + QOS_PROFILE_PRIORITY_LEVEL = 1, + QOS_PROFILE_ARP_PRIORITY_LEVEL = 15, + QOS_PROFILE_ARP_PREEMPTCAP = "NOT_PREEMPT", + QOS_PROFILE_ARP_PREEMPTVULN = "NOT_PREEMPTABLE", + SESSION_AMBR_UL = "{{ .Values.config.sessionAmbrUl2 }}", + SESSION_AMBR_DL = "{{ .Values.config.sessionAmbrDl2 }}" } {{- end }} {{- if .Values.config.dnnNi3}} - ,{ NSSAI_SST = {{ .Values.config.nssaiSst3 }},DNN = "{{ .Values.config.dnnNi3 }}", DEFAULT_SESSION_TYPE = "{{ .Values.config.pdusessiontype3 }}", DEFAULT_SSC_MODE = 1, - QOS_PROFILE_5QI = {{ .Values.config.qosProfile5qi3 }}, QOS_PROFILE_PRIORITY_LEVEL = 1, QOS_PROFILE_ARP_PRIORITY_LEVEL = 15, QOS_PROFILE_ARP_PREEMPTCAP = "NOT_PREEMPT", - QOS_PROFILE_ARP_PREEMPTVULN = "NOT_PREEMPTABLE", SESSION_AMBR_UL = "{{ .Values.config.sessionAmbrUl3 }}", SESSION_AMBR_DL = "{{ .Values.config.sessionAmbrDl3 }}" + ,{ + NSSAI_SST = {{ .Values.config.nssaiSst3 }}, {{- if .Values.config.nssaiSd3}} - ,NSSAI_SD = "{{ .Values.config.nssaiSd3 }}" + NSSAI_SD = "{{ .Values.config.nssaiSd3 }}", {{- end }} + DNN = "{{ .Values.config.dnnNi3 }}", + DEFAULT_SESSION_TYPE = "{{ .Values.config.pdusessiontype3 }}", + DEFAULT_SSC_MODE = 1, + QOS_PROFILE_5QI = {{ .Values.config.qosProfile5qi3 }}, + QOS_PROFILE_PRIORITY_LEVEL = 1, + QOS_PROFILE_ARP_PRIORITY_LEVEL = 15, + QOS_PROFILE_ARP_PREEMPTCAP = "NOT_PREEMPT", + QOS_PROFILE_ARP_PREEMPTVULN = "NOT_PREEMPTABLE", + SESSION_AMBR_UL = "{{ .Values.config.sessionAmbrUl3 }}", + SESSION_AMBR_DL = "{{ .Values.config.sessionAmbrDl3 }}" } {{- end }} ); }; - }; \ No newline at end of file + }; diff --git a/charts/oai-5g-core/oai-smf/templates/deployment.yaml b/charts/oai-5g-core/oai-smf/templates/deployment.yaml index 406502483569a65296034fc8d482c7093f01e829..f0009b796cba479a734f2cd8e5d1bd519a1e3b39 100644 --- a/charts/oai-5g-core/oai-smf/templates/deployment.yaml +++ b/charts/oai-5g-core/oai-smf/templates/deployment.yaml @@ -15,12 +15,18 @@ spec: metadata: labels: {{- include "oai-smf.selectorLabels" . | nindent 8 }} - {{- if .Values.multus.create }} + {{- if .Values.multus.n4Interface.create }} annotations: k8s.v1.cni.cncf.io/networks: >- [{ - "name": "{{ .Chart.Name }}-n4-net1", - "default-route": ["{{ .Values.multus.n4Gateway }}"] + "name": "{{ .Chart.Name }}-n4", + "interface": "n4" + {{- if .Values.multus.defaultGateway }} + ,"default-route": ["{{ .Values.multus.defaultGateway }}"] + {{- end }} + {{- if .Values.multus.n4Interface.Gateway }} + ,"gateway": "{{ .Values.multus.n4Interface.Gateway }}" + {{- end }} }] {{- end }} spec: @@ -37,43 +43,50 @@ spec: {{ toYaml .Values.imagePullSecrets | indent 8 }} {{- end }} containers: + {{- if .Values.includeTcpDumpContainer }} - name: tcpdump image: "{{ .Values.tcpdumpimage.repository }}:{{ .Values.tcpdumpimage.version }}" imagePullPolicy: {{ .Values.tcpdumpimage.pullPolicy }} + {{- if .Values.resources.define}} + resources: + requests: + memory: {{ .Values.resources.requests.tcpdump.memory | quote }} + cpu: {{ .Values.resources.requests.tcpdump.cpu | quote }} + limits: + memory: {{ .Values.resources.limits.tcpdump.memory | quote }} + cpu: {{ .Values.resources.limits.tcpdump.cpu | quote }} + {{- end}} securityContext: - {{- toYaml .Values.securityContext | nindent 12 }} + privileged: true + capabilities: + add: + - NET_ADMIN + drop: + - ALL {{- if .Values.start.tcpdump}} command: - /bin/sh - -c - - /usr/sbin/tcpdump -i any -w /pcap/oai-smf_`date +%Y-%m-%d_%H_%M-%S-%Z`.pcap + - /usr/sbin/tcpdump -i any -w /tmp/pcap/{{ .Chart.Name }}_`date +%Y-%m-%d_%H_%M-%S-%Z`.pcap {{- else}} - {{- if .Values.resources.define}} - resources: - requests: - memory: {{ .Values.resources.tcpdump.requests.memory | quote }} - cpu: {{ .Values.resources.tcpdump.requests.cpu | quote }} - limits: - memory: {{ .Values.resources.tcpdump.limits.memory | quote }} - cpu: {{ .Values.resources.tcpdump.limits.cpu | quote }} - {{- end}} command: - /bin/sleep - infinity {{- end}} + {{- if .Values.includeTcpDumpContainer}} {{- if .Values.persistent.sharedvolume}} volumeMounts: - - mountPath: "/pcap" + - mountPath: "/tmp/pcap" name: cn5g-pvc {{- end}} + {{- end}} + {{- end }} - name: smf image: "{{ .Values.nfimage.repository }}:{{ .Values.nfimage.version }}" imagePullPolicy: {{ .Values.nfimage.pullPolicy }} volumeMounts: - mountPath: /openair-smf/etc name: configuration - securityContext: - {{- toYaml .Values.securityContext | nindent 12 }} {{- if .Values.readinessProbe}} readinessProbe: exec: @@ -102,11 +115,11 @@ spec: {{- if .Values.resources.define}} resources: requests: - memory: {{ .Values.resources.nf.requests.memory | quote }} - cpu: {{ .Values.resources.nf.requests.cpu | quote }} + memory: {{ .Values.resources.requests.nf.memory | quote }} + cpu: {{ .Values.resources.requests.nf.cpu | quote }} limits: - memory: {{ .Values.resources.nf.limits.memory | quote }} - cpu: {{ .Values.resources.nf.limits.cpu | quote }} + memory: {{ .Values.resources.limits.nf.memory | quote }} + cpu: {{ .Values.resources.limits.nf.cpu | quote }} {{- end}} {{- if .Values.start.smf}} command: @@ -120,11 +133,13 @@ spec: - infinity {{- end}} volumes: + {{- if .Values.includeTcpDumpContainer}} {{- if .Values.persistent.sharedvolume}} - name: cn5g-pvc persistentVolumeClaim: claimName: cn5g-pvc {{- end }} + {{- end }} - configMap: name: {{ .Chart.Name }}-configmap name: configuration diff --git a/charts/oai-5g-core/oai-smf/templates/multus.yaml b/charts/oai-5g-core/oai-smf/templates/multus.yaml index 6a013838590a9f5102b43ac4dfff42f74c192f62..cadb6d02e83f12d035cde67767f332e26eb7e677 100644 --- a/charts/oai-5g-core/oai-smf/templates/multus.yaml +++ b/charts/oai-5g-core/oai-smf/templates/multus.yaml @@ -1,23 +1,26 @@ --- -{{- if .Values.multus.create }} +{{- if .Values.multus.n4Interface.create }} apiVersion: "k8s.cni.cncf.io/v1" -kind: NetworkAttachmentDefinition +kind: NetworkAttachmentDefinition metadata: - name: {{ .Chart.Name }}-n4-net1 + name: {{ .Chart.Name }}-n2 spec: - config: '{ - "cniVersion": "0.3.0", + config: '{ + "cniVersion": "0.3.1", "type": "macvlan", - "master": {{- cat .Values.multus.hostInterface | nospace | quote }}, + "master": {{- cat .Values.multus.n4Interface.hostInterface | nospace | quote }}, "mode": "bridge", "ipam": { "type": "static", "addresses": [ { - "address": {{- cat .Values.multus.n4IPadd "/" .Values.multus.n4Netmask | nospace | quote }}, - "gateway": "{{ .Values.multus.n4Gateway }}" + "address": {{- cat .Values.multus.n4Interface.Ipadd "/" .Values.multus.n4Interface.Netmask | nospace | quote }} } ] + {{- if .Values.multus.n4Interface.routes }} + ,"routes": {{- .Values.multus.n4Interface.routes | toJson }} + {{- end }} } }' {{- end }} +--- \ No newline at end of file diff --git a/charts/oai-5g-core/oai-smf/templates/rbac.yaml b/charts/oai-5g-core/oai-smf/templates/rbac.yaml index b8369fac5cf4493cad7e51582eb33d5a6aede5e7..e218d4fcd61c95de8f1aea047c38b3b0a4c81ade 100644 --- a/charts/oai-5g-core/oai-smf/templates/rbac.yaml +++ b/charts/oai-5g-core/oai-smf/templates/rbac.yaml @@ -7,7 +7,7 @@ metadata: rules: - apiGroups: - security.openshift.io -{{- if .Values.securityContext.privileged }} +{{- if .Values.includeTcpDumpContainer }} resourceNames: - privileged {{- else }} @@ -31,4 +31,4 @@ roleRef: kind: Role name: {{ .Chart.Name }}-{{ .Release.Namespace }}-role apiGroup: rbac.authorization.k8s.io -{{- end }} \ No newline at end of file +{{- end }} diff --git a/charts/oai-5g-core/oai-smf/values.yaml b/charts/oai-5g-core/oai-smf/values.yaml index 27963e48d67e473fc4cce36cc16753d222b0b3ba..308d2a2518dcc6ec11a82320bb2d86ac20c25da2 100644 --- a/charts/oai-5g-core/oai-smf/values.yaml +++ b/charts/oai-5g-core/oai-smf/values.yaml @@ -1,14 +1,10 @@ -kubernetesType: Vanilla #Vanilla for community kubernetes distribution +kubernetesType: Vanilla #Vanilla for community kubernetes distribution else Openshift for Openshift +## In case of using these charts on Openshift then please use UBI images +## To know more about them follow this tutorial https://gitlab.eurecom.fr/oai/cn5g/oai-cn5g-fed/-/tree/master/openshift nfimage: repository: docker.io/oaisoftwarealliance/oai-smf # dockerhub oaisoftwarealliance/oai-smf - version: v1.5.0 #image tag, develop tag for experimental features - #pullPolicy: IfNotPresent or Never or Always - pullPolicy: IfNotPresent - -tcpdumpimage: - repository: docker.io/corfr/tcpdump - version: latest + version: develop #image tag, develop tag for experimental features #pullPolicy: IfNotPresent or Never or Always pullPolicy: IfNotPresent @@ -27,16 +23,8 @@ podSecurityContext: runAsUser: 0 runAsGroup: 0 -securityContext: - privileged: false # Make it true only if you want to capture packets inside tcpdump container - #service type is fixed to clusterIP, it is only support for non multus interface (eth0) -# Just for debugging -start: - smf: true - tcpdump: false #start tcpdump collection to analyse but beware it will take a lot of space in the container/persistent volume - # SMF needs two seperate interface one for http and other one for N4 to communicate with UPD. # But for experimentation only one interface can be used. # When you need multus: @@ -44,15 +32,22 @@ start: # 2. Your UPF is outside the cluster and the host machine can communicate but pods can not then you can provide ip-address in the same range as your host machine # 3. You want static ip-address for N4 interface, Namf can be discovered by its service name +## Change these ip-addresses according to your environment multus: - create: false - n4IPadd: "172.21.6.202" - n4Netmask: "22" - n4Gateway: "172.21.7.254" - hostInterface: "bond0" # Interface of the host machine on which this pod will be scheduled + ## If you don't want to add a default route in your pod then leave this field empty + defaultGateway: "172.21.7.254" + n4Interface: + create: false + Ipadd: "172.21.6.202" + Netmask: "22" + ## If you do not have a gateway leave the field empty + Gateway: "172.21.7.254" + ## If you do not want to add any routes in your pod then leave this field empty + #routes: [{'dst': '10.8.0.0/24','gw': '172.21.7.254'}, {'dst': '10.9.0.0/24','gw': '172.21.7.254'}] + hostInterface: "bond0" config: - smfInterfaceNameForN4: "eth0" # net1 if multus creation is true else eth0 + smfInterfaceNameForN4: "eth0" # if multus.n4Interface.create is true then n4 else eth0 smfInterfaceNameForSBI: "eth0" smfInterfacePortForSBI: 80 smfInterfaceHttp2PortForSBI: 8080 @@ -93,35 +88,53 @@ config: sessionAmbrDl1: "1000Mbps" -## currently only used by tcpdump container to store the tcpdump, this volume will be shared between all the network functions (If true it should be true for all the NFs specially NRF) -persistent: - sharedvolume: false # should be true when if wants to store the tcpdump of all the network functions at same place - volumneName: managed-nfs-storage - size: 1Gi +## Debugging section +start: + smf: true #If false the network function container will run in sleep mode for manually testing + tcpdump: true + +includeTcpDumpContainer: false #If true it will add a tcpdump container inside network function pod for debugging + +## For openshift you can use rhel8/support-tools:8.7-13 +tcpdumpimage: + repository: docker.io/corfr/tcpdump + version: latest + #pullPolicy: IfNotPresent or Never or Always + pullPolicy: IfNotPresent +#To store PCAP of NF in a sharedVolume so it can be easily fetched (PVC is created with NRF charts so make sure in NRF it is true) +persistent: + sharedvolume: true +## NF is the network function and tcpdump is the tcpdump container. +## To know more about request and limit it is better to understand that how Kubernetes QoS works. +## https://kubernetes.io/docs/concepts/configuration/manage-resources-containers +## https://kubernetes.io/docs/concepts/workloads/pods/pod-qos resources: define: false limits: - tcpdump: - cpu: 100m - memory: 128Mi nf: cpu: 100m memory: 128Mi - requests: + #If tcpdump container is disabled this value will not be used tcpdump: cpu: 100m memory: 128Mi + requests: nf: cpu: 100m memory: 128Mi + #If tcpdump container is disabled this value will not be used + tcpdump: + cpu: 100m + memory: 128Mi readinessProbe: true + livenessProbe: false terminationGracePeriodSeconds: 5 nodeSelector: {} -nodeName: +nodeName: diff --git a/charts/oai-5g-core/oai-spgwu-tiny/Chart.yaml b/charts/oai-5g-core/oai-spgwu-tiny/Chart.yaml index 34fde719b603f1d14b5d67175f86ec8973c2eb1a..64578b89fed56ec037074e1045296a0d83b420bc 100644 --- a/charts/oai-5g-core/oai-spgwu-tiny/Chart.yaml +++ b/charts/oai-5g-core/oai-spgwu-tiny/Chart.yaml @@ -26,9 +26,9 @@ type: application icon: http://www.openairinterface.org/wp-content/uploads/2015/06/cropped-oai_final_logo.png -version: v1.5.0 +version: v1.5.1 -appVersion: v1.5.0 +appVersion: develop-v1.5.1 keywords: - EPC diff --git a/charts/oai-5g-core/oai-spgwu-tiny/README.md b/charts/oai-5g-core/oai-spgwu-tiny/README.md new file mode 100644 index 0000000000000000000000000000000000000000..d9b794b0ab7926ef09dc64922bcd3f439c64ae9c --- /dev/null +++ b/charts/oai-5g-core/oai-spgwu-tiny/README.md @@ -0,0 +1,118 @@ +# Helm Chart for OAI Serving and Packet Data Network Gateway User Plane (SPGW-U) + +The helm-chart is tested on [Minikube](https://minikube.sigs.k8s.io/docs/) and [Red Hat Openshift](https://www.redhat.com/fr/technologies/cloud-computing/openshift) 4.10 and 4.12. There are no special resource requirements for SPGWU except `privileged` flag to be true. SPGWU needs to create tunnel interface for GTP and it creates NAT rules for packets to go towards internet from N6. + +**NOTE**: All the extra interfaces/multus interfaces created inside the pod are using `macvlan` mode. If your environment does not allow using `macvlan` then you need to change the multus definations. + +## Introduction + +[OAI-SPGWU-TINY](https://github.com/OPENAIRINTERFACE/openair-spgwu-tiny) is the 4G CUPS S/PGWU. We modified it to work for 5G deployments with GTP-U extension header. + +OAI [Jenkins Platform](https://jenkins-oai.eurecom.fr/job/OAI-CN-SPGWU-TINY/) publishes every `develop` and `master` branch image of OAI-SPGWU-TINY on [docker-hub](https://hub.docker.com/r/oaisoftwarealliance/oai-spgwu-tiny) with tag `develop` and `latest` respectively. Apart from that you can find tags for every release `VX.X.X`. We only publish Ubuntu 18.04/20.04/22.04 images. We do not publish RedHat/UBI images. These images you have to build from the source code on your RedHat systems or Openshift Platform. You can follow this [tutorial](../../../openshift/README.md) for that. + +The helm chart of OAI-SPGWU-TINY creates multiples Kubernetes resources, + +1. Service +2. Role Base Access Control (RBAC) (role and role bindings) +3. Deployment +4. Configmap (Contains the configuration file for SPGWU) +5. Service account +6. Network-attachment-definition (Optional only when multus is used) + +The directory structure + +``` +├── Chart.yaml +├── README.md +├── templates +│  ├── configmap.yaml +│  ├── deployment.yaml +│  ├── _helpers.tpl +│  ├── multus.yaml +│  ├── NOTES.txt +│  ├── rbac.yaml +│  ├── serviceaccount.yaml +│  └── service.yaml +└── values.yaml (Parent file contains all the configurable parameters) +``` + +## Parameters + +[Values.yaml](./values.yaml) contains all the configurable parameters. Below table defines the configurable parameters. + + +|Parameter |Allowed Values |Remark | +|--------------------------------|-------------------------------|-------------------------------------| +|kubernetesType |Vanilla/Openshift |Vanilla Kubernetes or Openshift | +|nfimage.repository |Image Name | | +|nfimage.version |Image tag | | +|nfimage.pullPolicy |IfNotPresent or Never or Always| | +|imagePullSecrets.name |String |Good to use for docker hub | +|serviceAccount.create |true/false | | +|serviceAccount.annotations |String | | +|serviceAccount.name |String | | +|podSecurityContext.runAsUser |Integer (0,65534) | | +|podSecurityContext.runAsGroup |Integer (0,65534) | | +|multus.n3Interface.create |true/false | | +|multus.n3Interface.Ipadd |Ip-Address | | +|multus.n3Interface.Netmask |Netmask | | +|multus.n3Interface.Gateway |Ip-Address | | +|multus.n3Interface.routes |Json |Routes if you want to add in your pod| +|multus.n3Interface.hostInterface|host interface |Host interface on which pod will run | +|multus.n4Interface.create |true/false | | +|multus.n4Interface.Ipadd |Ip-Address | | +|multus.n4Interface.Netmask |Netmask | | +|multus.n4Interface.Gateway |Ip-Address | | +|multus.n4Interface.routes |Json |Routes if you want to add in your pod| +|multus.n4Interface.hostInterface|host interface |Host interface on which pod will run | +|multus.n6Interface.create |true/false | | +|multus.n6Interface.Ipadd |Ip-Address | | +|multus.n6Interface.Netmask |Netmask | | +|multus.n6Interface.Gateway |Ip-Address | | +|multus.n6Interface.routes |Json |Routes if you want to add in your pod| +|multus.n6Interface.hostInterface|host interface |Host interface on which pod will run | +|multus.defaultGateway |Ip-Address |Default route inside pod | + + +### Configuration parameter + +All the parameters in `config` block of values.yaml are explained with a comment. + +## Advanced Debugging Parameters + +|Parameter |Allowed Values |Remark | +|---------------------------------|-------------------------------|----------------------------------------------| +|start.spgwu |true/false |If true spgwu container will go in sleep mode | +|start.tcpdump |true/false |If true tcpdump container will go in sleepmode| +|includeTcpDumpContainer |true/false |If false no tcpdump container will be there | +|tcpdumpimage.repository |Image Name | | +|tcpdumpimage.version |Image tag | | +|tcpdumpimage.pullPolicy |IfNotPresent or Never or Always| | +|persistent.sharedvolume |true/false |Save the pcaps in a shared volume with NRF | +|resources.define |true/false | | +|resources.limits.tcpdump.cpu |string |Unit m for milicpu or cpu | +|resources.limits.tcpdump.memory |string |Unit Mi/Gi/MB/GB | +|resources.limits.nf.cpu |string |Unit m for milicpu or cpu | +|resources.limits.nf.memory |string |Unit Mi/Gi/MB/GB | +|resources.requests.tcpdump.cpu |string |Unit m for milicpu or cpu | +|resources.requests.tcpdump.memory|string |Unit Mi/Gi/MB/GB | +|resources.requests.nf.cpu |string |Unit m for milicpu or cpu | +|resources.requests.nf.memory |string |Unit Mi/Gi/MB/GB | +|readinessProbe |true/false |default true | +|livenessProbe |true/false |default false | +|terminationGracePeriodSeconds |5 |In seconds (default 5) | +|nodeSelector |Node label | | +|nodeName |Node Name | | + +## Installation + +Better to use the parent charts from: + +1. [oai-5g-basic](../oai-5g-basic/README.md) for basic deployment of OAI-5G Core +2. [oai-5g-mini](../oai-5g-mini/README.md) for mini deployment (AMF, SMF, NRF, UPF) of OAI-5G Core. In this type of deployment AMF plays the role of AUSF and UDR +3. [oai-5g-slicing](../oai-5g-slicing/README.md) for basic deployment with NSSF extra + +## Note + +1. If you are using multus then make sure it is properly configured and if you don't have a gateway for your multus interface then avoid using gateway and defaultGateway parameter. Either comment them or leave them empty. Wrong gateway configuration can create issues with pod networking and pod will not be able to resolve service names. +2. If you are using tcpdump container to take pcaps automatically (`start.tcpdump` is true) you can enable `persistent.sharedvolume` and [presistent volume](./oai-nrf/values.yaml) in NRF. To store the pcaps of all the NFs in one location. It is to ease the automated collection of pcaps. \ No newline at end of file diff --git a/charts/oai-5g-core/oai-spgwu-tiny/templates/configmap.yaml b/charts/oai-5g-core/oai-spgwu-tiny/templates/configmap.yaml index c54a25fc18d50205a67638024256f8f07ee4cfc7..d39ff8ab528816a28569215328c4ae8ff650b3a8 100644 --- a/charts/oai-5g-core/oai-spgwu-tiny/templates/configmap.yaml +++ b/charts/oai-5g-core/oai-spgwu-tiny/templates/configmap.yaml @@ -10,6 +10,7 @@ data: FQDN = "oai-spgwu-tiny-svc"; # only needed for 4g INSTANCE = 0; # 0 is the default PID_DIRECTORY = "/var/run"; # /var/run is the default + LOG_LEVEL = "{{ .Values.config.logLevel }}" INTERFACES : { diff --git a/charts/oai-5g-core/oai-spgwu-tiny/templates/deployment.yaml b/charts/oai-5g-core/oai-spgwu-tiny/templates/deployment.yaml index 564299bae99b584b68d9bd42ff68d5bd20c44366..77bd50f2c4d784b319ab77bae385eafafbaa561e 100644 --- a/charts/oai-5g-core/oai-spgwu-tiny/templates/deployment.yaml +++ b/charts/oai-5g-core/oai-spgwu-tiny/templates/deployment.yaml @@ -15,13 +15,38 @@ spec: metadata: labels: {{- include "oai-spgwu-tiny.selectorLabels" . | nindent 8 }} - {{- if .Values.multus.create }} + {{- if .Values.multus.n3Interface.create }} annotations: k8s.v1.cni.cncf.io/networks: >- [{ - "name": "{{ .Chart.Name }}-n3-net1", - "default-route": ["{{ .Values.multus.n6Gw }}"] - }] + "name": "{{ .Chart.Name }}-n3", + "interface": "n3" + {{- if .Values.multus.defaultGateway }} + ,"default-route": ["{{ .Values.multus.defaultGateway }}"] + {{- end }} + {{- if .Values.multus.n3Interface.Gateway }} + ,"gateway": "{{ .Values.multus.n3Interface.Gateway }}" + {{- end }} + } + {{- if .Values.multus.n4Interface.create }} + ,{ + "name": "{{ .Chart.Name }}-n4", + "interface": "n4" + {{- if .Values.multus.n4Interface.Gateway }} + ,"gateway": "{{ .Values.multus.n4Interface.Gateway }}" + {{- end }} + } + {{- end }} + {{- if .Values.multus.n6Interface.create }} + ,{ + "name": "{{ .Chart.Name }}-n6", + "interface": "n6" + {{- if .Values.multus.n6Interface.Gateway }} + ,"gateway": "{{ .Values.multus.n6Interface.Gateway }}" + {{- end }} + } + {{- end }} + ] {{- end }} spec: securityContext: @@ -31,35 +56,39 @@ spec: {{ toYaml .Values.imagePullSecrets | indent 8 }} {{- end }} containers: + {{- if .Values.includeTcpDumpContainer }} - name: tcpdump image: "{{ .Values.tcpdumpimage.repository }}:{{ .Values.tcpdumpimage.version }}" imagePullPolicy: {{ .Values.tcpdumpimage.pullPolicy }} + {{- if .Values.resources.define}} + resources: + requests: + memory: {{ .Values.resources.requests.tcpdump.memory | quote }} + cpu: {{ .Values.resources.requests.tcpdump.cpu | quote }} + limits: + memory: {{ .Values.resources.limits.tcpdump.memory | quote }} + cpu: {{ .Values.resources.limits.tcpdump.cpu | quote }} + {{- end}} securityContext: - {{- toYaml .Values.securityContext | nindent 12 }} + {{- toYaml .Values.securityContext | nindent 12 }} {{- if .Values.start.tcpdump}} command: - /bin/sh - -c - - /usr/sbin/tcpdump -i any -w /pcap/{{ .Chart.Name }}_`date +%Y-%m-%d_%H_%M-%S-%Z`.pcap + - /usr/sbin/tcpdump -i any -w /tmp/pcap/{{ .Chart.Name }}_`date +%Y-%m-%d_%H_%M-%S-%Z`.pcap {{- else}} - {{- if .Values.resources.define}} - resources: - requests: - memory: {{ .Values.resources.tcpdump.requests.memory | quote }} - cpu: {{ .Values.resources.tcpdump.requests.cpu | quote }} - limits: - memory: {{ .Values.resources.tcpdump.limits.memory | quote }} - cpu: {{ .Values.resources.tcpdump.limits.cpu | quote }} - {{- end}} command: - /bin/sleep - infinity {{- end}} + {{- if .Values.includeTcpDumpContainer}} {{- if .Values.persistent.sharedvolume}} volumeMounts: - - mountPath: "/pcap" + - mountPath: "/tmp/pcap" name: cn5g-pvc {{- end}} + {{- end}} + {{- end }} - name: spgwu image: "{{ .Values.nfimage.repository }}:{{ .Values.nfimage.version }}" imagePullPolicy: {{ .Values.nfimage.pullPolicy }} @@ -105,18 +134,20 @@ spec: {{- if .Values.resources.define}} resources: requests: - memory: {{ .Values.resources.nf.requests.memory | quote }} - cpu: {{ .Values.resources.nf.requests.cpu | quote }} + memory: {{ .Values.resources.requests.nf.memory | quote }} + cpu: {{ .Values.resources.requests.nf.cpu | quote }} limits: - memory: {{ .Values.resources.nf.limits.memory | quote }} - cpu: {{ .Values.resources.nf.limits.cpu | quote }} + memory: {{ .Values.resources.limits.nf.memory | quote }} + cpu: {{ .Values.resources.limits.nf.cpu | quote }} {{- end}} volumes: + {{- if .Values.includeTcpDumpContainer}} {{- if .Values.persistent.sharedvolume}} - name: cn5g-pvc persistentVolumeClaim: claimName: cn5g-pvc {{- end }} + {{- end }} - configMap: name: {{ .Chart.Name }}-configmap name: configuration diff --git a/charts/oai-5g-core/oai-spgwu-tiny/templates/multus.yaml b/charts/oai-5g-core/oai-spgwu-tiny/templates/multus.yaml index 3d290ccb40cc5d0cd61af8ffefa4a115632cccde..05d57dfc61389063438f4c1c82c061a40a590833 100644 --- a/charts/oai-5g-core/oai-spgwu-tiny/templates/multus.yaml +++ b/charts/oai-5g-core/oai-spgwu-tiny/templates/multus.yaml @@ -1,22 +1,76 @@ --- -{{- if .Values.multus.create }} +{{- if .Values.multus.n3Interface.create }} apiVersion: "k8s.cni.cncf.io/v1" kind: NetworkAttachmentDefinition metadata: - name: {{ .Chart.Name }}-n3-net1 + name: {{ .Chart.Name }}-n3 spec: config: '{ - "cniVersion": "0.3.0", + "cniVersion": "0.3.1", "type": "macvlan", - "master": {{- cat .Values.multus.hostInterface | nospace | quote }}, + "master": {{- cat .Values.multus.n3Interface.hostInterface | nospace | quote }}, "mode": "bridge", "ipam": { "type": "static", "addresses": [ { - "address": {{- cat .Values.multus.n3Ip "/" .Values.multus.n3Netmask | nospace | quote }} + "address": {{- cat .Values.multus.n3Interface.Ipadd "/" .Values.multus.n3Interface.Netmask | nospace | quote }} } ] + {{- if .Values.multus.n3Interface.routes }} + ,"routes": {{- .Values.multus.n3Interface.routes | toJson }} + {{- end }} } }' -{{- end }} \ No newline at end of file +{{- end }} +--- +{{- if .Values.multus.n4Interface.create }} +apiVersion: "k8s.cni.cncf.io/v1" +kind: NetworkAttachmentDefinition +metadata: + name: {{ .Chart.Name }}-n4 +spec: + config: '{ + "cniVersion": "0.3.1", + "type": "macvlan", + "master": {{- cat .Values.multus.n4Interface.hostInterface | nospace | quote }}, + "mode": "bridge", + "ipam": { + "type": "static", + "addresses": [ + { + "address": {{- cat .Values.multus.n4Interface.Ipadd "/" .Values.multus.n4Interface.Netmask | nospace | quote }} + } + ] + {{- if .Values.multus.n4Interface.routes }} + ,"routes": {{- .Values.multus.n4Interface.routes | toJson }} + {{- end }} + } + }' +{{- end }} +--- +{{- if .Values.multus.n6Interface.create }} +apiVersion: "k8s.cni.cncf.io/v1" +kind: NetworkAttachmentDefinition +metadata: + name: {{ .Chart.Name }}-n6 +spec: + config: '{ + "cniVersion": "0.3.1", + "type": "macvlan", + "master": {{- cat .Values.multus.n6Interface.hostInterface | nospace | quote }}, + "mode": "bridge", + "ipam": { + "type": "static", + "addresses": [ + { + "address": {{- cat .Values.multus.n6Interface.Ipadd "/" .Values.multus.n6Interface.Netmask | nospace | quote }} + } + ] + {{- if .Values.multus.n6Interface.routes }} + ,"routes": {{- .Values.multus.n6Interface.routes | toJson }} + {{- end }} + } + }' +{{- end }} +--- diff --git a/charts/oai-5g-core/oai-spgwu-tiny/values.yaml b/charts/oai-5g-core/oai-spgwu-tiny/values.yaml index 9ffa84288276bb51e48b5c5f70aeef75f14464e3..4e58405245492504f76f4054ed5217dc5da9376b 100644 --- a/charts/oai-5g-core/oai-spgwu-tiny/values.yaml +++ b/charts/oai-5g-core/oai-spgwu-tiny/values.yaml @@ -1,17 +1,13 @@ -kubernetesType: Vanilla #Vanilla for community kubernetes distribution +kubernetesType: Vanilla #Vanilla for community kubernetes distribution else Openshift for Openshift +## In case of using these charts on Openshift then please use UBI images +## To know more about them follow this tutorial https://gitlab.eurecom.fr/oai/cn5g/oai-cn5g-fed/-/tree/master/openshift nfimage: repository: docker.io/oaisoftwarealliance/oai-spgwu-tiny # dockerhub oaisoftwarealliance/oai-spgwu-tiny - version: v1.5.0 #image tag, develop tag for experimental features + version: develop #image tag, develop tag for experimental features # pullPolicy: IfNotPresent or Never or Always pullPolicy: IfNotPresent -tcpdumpimage: - repository: docker.io/corfr/tcpdump - version: latest - #pullPolicy: IfNotPresent or Never or Always - pullPolicy: IfNotPresent - ## good to use when pulling images from docker-hub imagePullSecrets: - name: "regcred" @@ -27,37 +23,56 @@ podSecurityContext: runAsUser: 0 runAsGroup: 0 -securityContext: - privileged: true - #service type is fixed to clusterIP, it is only support for non multus interface (eth0) - service: pfcpPort: 8805 # default port no need to change unless necessary gtpuPort: 2152 # default port no need to change unless necessary -# Just for debugging -start: - spgwu: true - tcpdump: false - # create an extra interface for N3 incase the gNB is outside the cluster network or there is a need to have dedicated interface for N3 -multus: - create: false - n3Ip: "172.21.6.201" - n3Netmask: "22" - n6Gw: "172.21.7.254" - hostInterface: "bond0" +## Change these ip-addresses according to your environment +## N4, N6 are optional only if you want that UPF uses different subnets for different 3gpp interfaces. +multus: + ## If you don't want to add a default route in your pod then leave this field empty + defaultGateway: "172.21.7.254" + n3Interface: + create: false + Ipadd: "172.21.6.95" + Netmask: "22" + ## If you do not have a gateway leave the field empty + Gateway: "172.21.7.254" + ## If you do not want to add any routes in your pod then leave this field empty + routes: [{'dst': '10.8.0.0/24','gw': '172.21.7.254'}, {'dst': '10.9.0.0/24','gw': '172.21.7.254'}] + hostInterface: "bond0" + n4Interface: + create: false + Ipadd: "172.21.16.89" + Netmask: "22" + ## If you do not have a gateway leave the field empty + Gateway: "172.21.19.254" + ## If you do not want to add any routes in your pod then leave this field empty + routes: + hostInterface: "bond1" + n6Interface: + create: false + Ipadd: "172.21.8.80" + Netmask: "22" + ## If you do not have a gateway leave the field empty + Gateway: "172.21.11.254" + ## If you do not want to add any routes in your pod then leave this field empty + routes: + hostInterface: "bond2" + +#NOTE: If the interface you selected for n6If is wrong then traffic will not be routed towards internet config: fqdn: "oai-spgwu-tiny-svc" - n3If: "eth0" # net1 if gNB is outside the cluster network and multus creation is true else eth0 - n4If: "eth0" # use for SMF communication - n6If: "eth0" # net1 if gNB is outside the cluster network and multus creation is true else eth0 (important because it sends the traffic towards internet) - threadsN3Ul: "1" - threadsN6Dl: "1" - threadsN6Prio: 99 - threadsN3Prio: 98 + n3If: "eth0" # n3 if multus.n3Interface.create is true + n4If: "eth0" # n4 if multus.n4Interface.create is true + n6If: "eth0" # n6 multus.n6Interface.create is true + threadsN3Ul: "1" #Multi threading is not properly supported + threadsN6Dl: "1" #Multi threading is not properly supported + threadsN6Prio: 99 + threadsN3Prio: 98 threadsN4Prio: 88 netUeNatOption: "yes" bypassUlPfcpRules: "no" #standart feature is no, put yes if you want less UL packet delay @@ -76,29 +91,49 @@ config: dnn1: "ims" # should match with SMF information -## currently only used by tcpdump container to store the tcpdump, this volume will be shared between all the network functions -persistent: - sharedvolume: false # should be true when if wants to store the tcpdump of all the network functions at same place - volumneName: managed-nfs-storage - size: 1Gi +## Debugging section +start: + spgwu: true #If false the network function container will run in sleep mode for manually testing + tcpdump: false +includeTcpDumpContainer: false #If true it will add a tcpdump container inside network function pod for debugging +## For openshift you can use rhel8/support-tools:8.7-13 +tcpdumpimage: + repository: docker.io/corfr/tcpdump + version: latest + #pullPolicy: IfNotPresent or Never or Always + pullPolicy: IfNotPresent + +securityContext: + privileged: true + +#To store PCAP of NF in a sharedVolume so it can be easily fetched (PVC is created with NRF charts so make sure in NRF it is true) +persistent: + sharedvolume: false + +## NF is the network function and tcpdump is the tcpdump container. +## To know more about request and limit it is better to understand that how Kubernetes QoS works. +## https://kubernetes.io/docs/concepts/configuration/manage-resources-containers +## https://kubernetes.io/docs/concepts/workloads/pods/pod-qos resources: define: false limits: - tcpdump: - cpu: 100m - memory: 128Mi nf: cpu: 100m memory: 128Mi - requests: + #If tcpdump container is disabled this value will not be used tcpdump: cpu: 100m memory: 128Mi + requests: nf: cpu: 100m memory: 128Mi + #If tcpdump container is disabled this value will not be used + tcpdump: + cpu: 100m + memory: 128Mi readinessProbe: true diff --git a/charts/oai-5g-core/oai-traffic-server/Chart.yaml b/charts/oai-5g-core/oai-traffic-server/Chart.yaml new file mode 100644 index 0000000000000000000000000000000000000000..f732aaf1c14e0bdc0005fd4c6a2be62982eb6782 --- /dev/null +++ b/charts/oai-5g-core/oai-traffic-server/Chart.yaml @@ -0,0 +1,42 @@ +################################################################################ +# Licensed to the OpenAirInterface (OAI) Software Alliance under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The OpenAirInterface Software Alliance licenses this file to You under +# the OAI Public License, Version 1.1 (the "License"); you may not use this file +# except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.openairinterface.org/?page_id=698 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#------------------------------------------------------------------------------- +# For more information about the OpenAirInterface (OAI) Software Alliance: +# contact@openairinterface.org +################################################################################ +apiVersion: v2 +name: oai-traffic-server +description: Helm chart for oai-traffic-server + +type: application + +icon: http://www.openairinterface.org/wp-content/uploads/2015/06/cropped-oai_final_logo.png + +version: v1 + +appVersion: v1 + +keywords: + - iperf + +sources: + - https://gitlab.eurecom.fr/oai/cn5g/oai-cn5g-fed + - https://openairinterface.org/ + +maintainers: + - name: OPENAIRINTERFACE + email: contact@openairinterface.org diff --git a/charts/oai-5g-core/oai-traffic-server/templates/NOTES.txt b/charts/oai-5g-core/oai-traffic-server/templates/NOTES.txt new file mode 100644 index 0000000000000000000000000000000000000000..51157b342354b72d392baa304efac09c4b83f766 --- /dev/null +++ b/charts/oai-5g-core/oai-traffic-server/templates/NOTES.txt @@ -0,0 +1,2 @@ +1. Get the application name by running these commands: +export traffic_server_POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "oai-traffic-server.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") diff --git a/charts/oai-5g-core/oai-traffic-server/templates/_helpers.tpl b/charts/oai-5g-core/oai-traffic-server/templates/_helpers.tpl new file mode 100644 index 0000000000000000000000000000000000000000..9bfa002b529a4071b11ab6d2e4c55b5aacd57505 --- /dev/null +++ b/charts/oai-5g-core/oai-traffic-server/templates/_helpers.tpl @@ -0,0 +1,63 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "oai-traffic-server.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "oai-traffic-server.fullname" -}} +{{- if .Values.fullnameOverride -}} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- $name := default .Chart.Name .Values.nameOverride -}} +{{- if contains $name .Release.Name -}} +{{- .Release.Name | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} +{{- end -}} +{{- end -}} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "oai-traffic-server.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Common labels +*/}} +{{- define "oai-traffic-server.labels" -}} +helm.sh/chart: {{ include "oai-traffic-server.chart" . }} +{{ include "oai-traffic-server.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end -}} + +{{/* +Selector labels +*/}} +{{- define "oai-traffic-server.selectorLabels" -}} +app.kubernetes.io/name: {{ include "oai-traffic-server.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end -}} + +{{/* +Create the name of the service account to use +*/}} +{{- define "oai-traffic-server.serviceAccountName" -}} +{{- if .Values.serviceAccount.create -}} + {{ default (include "oai-traffic-server.fullname" .) .Values.serviceAccount.name }} +{{- else -}} + {{ default "default" .Values.serviceAccount.name }} +{{- end -}} +{{- end -}} diff --git a/charts/oai-5g-core/oai-traffic-server/templates/configmap.yaml b/charts/oai-5g-core/oai-traffic-server/templates/configmap.yaml new file mode 100644 index 0000000000000000000000000000000000000000..a83446b3501b739d49f56249b7497fc2ac2f2f64 --- /dev/null +++ b/charts/oai-5g-core/oai-traffic-server/templates/configmap.yaml @@ -0,0 +1,25 @@ +{{- if .Values.enabled }} +apiVersion: v1 +kind: ConfigMap +metadata: + name: iperf-pod +data: + script.sh: | + #!/bin/bash + ip route add {{ .Values.config.ueroute }} via {{ .Values.config.upfIpadd }} dev net1 + num_servers={{ .Values.config.noOfIperf3Server }} + base_port=5200 + # Run iperf multiple times + for i in `seq 1 $num_servers`; do + + # Set server port + server_port=$(($base_port+$i)); + + # Report file includes server port + report_file=iperf3-${server_port}.txt + + # Run iperf + iperf3 -s --daemon -p $server_port + done + /bin/bash -c 'trap : TERM INT; sleep infinity & wait' +{{- end }} diff --git a/charts/oai-5g-core/oai-traffic-server/templates/deployment.yaml b/charts/oai-5g-core/oai-traffic-server/templates/deployment.yaml new file mode 100644 index 0000000000000000000000000000000000000000..b0d349deb5b584a3ea5732cd3a40e72672f495f1 --- /dev/null +++ b/charts/oai-5g-core/oai-traffic-server/templates/deployment.yaml @@ -0,0 +1,81 @@ +{{- if .Values.enabled }} +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Chart.Name }} + labels: + app.kubernetes.io/version: "v1" +spec: + replicas: 1 + selector: + matchLabels: + app.kubernetes.io/name: {{ .Chart.Name }} + app.kubernetes.io/instance: {{ .Chart.Name }} + strategy: + type: Recreate + template: + metadata: + labels: + app.kubernetes.io/name: {{ .Chart.Name }} + app.kubernetes.io/instance: {{ .Chart.Name }} + annotations: + k8s.v1.cni.cncf.io/networks: >- + [{ + "name": "{{ .Chart.Name }}-net1", + "default-route": ["{{ .Values.multus.defaultGateway }}"] + }] + spec: + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - name: iperf3 + volumeMounts: + - mountPath: /tmp/script.sh + name: scripts + subPath: script.sh + command: ["/tmp/script.sh"] + image: "{{ .Values.trafficServer.repository }}:{{ .Values.trafficServer.version }}" + imagePullPolicy: IfNotPresent + securityContext: + privileged: true + capabilities: + add: + - NET_ADMIN + drop: + - ALL + {{- if .Values.readinessProbe}} + readinessProbe: + exec: + command: + - pgrep + - iperf3 + initialDelaySeconds: 5 + periodSeconds: 3 + {{- end}} + {{- if .Values.livenessProbe}} + livenessProbe: + exec: + command: + - pgrep + - iperf3 + initialDelaySeconds: 10 + periodSeconds: 5 + {{- end}} + volumes: + - name: scripts + configMap: + name: iperf-pod + defaultMode: 0777 + dnsPolicy: ClusterFirst + restartPolicy: Always + schedulerName: default-scheduler + serviceAccountName: {{ .Values.serviceAccount.name }} + terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }} + {{- if .Values.nodeSelector}} + nodeSelector: + {{- toYaml .Values.nodeSelector | nindent 12 }} + {{- end }} + {{- if .Values.nodeName}} + nodeName: {{ .Values.nodeName }} + {{- end }} +{{- end }} diff --git a/charts/oai-5g-core/oai-traffic-server/templates/multus.yaml b/charts/oai-5g-core/oai-traffic-server/templates/multus.yaml new file mode 100644 index 0000000000000000000000000000000000000000..65880ec48b5f19b98135e255f1f19312fe3a1ba9 --- /dev/null +++ b/charts/oai-5g-core/oai-traffic-server/templates/multus.yaml @@ -0,0 +1,23 @@ +{{- if .Values.enabled }} +{{- if .Values.multus.create }} +apiVersion: "k8s.cni.cncf.io/v1" +kind: NetworkAttachmentDefinition +metadata: + name: {{ .Chart.Name }}-net1 +spec: + config: '{ + "cniVersion": "0.3.0", + "type": "macvlan", + "master": {{- cat .Values.multus.hostInterface | nospace | quote }}, + "mode": "bridge", + "ipam": { + "type": "static", + "addresses": [ + { + "address": {{- cat .Values.multus.IPadd "/" .Values.multus.Netmask | nospace | quote }} + } + ] + } + }' +{{- end }} +{{- end }} diff --git a/charts/oai-5g-core/oai-traffic-server/templates/rbac.yaml b/charts/oai-5g-core/oai-traffic-server/templates/rbac.yaml new file mode 100644 index 0000000000000000000000000000000000000000..7a0b362f28eb2d9442e018e77fc9e5a7a8c2e3c2 --- /dev/null +++ b/charts/oai-5g-core/oai-traffic-server/templates/rbac.yaml @@ -0,0 +1,31 @@ +{{- if .Values.enabled }} +--- +{{- if eq .Values.kubernetesType "Openshift" }} +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: {{ .Chart.Name }}-{{ .Release.Namespace }}-role +rules: +- apiGroups: + - security.openshift.io + resourceNames: + - privileged + resources: + - securitycontextconstraints + verbs: + - use +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: {{ .Chart.Name }}-{{ .Release.Namespace }}-binding +subjects: +- kind: ServiceAccount + name: {{ .Values.serviceAccount.name }} + namespace: {{ .Release.Namespace }} +roleRef: + kind: Role + name: {{ .Chart.Name }}-{{ .Release.Namespace }}-role + apiGroup: rbac.authorization.k8s.io +{{- end }} +{{- end }} diff --git a/charts/oai-5g-core/oai-traffic-server/templates/serviceaccount.yaml b/charts/oai-5g-core/oai-traffic-server/templates/serviceaccount.yaml new file mode 100644 index 0000000000000000000000000000000000000000..6ff79827934c6210961a070ad9685cb5c32d8e7c --- /dev/null +++ b/charts/oai-5g-core/oai-traffic-server/templates/serviceaccount.yaml @@ -0,0 +1,6 @@ +{{- if .Values.enabled }} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ .Values.serviceAccount.name }} +{{- end }} diff --git a/charts/oai-5g-core/oai-traffic-server/values.yaml b/charts/oai-5g-core/oai-traffic-server/values.yaml new file mode 100644 index 0000000000000000000000000000000000000000..e48e1dd27bb83fd5d975f7622a50c98267caef21 --- /dev/null +++ b/charts/oai-5g-core/oai-traffic-server/values.yaml @@ -0,0 +1,43 @@ +kubernetesType: Vanilla # Vanilla (Community Kubernetes) or Openshift (For RedHat Openshift) + +podSecurityContext: + runAsUser: 0 + runAsGroup: 0 + +trafficServer: + repository: docker.io/oaisoftwarealliance/trf-gen-cn5g + version: latest + #pullPolicy: IfNotPresent or Never or Always + pullPolicy: IfNotPresent + +serviceAccount: + # Specifies whether a service account should be created + create: true + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "oai-traffic-server" + +multus: + create: false + IPadd: "172.21.6.99" + Netmask: "22" + defaultGateway: "172.21.7.254" + hostInterface: "bond0" # Interface of the host machine on which this pod will be scheduled + +config: + ueroute: 12.1.1.0/24 + upfIpadd: 172.21.6.95 + noOfIperf3Server: 10 + +readinessProbe: true + +livenessProbe: false + +# Control if the charts will be deployed or not +enabled: true + +terminationGracePeriodSeconds: 2 + +nodeSelector: {} + +nodeName: diff --git a/charts/oai-5g-core/oai-udm/Chart.yaml b/charts/oai-5g-core/oai-udm/Chart.yaml index b447db5ee998251a22a14bc072a18805c35fa54e..902dc19176f059a632c2570d016f0a054e62eeed 100644 --- a/charts/oai-5g-core/oai-udm/Chart.yaml +++ b/charts/oai-5g-core/oai-udm/Chart.yaml @@ -27,9 +27,9 @@ type: application icon: http://www.openairinterface.org/wp-content/uploads/2015/06/cropped-oai_final_logo.png -version: v1.5.0 +version: v1.5.1 -appVersion: v1.5.0 +appVersion: develop-v1.5.1 keywords: - 5GCN diff --git a/charts/oai-5g-core/oai-udm/README.md b/charts/oai-5g-core/oai-udm/README.md new file mode 100644 index 0000000000000000000000000000000000000000..879c8e06c6427400b7b1062549feab610d528ad4 --- /dev/null +++ b/charts/oai-5g-core/oai-udm/README.md @@ -0,0 +1,91 @@ +# Helm Chart for OAI Unified Data Management (UDM) + +The helm-chart is tested on [Minikube](https://minikube.sigs.k8s.io/docs/) and [Red Hat Openshift](https://www.redhat.com/fr/technologies/cloud-computing/openshift) 4.10 and 4.12. There are no special resource requirements for AMF. + +## Introduction + +OAI-UDM follows 3GPP release 16, more information about the feature set can be found on [UDMs WiKi page](https://gitlab.eurecom.fr/oai/cn5g/oai-cn5g-udm/-/wikis/home). The source code be downloaded from [GitLab](https://gitlab.eurecom.fr/oai/cn5g/oai-cn5g-udm) + +OAI [Jenkins Platform](https://jenkins-oai.eurecom.fr/job/OAI-CN5G-UDM/) publishes every `develop` and `master` branch image of OAI-UDM on [docker-hub](https://hub.docker.com/r/oaisoftwarealliance/oai-udm) with tag `develop` and `latest` respectively. Apart from that you can find tags for every release `VX.X.X`. We only publish Ubuntu 18.04/20.04/22.04 images. We do not publish RedHat/UBI images. These images you have to build from the source code on your RedHat systems or Openshift Platform. You can follow this [tutorial](../../../openshift/README.md) for that. + +The helm chart of OAI-UDM creates multiples Kubernetes resources, + +1. Service +2. Role Base Access Control (RBAC) (role and role bindings) +3. Deployment +4. Configmap +5. Service account + +The directory structure + +``` +├── Chart.yaml +├── README.md +├── templates +│  ├── configmap.yaml +│  ├── deployment.yaml +│  ├── _helpers.tpl +│  ├── NOTES.txt +│  ├── rbac.yaml +│  ├── serviceaccount.yaml +│  └── service.yaml +└── values.yaml (Parent file contains all the configurable parameters) +``` + +## Parameters + +[Values.yaml](./values.yaml) contains all the configurable parameters. Below table defines the configurable parameters. + + +|Parameter |Allowed Values |Remark | +|-----------------------------|-------------------------------|-----------------------------------------| +|kubernetesType |Vanilla/Openshift |Vanilla Kubernetes or Openshift | +|nfimage.repository |Image Name | | +|nfimage.version |Image tag | | +|nfimage.pullPolicy |IfNotPresent or Never or Always| | +|imagePullSecrets.name |String |Good to use for docker hub | +|serviceAccount.create |true/false | | +|serviceAccount.annotations |String | | +|serviceAccount.name |String | | +|podSecurityContext.runAsUser |Integer (0,65534) |Mandatory to use 0 | +|podSecurityContext.runAsGroup|Integer (0,65534) |Mandatory to use 0 | + +## Advanced Debugging Parameters + +Only needed if you are doing advanced debugging + +|Parameter |Allowed Values |Remark | +|---------------------------------|-------------------------------|----------------------------------------------| +|start.udm |true/false |If true udm container will go in sleep mode | +|start.tcpdump |true/false |If true tcpdump container will go in sleepmode| +|includeTcpDumpContainer |true/false |If false no tcpdump container will be there | +|tcpdumpimage.repository |Image Name | | +|tcpdumpimage.version |Image tag | | +|tcpdumpimage.pullPolicy |IfNotPresent or Never or Always| | +|persistent.sharedvolume |true/false |Save the pcaps in a shared volume with NRF | +|resources.define |true/false | | +|resources.limits.tcpdump.cpu |string |Unit m for milicpu or cpu | +|resources.limits.tcpdump.memory |string |Unit Mi/Gi/MB/GB | +|resources.limits.nf.cpu |string |Unit m for milicpu or cpu | +|resources.limits.nf.memory |string |Unit Mi/Gi/MB/GB | +|resources.requests.tcpdump.cpu |string |Unit m for milicpu or cpu | +|resources.requests.tcpdump.memory|string |Unit Mi/Gi/MB/GB | +|resources.requests.nf.cpu |string |Unit m for milicpu or cpu | +|resources.requests.nf.memory |string |Unit Mi/Gi/MB/GB | +|readinessProbe |true/false |default true | +|livenessProbe |true/false |default false | +|terminationGracePeriodSeconds |5 |In seconds (default 5) | +|nodeSelector |Node label | | +|nodeName |Node Name | | + + +## Installation + +Better to use the parent charts from: + +1. [oai-5g-basic](../oai-5g-basic/README.md) for basic deployment of OAI-5G Core +2. [oai-5g-slicing](../oai-5g-slicing/README.md) for basic deployment with NSSF extra + +## Note + +1. If you are using tcpdump container to take pcaps automatically (`start.tcpdump` is true) you can enable `persistent.sharedvolume` and [presistent volume](./oai-nrf/values.yaml) in NRF. To store the pcaps of all the NFs in one location. It is to ease the automated collection of pcaps. \ No newline at end of file diff --git a/charts/oai-5g-core/oai-udm/templates/deployment.yaml b/charts/oai-5g-core/oai-udm/templates/deployment.yaml index 13f507d12b49e35151827669552b874ffe4f644e..6f7ca19e9ebe28840e71441e323ffebf43b43802 100644 --- a/charts/oai-5g-core/oai-udm/templates/deployment.yaml +++ b/charts/oai-5g-core/oai-udm/templates/deployment.yaml @@ -23,33 +23,44 @@ spec: {{ toYaml .Values.imagePullSecrets | indent 8 }} {{- end }} containers: + {{- if .Values.includeTcpDumpContainer }} - name: tcpdump image: "{{ .Values.tcpdumpimage.repository }}:{{ .Values.tcpdumpimage.version }}" imagePullPolicy: {{ .Values.tcpdumpimage.pullPolicy }} - {{- if .Values.resources.define}} + {{- if .Values.resources.define}} resources: requests: - memory: {{ .Values.resources.tcpdump.requests.memory | quote }} - cpu: {{ .Values.resources.tcpdump.requests.cpu | quote }} + memory: {{ .Values.resources.requests.tcpdump.memory | quote }} + cpu: {{ .Values.resources.requests.tcpdump.cpu | quote }} limits: - memory: {{ .Values.resources.tcpdump.limits.memory | quote }} - cpu: {{ .Values.resources.tcpdump.limits.cpu | quote }} + memory: {{ .Values.resources.limits.tcpdump.memory | quote }} + cpu: {{ .Values.resources.limits.tcpdump.cpu | quote }} {{- end}} + securityContext: + privileged: true + capabilities: + add: + - NET_ADMIN + drop: + - ALL {{- if .Values.start.tcpdump}} command: - /bin/sh - -c - - /usr/sbin/tcpdump -i any -w /pcap/oai-udm_`date +%Y-%m-%d_%H_%M-%S-%Z`.pcap + - /usr/sbin/tcpdump -i any -w /tmp/pcap/{{ .Chart.Name }}_`date +%Y-%m-%d_%H_%M-%S-%Z`.pcap {{- else}} command: - /bin/sleep - infinity {{- end}} - {{- if .Values.persistence.sharedvolume}} + {{- if .Values.includeTcpDumpContainer}} + {{- if .Values.persistent.sharedvolume}} volumeMounts: - - mountPath: "/pcap" - name: cn5g-pv + - mountPath: "/tmp/pcap" + name: cn5g-pvc + {{- end}} {{- end}} + {{- end }} - name: udm image: "{{ .Values.nfimage.repository }}:{{ .Values.nfimage.version }}" imagePullPolicy: {{ .Values.nfimage.pullPolicy }} @@ -69,6 +80,11 @@ spec: configMapKeyRef: name: {{ .Chart.Name }}-configmap key: pidDirectory + - name: LOG_LEVEL + valueFrom: + configMapKeyRef: + name: {{ .Chart.Name }}-configmap + key: logLevel - name: UDM_NAME valueFrom: configMapKeyRef: @@ -142,11 +158,11 @@ spec: {{- if .Values.resources.define}} resources: requests: - memory: {{ .Values.resources.nf.requests.memory | quote }} - cpu: {{ .Values.resources.nf.requests.cpu | quote }} + memory: {{ .Values.resources.requests.nf.memory | quote }} + cpu: {{ .Values.resources.requests.nf.cpu | quote }} limits: - memory: {{ .Values.resources.nf.limits.memory | quote }} - cpu: {{ .Values.resources.nf.limits.cpu | quote }} + memory: {{ .Values.resources.limits.nf.memory | quote }} + cpu: {{ .Values.resources.limits.nf.cpu | quote }} {{- end}} {{- if .Values.readinessProbe}} readinessProbe: @@ -166,8 +182,6 @@ spec: initialDelaySeconds: 10 periodSeconds: 5 {{- end}} - securityContext: - {{- toYaml .Values.securityContext | nindent 12 }} ports: - containerPort: {{ .Values.config.sbiPortHttp1 }} name: http1 @@ -185,12 +199,14 @@ spec: - /bin/sleep - infinity {{- end}} + {{- if .Values.includeTcpDumpContainer}} + {{- if .Values.persistent.sharedvolume}} volumes: - {{- if .Values.persistence.sharedvolume}} - - name: cn5g-pv - persistenceVolumeClaim: + - name: cn5g-pvc + persistentVolumeClaim: claimName: cn5g-pvc {{- end }} + {{- end }} dnsPolicy: ClusterFirst restartPolicy: Always schedulerName: default-scheduler diff --git a/charts/oai-5g-core/oai-udm/templates/rbac.yaml b/charts/oai-5g-core/oai-udm/templates/rbac.yaml index b8369fac5cf4493cad7e51582eb33d5a6aede5e7..e218d4fcd61c95de8f1aea047c38b3b0a4c81ade 100644 --- a/charts/oai-5g-core/oai-udm/templates/rbac.yaml +++ b/charts/oai-5g-core/oai-udm/templates/rbac.yaml @@ -7,7 +7,7 @@ metadata: rules: - apiGroups: - security.openshift.io -{{- if .Values.securityContext.privileged }} +{{- if .Values.includeTcpDumpContainer }} resourceNames: - privileged {{- else }} @@ -31,4 +31,4 @@ roleRef: kind: Role name: {{ .Chart.Name }}-{{ .Release.Namespace }}-role apiGroup: rbac.authorization.k8s.io -{{- end }} \ No newline at end of file +{{- end }} diff --git a/charts/oai-5g-core/oai-udm/values.yaml b/charts/oai-5g-core/oai-udm/values.yaml index 160d6c9737c2532e74bca43a14927012d9820ed4..cae5a15155b6d594e1980eaa653c79b9557143e6 100644 --- a/charts/oai-5g-core/oai-udm/values.yaml +++ b/charts/oai-5g-core/oai-udm/values.yaml @@ -1,14 +1,10 @@ -kubernetesType: Vanilla #Vanilla for community kubernetes distribution +kubernetesType: Vanilla #Vanilla for community kubernetes distribution else Openshift for Openshift +## In case of using these charts on Openshift then please use UBI images +## To know more about them follow this tutorial https://gitlab.eurecom.fr/oai/cn5g/oai-cn5g-fed/-/tree/master/openshift nfimage: repository: docker.io/oaisoftwarealliance/oai-udm - version: v1.5.0 #image tag, develop tag for experimental features - #pullPolicy: IfNotPresent or Never or Always - pullPolicy: IfNotPresent - -tcpdumpimage: - repository: docker.io/corfr/tcpdump - version: latest + version: develop #image tag, develop tag for experimental features #pullPolicy: IfNotPresent or Never or Always pullPolicy: IfNotPresent @@ -29,18 +25,12 @@ podSecurityContext: #service type is fixed to clusterIP, it is only support for non multus interface (eth0) -securityContext: - privileged: false - -start: - udm: true - tcpdump: false - config: tz: "Europe/Paris" instance: 0 pidDirectory: "/var/run" udmName: "oai-udm" + logLevel: "debug" sbiIfName: "eth0" sbiPortHttp1: "80" sbiPortHttp2: "8080" @@ -57,27 +47,46 @@ config: nrfApiVersionNb: "v1" #Nb means northbound nrfFqdn: "oai-nrf-svc" -persistence: +## Debugging section +start: + udm: true #If false the network function container will run in sleep mode for manually testing + tcpdump: false + +includeTcpDumpContainer: false #If true it will add a tcpdump container inside network function pod for debugging + +## For openshift you can use rhel8/support-tools:8.7-13 +tcpdumpimage: + repository: docker.io/corfr/tcpdump + version: latest + #pullPolicy: IfNotPresent or Never or Always + pullPolicy: IfNotPresent + +#To store PCAP of NF in a sharedVolume so it can be easily fetched (PVC is created with NRF charts so make sure in NRF it is true) +persistent: sharedvolume: false - volumneName: managed-nfs-storage - size: 1Gi +## NF is the network function and tcpdump is the tcpdump container. +## To know more about request and limit it is better to understand that how Kubernetes QoS works. +## https://kubernetes.io/docs/concepts/configuration/manage-resources-containers +## https://kubernetes.io/docs/concepts/workloads/pods/pod-qos resources: define: false limits: - tcpdump: - cpu: 100m - memory: 128Mi nf: cpu: 100m memory: 128Mi - requests: + #If tcpdump container is disabled this value will not be used tcpdump: cpu: 100m memory: 128Mi + requests: nf: cpu: 100m memory: 128Mi + #If tcpdump container is disabled this value will not be used + tcpdump: + cpu: 100m + memory: 128Mi readinessProbe: true @@ -87,4 +96,4 @@ terminationGracePeriodSeconds: 5 nodeSelector: {} -nodeName: +nodeName: diff --git a/charts/oai-5g-core/oai-udr/Chart.yaml b/charts/oai-5g-core/oai-udr/Chart.yaml index 9a9d1292cf2296d4fe7a8f460486f259c408ae5f..6826cccba548664407dbbd37c69e3e79ff5e770d 100644 --- a/charts/oai-5g-core/oai-udr/Chart.yaml +++ b/charts/oai-5g-core/oai-udr/Chart.yaml @@ -27,9 +27,9 @@ type: application icon: http://www.openairinterface.org/wp-content/uploads/2015/06/cropped-oai_final_logo.png -version: v1.5.0 +version: v1.5.1 -appVersion: v1.5.0 +appVersion: develop-v1.5.1 keywords: - 5GCN diff --git a/charts/oai-5g-core/oai-udr/README.md b/charts/oai-5g-core/oai-udr/README.md new file mode 100644 index 0000000000000000000000000000000000000000..3e2ae1375477ae1b614cb312a6aaa4a00e3f9a91 --- /dev/null +++ b/charts/oai-5g-core/oai-udr/README.md @@ -0,0 +1,92 @@ +# Helm Chart for OAI Unified Data Repository (UDR) + +The helm-chart is tested on [Minikube](https://minikube.sigs.k8s.io/docs/) and [Red Hat Openshift](https://www.redhat.com/fr/technologies/cloud-computing/openshift) 4.10 and 4.12. There are no special resource requirements for AUSF. + +## Introduction + +OAI-UDR follows 3GPP release 16, more information about the feature set can be found on [UDRs WiKi page](https://gitlab.eurecom.fr/oai/cn5g/oai-cn5g-udr/-/wikis/home). The source code be downloaded from [GitLab](https://gitlab.eurecom.fr/oai/cn5g/oai-cn5g-udr) + +OAI [Jenkins Platform](https://jenkins-oai.eurecom.fr/job/OAI-CN5G-UDR/) publishes every `develop` and `master` branch image of OAI-UDR on [docker-hub](https://hub.docker.com/r/oaisoftwarealliance/oai-udr) with tag `develop` and `latest` respectively. Apart from that you can find tags for every release `VX.X.X`. We only publish Ubuntu 18.04/20.04/22.04 images. We do not publish RedHat/UBI images. These images you have to build from the source code on your RedHat systems or Openshift Platform. You can follow this [tutorial](../../../openshift/README.md) for that. + +The helm chart of OAI-UDR creates multiples Kubernetes resources, + +1. Service +2. Role Base Access Control (RBAC) (role and role bindings) +3. Deployment +4. Configmap +5. Service account + +The directory structure + +``` +├── Chart.yaml +├── README.md +├── templates +│  ├── configmap.yaml +│  ├── deployment.yaml +│  ├── _helpers.tpl +│  ├── NOTES.txt +│  ├── rbac.yaml +│  ├── serviceaccount.yaml +│  └── service.yaml +└── values.yaml (Parent file contains all the configurable parameters) +``` + +## Parameters + +[Values.yaml](./values.yaml) contains all the configurable parameters. Below table defines the configurable parameters. + + +|Parameter |Allowed Values |Remark | +|-----------------------------|-------------------------------|-----------------------------------------| +|kubernetesType |Vanilla/Openshift |Vanilla Kubernetes or Openshift | +|nfimage.repository |Image Name | | +|nfimage.version |Image tag | | +|nfimage.pullPolicy |IfNotPresent or Never or Always| | +|imagePullSecrets.name |String |Good to use for docker hub | +|serviceAccount.create |true/false | | +|serviceAccount.annotations |String | | +|serviceAccount.name |String | | +|podSecurityContext.runAsUser |Integer (0,65534) |Mandatory to use 0 | +|podSecurityContext.runAsGroup|Integer (0,65534) |Mandatory to use 0 | + + +## Advanced Debugging Parameters + +Only needed if you are doing advanced debugging + + +|Parameter |Allowed Values |Remark | +|---------------------------------|-------------------------------|----------------------------------------------| +|start.ausf |true/false |If true ausf container will go in sleep mode | +|start.tcpdump |true/false |If true tcpdump container will go in sleepmode| +|includeTcpDumpContainer |true/false |If false no tcpdump container will be there | +|tcpdumpimage.repository |Image Name | | +|tcpdumpimage.version |Image tag | | +|tcpdumpimage.pullPolicy |IfNotPresent or Never or Always| | +|persistent.sharedvolume |true/false |Save the pcaps in a shared volume with NRF | +|resources.define |true/false | | +|resources.limits.tcpdump.cpu |string |Unit m for milicpu or cpu | +|resources.limits.tcpdump.memory |string |Unit Mi/Gi/MB/GB | +|resources.limits.nf.cpu |string |Unit m for milicpu or cpu | +|resources.limits.nf.memory |string |Unit Mi/Gi/MB/GB | +|resources.requests.tcpdump.cpu |string |Unit m for milicpu or cpu | +|resources.requests.tcpdump.memory|string |Unit Mi/Gi/MB/GB | +|resources.requests.nf.cpu |string |Unit m for milicpu or cpu | +|resources.requests.nf.memory |string |Unit Mi/Gi/MB/GB | +|readinessProbe |true/false |default true | +|livenessProbe |true/false |default false | +|terminationGracePeriodSeconds |5 |In seconds (default 5) | +|nodeSelector |Node label | | +|nodeName |Node Name | | + +## Installation + +Better to use the parent charts from: + +1. [oai-5g-basic](../oai-5g-basic/README.md) for basic deployment of OAI-5G Core +2. [oai-5g-slicing](../oai-5g-slicing/README.md) for basic deployment with NSSF extra + +## Note + +1. If you are using tcpdump container to take pcaps automatically (`start.tcpdump` is true) you can enable `persistent.sharedvolume` and [presistent volume](./oai-nrf/values.yaml) in NRF. To store the pcaps of all the NFs in one location. It is to ease the automated collection of pcaps. \ No newline at end of file diff --git a/charts/oai-5g-core/oai-udr/templates/deployment.yaml b/charts/oai-5g-core/oai-udr/templates/deployment.yaml index 1945f2d3b1c606e023dbc934c4236c7798456e78..a52f1f5693e784935137fc94f32180f53229694e 100644 --- a/charts/oai-5g-core/oai-udr/templates/deployment.yaml +++ b/charts/oai-5g-core/oai-udr/templates/deployment.yaml @@ -21,46 +21,55 @@ spec: imagePullSecrets: {{ toYaml .Values.imagePullSecrets | indent 8 }} containers: + {{- if .Values.includeTcpDumpContainer }} - name: tcpdump image: "{{ .Values.tcpdumpimage.repository }}:{{ .Values.tcpdumpimage.version }}" imagePullPolicy: {{ .Values.tcpdumpimage.pullPolicy }} - securityContext: - {{- toYaml .Values.securityContext | nindent 12 }} {{- if .Values.resources.define}} resources: requests: - memory: {{ .Values.resources.tcpdump.requests.memory | quote }} - cpu: {{ .Values.resources.tcpdump.requests.cpu | quote }} + memory: {{ .Values.resources.requests.tcpdump.memory | quote }} + cpu: {{ .Values.resources.requests.tcpdump.cpu | quote }} limits: - memory: {{ .Values.resources.tcpdump.limits.memory | quote }} - cpu: {{ .Values.resources.tcpdump.limits.cpu | quote }} + memory: {{ .Values.resources.limits.tcpdump.memory | quote }} + cpu: {{ .Values.resources.limits.tcpdump.cpu | quote }} {{- end}} + securityContext: + privileged: true + capabilities: + add: + - NET_ADMIN + drop: + - ALL {{- if .Values.start.tcpdump}} command: - /bin/sh - -c - - /usr/sbin/tcpdump -i any -w /pcap/oai-udr_`date +%Y-%m-%d_%H_%M-%S-%Z`.pcap + - /usr/sbin/tcpdump -i any -w /tmp/pcap/{{ .Chart.Name }}_`date +%Y-%m-%d_%H_%M-%S-%Z`.pcap {{- else}} command: - /bin/sleep - infinity {{- end}} - {{- if .Values.persistence.sharedvolume}} + {{- if .Values.includeTcpDumpContainer}} + {{- if .Values.persistent.sharedvolume}} volumeMounts: - - mountPath: "/pcap" - name: cn5g-pv + - mountPath: "/tmp/pcap" + name: cn5g-pvc {{- end}} + {{- end}} + {{- end }} - name: udr image: "{{ .Values.nfimage.repository }}:{{ .Values.nfimage.version }}" imagePullPolicy: {{ .Values.nfimage.pullPolicy }} {{- if .Values.resources.define}} resources: requests: - memory: {{ .Values.resources.nf.requests.memory | quote }} - cpu: {{ .Values.resources.nf.requests.cpu | quote }} + memory: {{ .Values.resources.requests.nf.memory | quote }} + cpu: {{ .Values.resources.requests.nf.cpu | quote }} limits: - memory: {{ .Values.resources.nf.limits.memory | quote }} - cpu: {{ .Values.resources.nf.limits.cpu | quote }} + memory: {{ .Values.resources.limits.nf.memory | quote }} + cpu: {{ .Values.resources.limits.nf.cpu | quote }} {{- end}} {{- if .Values.readinessProbe}} readinessProbe: @@ -80,8 +89,6 @@ spec: initialDelaySeconds: 10 periodSeconds: 5 {{- end}} - securityContext: - {{- toYaml .Values.securityContext | nindent 12 }} ports: - containerPort: {{ .Values.config.sbiPortHttp1 }} name: http1 @@ -114,6 +121,11 @@ spec: configMapKeyRef: name: {{ .Chart.Name }}-configmap key: pidDirectory + - name: LOG_LEVEL + valueFrom: + configMapKeyRef: + name: {{ .Chart.Name }}-configmap + key: logLevel - name: USE_FQDN_DNS valueFrom: configMapKeyRef: @@ -195,12 +207,14 @@ spec: - /bin/sleep - infinity {{- end}} + {{- if .Values.includeTcpDumpContainer}} + {{- if .Values.persistent.sharedvolume}} volumes: - {{- if .Values.persistence.sharedvolume}} - - name: cn5g-pv - persistenceVolumeClaim: + - name: cn5g-pvc + persistentVolumeClaim: claimName: cn5g-pvc {{- end }} + {{- end }} dnsPolicy: ClusterFirst restartPolicy: Always schedulerName: default-scheduler diff --git a/charts/oai-5g-core/oai-udr/templates/rbac.yaml b/charts/oai-5g-core/oai-udr/templates/rbac.yaml index b8369fac5cf4493cad7e51582eb33d5a6aede5e7..e218d4fcd61c95de8f1aea047c38b3b0a4c81ade 100644 --- a/charts/oai-5g-core/oai-udr/templates/rbac.yaml +++ b/charts/oai-5g-core/oai-udr/templates/rbac.yaml @@ -7,7 +7,7 @@ metadata: rules: - apiGroups: - security.openshift.io -{{- if .Values.securityContext.privileged }} +{{- if .Values.includeTcpDumpContainer }} resourceNames: - privileged {{- else }} @@ -31,4 +31,4 @@ roleRef: kind: Role name: {{ .Chart.Name }}-{{ .Release.Namespace }}-role apiGroup: rbac.authorization.k8s.io -{{- end }} \ No newline at end of file +{{- end }} diff --git a/charts/oai-5g-core/oai-udr/values.yaml b/charts/oai-5g-core/oai-udr/values.yaml index 6b781799ba23261ae29b07ce711714f414983cc3..60252061b8b2dfe8575df37abd10be7b93e5f28d 100644 --- a/charts/oai-5g-core/oai-udr/values.yaml +++ b/charts/oai-5g-core/oai-udr/values.yaml @@ -1,14 +1,10 @@ -kubernetesType: Vanilla #Vanilla for community kubernetes distribution +kubernetesType: Vanilla #Vanilla for community kubernetes distribution else Openshift for Openshift +## In case of using these charts on Openshift then please use UBI images +## To know more about them follow this tutorial https://gitlab.eurecom.fr/oai/cn5g/oai-cn5g-fed/-/tree/master/openshift nfimage: repository: docker.io/oaisoftwarealliance/oai-udr # image name either locally present or in a public/private repository - version: v1.5.0 #image tag, develop tag for experimental features - #pullPolicy: IfNotPresent or Never or Always - pullPolicy: IfNotPresent - -tcpdumpimage: - repository: docker.io/corfr/tcpdump - version: latest + version: develop #image tag, develop tag for experimental features #pullPolicy: IfNotPresent or Never or Always pullPolicy: IfNotPresent @@ -30,18 +26,6 @@ podSecurityContext: runAsUser: 0 runAsGroup: 0 -securityContext: - privileged: false - -service: - type: ClusterIP - http1Port: 80 - http2Port: 8080 - -start: - udr: true - tcpdump: false #start tcpdump collection to analyse but beware it will take a lot of space in the container/persistent volume - config: tz: "Europe/Paris" instance: "0" @@ -63,27 +47,46 @@ config: mySqlPass: "linux" mySqlDb: "oai_db" -persistence: +## Debugging section +start: + udr: true #If false the network function container will run in sleep mode for manually testing + tcpdump: false + +includeTcpDumpContainer: false #If true it will add a tcpdump container inside network function pod for debugging + +## For openshift you can use rhel8/support-tools:8.7-13 +tcpdumpimage: + repository: docker.io/corfr/tcpdump + version: latest + #pullPolicy: IfNotPresent or Never or Always + pullPolicy: IfNotPresent + +#To store PCAP of NF in a sharedVolume so it can be easily fetched (PVC is created with NRF charts so make sure in NRF it is true) +persistent: sharedvolume: false - volumneName: managed-nfs-storage - size: 1Gi - + +## NF is the network function and tcpdump is the tcpdump container. +## To know more about request and limit it is better to understand that how Kubernetes QoS works. +## https://kubernetes.io/docs/concepts/configuration/manage-resources-containers +## https://kubernetes.io/docs/concepts/workloads/pods/pod-qos resources: define: false limits: - tcpdump: - cpu: 100m - memory: 128Mi nf: cpu: 100m memory: 128Mi - requests: + #If tcpdump container is disabled this value will not be used tcpdump: cpu: 100m memory: 128Mi + requests: nf: cpu: 100m memory: 128Mi + #If tcpdump container is disabled this value will not be used + tcpdump: + cpu: 100m + memory: 128Mi readinessProbe: true @@ -94,4 +97,3 @@ terminationGracePeriodSeconds: 5 nodeSelector: {} nodeName: - diff --git a/charts/oai-5g-ran/oai-gnb-cu-cp/Chart.yaml b/charts/oai-5g-ran/oai-gnb-cu-cp/Chart.yaml new file mode 100644 index 0000000000000000000000000000000000000000..fe1c7514c9b0a74044c541252d56334752f77e41 --- /dev/null +++ b/charts/oai-5g-ran/oai-gnb-cu-cp/Chart.yaml @@ -0,0 +1,58 @@ +################################################################################ +# Licensed to the OpenAirInterface (OAI) Software Alliance under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The OpenAirInterface Software Alliance licenses this file to You under +# the OAI Public License, Version 1.1 (the "License"); you may not use this file +# except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.openairinterface.org/?page_id=698 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#------------------------------------------------------------------------------- +# For more information about the OpenAirInterface (OAI) Software Alliance: +# contact@openairinterface.org +################################################################################ + +apiVersion: v2 +name: oai-gnb-cu-cp +description: A Helm chart for gnb-cu network function + +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. +type: application + +icon: http://www.openairinterface.org/wp-content/uploads/2015/06/cropped-oai_final_logo.png + +# This is the chart version. This version number should be incremented each time you make changes +# to the chart and its templates, including the app version. +version: 1.0.0 + +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. +appVersion: develop + +keywords: + - RF_Simulator + - gNB + - RAN + - 5G + - CU-CP + +sources: + - https://gitlab.eurecom.fr/oai/openairinterface5g + +maintainers: + - name: OPENAIRINTERFACE + email: contact@openairinterface.org diff --git a/charts/oai-5g-ran/oai-gnb-cu-cp/README.md b/charts/oai-5g-ran/oai-gnb-cu-cp/README.md new file mode 100644 index 0000000000000000000000000000000000000000..00529b76ceb2bbe661e40f936336a43d92faf7f4 --- /dev/null +++ b/charts/oai-5g-ran/oai-gnb-cu-cp/README.md @@ -0,0 +1,144 @@ +# Helm Chart for OAI Central Unit Control Plane (OAI-CU-CP) + +Before using this helm-chart we recommend you read about OAI codebase and its working from the documents listed on [OAI gitlab](https://gitlab.eurecom.fr/oai/openairinterface5g/-/tree/develop/doc). Here you can find a dedicated document on [F1 design](https://gitlab.eurecom.fr/oai/openairinterface5g/-/blob/develop/doc/F1-design.md) and [E1 design](https://gitlab.eurecom.fr/oai/openairinterface5g/-/blob/develop/doc/E1-design.md) + +**Note**: This chart is tested on [Minikube](https://minikube.sigs.k8s.io/docs/) and [Red Hat Openshift](https://www.redhat.com/fr/technologies/cloud-computing/openshift) 4.10 and 4.12. It requires minimum 1CPU and 1Gi RAM and [multus-cni](https://github.com/k8snetworkplumbingwg/multus-cni) plugin for multiple interfaces. + +## Introduction + +To know more about the feature set of OpenAirInterface you can check it [here](https://gitlab.eurecom.fr/oai/openairinterface5g/-/blob/develop/doc/FEATURE_SET.md#openairinterface-5g-nr-feature-set). + +The [codebase](https://gitlab.eurecom.fr/oai/openairinterface5g/-/tree/develop) for gNB, CU, DU, CU-CP/CU-UP, NR-UE is the same. Everyweek on [docker-hub](https://hub.docker.com/r/oaisoftwarealliance/oai-gnb) our [Jenkins Platform](https://jenkins-oai.eurecom.fr/view/RAN/) publishes two docker-images + +1. `oaisoftwarealliance/oai-gnb` for monolithic gNB, DU, CU, CU-CP +2. `oaisoftwarealliance/oai-nr-cuup` for CU-UP. + +Each image has develop tag and a dedicated week tag for example `2023.w18`. We only publish Ubuntu 18.04/20.04 images. We do not publish RedHat/UBI images. These images you have to build from the source code on your RedHat systems or Openshift Platform. You can follow this [tutorial](../../../openshift/README.md) for that. + +The helm chart of OAI-CU-CP creates multiples Kubernetes resources, + +1. Service +2. Role Base Access Control (RBAC) (role and role bindings) +3. Deployment +4. Configmap +5. Service account +6. Network-attachment-defination (Optional only when multus is used) + +The directory structure + +``` +. +├── Chart.yaml +├── templates +│  ├── configmap.yaml +│  ├── deployment.yaml +│  ├── _helpers.tpl +│  ├── multus.yaml +│  ├── NOTES.txt +│  ├── rbac.yaml +│  ├── serviceaccount.yaml +│  └── service.yaml +└── values.yaml +``` + +## Parameters + +[Values.yaml](./values.yaml) contains all the configurable parameters. Below table defines the configurable parameters. The ip-addresses of N2, E1 and F1C have to be pre-configured in the configuration. Most of the primary CNIs do not allow static ip-address allocation. To overcome this we are using multus-cni with static ip-address allocation. At minimum you have to create one multus interface which you can use for N2, E1 and F1C. If you want you can create dedicated interfaces for N2, E1 and F1C. + + +|Parameter |Allowed Values |Remark | +|---------------------------------|-------------------------------|---------------------------------| +|kubernetesType |Vanilla/Openshift |Vanilla Kubernetes or Openshift | +|nfimage.repository |Image Name | | +|nfimage.version |Image tag | | +|nfimage.pullPolicy |IfNotPresent or Never or Always| | +|imagePullSecrets.name |String |Good to use for docker hub | +|serviceAccount.create |true/false | | +|serviceAccount.annotations |String | | +|serviceAccount.name |String | | +|podSecurityContext.runAsUser |Integer (0,65534) | | +|podSecurityContext.runAsGroup |Integer (0,65534) | | +|multus.defaultGateway |Ip-Address |default route in the pod | +|multus.n2Interface.create |true/false | | +|multus.n2Interface.IPadd |Ip-Address | | +|multus.n2Interface.Netmask |Netmask | | +|multus.n2Interface.Gateway |Ip-Address | | +|multus.n2Interface.routes |Json |Routes you want to add in the pod| +|multus.n2Interface.hostInterface |host interface |Host machine interface name | +|multus.e1Interface.create |true/false | | +|multus.e1Interface.IPadd |Ip-Address) | | +|multus.e1Interface.Netmask |Netmask | | +|multus.e1Interface.Gateway |Ip-Address | | +|multus.e1Interface.routes |Json |Routes you want to add in the pod| +|multus.e1Interface.hostInterface |host interface |Host machine interface name | +|multus.f1cInterface.create |true/false | | +|multus.f1cInterface.IPadd |Ip-Address | | +|multus.f1cInterface.Netmask |Netmask | | +|multus.f1cInterface.Gateway |Ip-Address | | +|multus.f1cInterface.routes |Json |Routes you want to add in the pod| +|multus.f1cInterface.hostInterface|host interface |Host machine interface name | + +The config parameters mentioned in `config` block of `values.yaml` are limited on purpose to maintain simplicity. They do not allow changing a lot of parameters of oai-gnb-cu. If you want to use your own configuration file for oai-gnb-cu-cp. It is recommended to copy it in `templates/configmap.yaml` and set `config.mountConfig` as `true`. The command line for gnb is provided in `config.useAdditionalOptions`. + +You can find [here](https://gitlab.eurecom.fr/oai/openairinterface5g/-/tree/develop/targets/PROJECTS/GENERIC-NR-5GC/CONF) different sample configuration files for different bandwidths and frequencies. The binary of oai-gnb is called as `nr-softmodem`. To know more about its functioning and command line parameters you can visit this [page](https://gitlab.eurecom.fr/oai/openairinterface5g/-/blob/develop/doc/RUNMODEM.md) + +## Advanced Debugging Parameters + +Only needed if you are doing advanced debugging + +|Parameter |Allowed Values |Remark | +|---------------------------------|-------------------------------|----------------------------------------------| +|start.gnbcucp |true/false |If true gnbcucp container will go in sleep mode| +|start.tcpdump |true/false |If true tcpdump container will go in sleepmode| +|includeTcpDumpContainer |true/false |If false no tcpdump container will be there | +|tcpdumpimage.repository |Image Name | | +|tcpdumpimage.version |Image tag | | +|tcpdumpimage.pullPolicy |IfNotPresent or Never or Always| | +|persistent.sharedvolume |true/false |Save the pcaps in a shared volume with NRF | +|resources.define |true/false | | +|resources.limits.tcpdump.cpu |string |Unit m for milicpu or cpu | +|resources.limits.tcpdump.memory |string |Unit Mi/Gi/MB/GB | +|resources.limits.nf.cpu |string |Unit m for milicpu or cpu | +|resources.limits.nf.memory |string |Unit Mi/Gi/MB/GB | +|resources.requests.tcpdump.cpu |string |Unit m for milicpu or cpu | +|resources.requests.tcpdump.memory|string |Unit Mi/Gi/MB/GB | +|resources.requests.nf.cpu |string |Unit m for milicpu or cpu | +|resources.requests.nf.memory |string |Unit Mi/Gi/MB/GB | +|readinessProbe |true/false |default true | +|livenessProbe |true/false |default false | +|terminationGracePeriodSeconds |5 |In seconds (default 5) | +|nodeSelector |Node label | | +|nodeName |Node Name | | + +## How to use + +Make sure core network is running before starting the `cu-cp` + +```bash +helm install oai-gnb-cu-cp . +#wait for cu-cp to start +helm install oai-gnb-cu-up ../oai-gnb-cu-up +helm install oai-gnb-du ../oai-gnb-du +``` + +### Connect the UE + +1. Configure the `oai-nr-ue` charts for `oai-gnb-du`, change `config.rfSimulator` to `oai-gnb-du` and `useAdditionalOptions` to "--sa --rfsim -r 106 --numerology 1 -C 3619200000 --nokrnmod --log_config.global_log_options level,nocolor,time". As the configuration of cu/du is set at this frequency and resource block. If you mount your own configuration file then set the configuration of nr-ue accordingly. + +```bash +helm install oai-nr-ue ../oai-nr-ue +``` + +2. Once NR-UE is connected you can go inside the pod and ping via `oai` interface. If you do not see this interface then the UE is not connected to gNB or have some issues at core network. + +```bash +kubectl exec -it <oai-nr-ue-pod-name> -- bash +#ping towards spgwu/upf +ping -I oaitun_ue1 12.1.1.1 +#ping towards google dns +ping -I oaitun_ue1 8.8.8.8 +``` + +## Note + +1. If you are using multus then make sure it is properly configured and if you don't have a gateway for your multus interface then avoid using gateway and defaultGateway parameter. Either comment them or leave them empty. Wrong gateway configuration can create issues with pod networking and pod will not be able to resolve service names. \ No newline at end of file diff --git a/charts/oai-5g-ran/oai-gnb-cu-cp/templates/NOTES.txt b/charts/oai-5g-ran/oai-gnb-cu-cp/templates/NOTES.txt new file mode 100644 index 0000000000000000000000000000000000000000..7a232774b04686c08fc881153ad4814d494f632e --- /dev/null +++ b/charts/oai-5g-ran/oai-gnb-cu-cp/templates/NOTES.txt @@ -0,0 +1,4 @@ +1. Get the application name by running these commands: + export GNB__CU_CP_POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "oai-gnb-cu-cp.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") +2. Dockerhub images of OpenAirInterface requires avx2 capabilities in the cpu and they are built for x86 architecture, tested on UBUNTU OS only. +3. If you want to configure for a particular band then copy the configuration file in templates/configmap.yaml from here https://gitlab.eurecom.fr/oai/openairinterface5g/-/tree/develop/targets/PROJECTS/GENERIC-NR-5GC/CONF diff --git a/charts/simulators/gnbsim/templates/_helpers.tpl b/charts/oai-5g-ran/oai-gnb-cu-cp/templates/_helpers.tpl similarity index 74% rename from charts/simulators/gnbsim/templates/_helpers.tpl rename to charts/oai-5g-ran/oai-gnb-cu-cp/templates/_helpers.tpl index 125f5c4215eba9976806b79592c798cbcb6e99a3..5568f3cc3f9044e86008a09814a2ec9323b86bbe 100644 --- a/charts/simulators/gnbsim/templates/_helpers.tpl +++ b/charts/oai-5g-ran/oai-gnb-cu-cp/templates/_helpers.tpl @@ -2,7 +2,7 @@ {{/* Expand the name of the chart. */}} -{{- define "gnbsim.name" -}} +{{- define "oai-gnb-cu-cp.name" -}} {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} {{- end -}} @@ -11,7 +11,7 @@ Create a default fully qualified app name. We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). If release name contains chart name it will be used as a full name. */}} -{{- define "gnbsim.fullname" -}} +{{- define "oai-gnb-cu-cp.fullname" -}} {{- if .Values.fullnameOverride -}} {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} {{- else -}} @@ -27,16 +27,16 @@ If release name contains chart name it will be used as a full name. {{/* Create chart name and version as used by the chart label. */}} -{{- define "gnbsim.chart" -}} +{{- define "oai-gnb-cu-cp.chart" -}} {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} {{- end -}} {{/* Common labels */}} -{{- define "gnbsim.labels" -}} -helm.sh/chart: {{ include "gnbsim.chart" . }} -{{ include "gnbsim.selectorLabels" . }} +{{- define "oai-gnb-cu-cp.labels" -}} +helm.sh/chart: {{ include "oai-gnb-cu-cp.chart" . }} +{{ include "oai-gnb-cu-cp.selectorLabels" . }} {{- if .Chart.AppVersion }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} {{- end }} @@ -46,17 +46,17 @@ app.kubernetes.io/managed-by: {{ .Release.Service }} {{/* Selector labels */}} -{{- define "gnbsim.selectorLabels" -}} -app.kubernetes.io/name: {{ include "gnbsim.name" . }} +{{- define "oai-gnb-cu-cp.selectorLabels" -}} +app.kubernetes.io/name: {{ include "oai-gnb-cu-cp.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} {{- end -}} {{/* Create the name of the service account to use */}} -{{- define "gnbsim.serviceAccountName" -}} +{{- define "oai-gnb-cu-cp.serviceAccountName" -}} {{- if .Values.serviceAccount.create -}} - {{ default (include "gnbsim.fullname" .) .Values.serviceAccount.name }} + {{ default (include "oai-gnb-cu-cp.fullname" .) .Values.serviceAccount.name }} {{- else -}} {{ default "default" .Values.serviceAccount.name }} {{- end -}} diff --git a/charts/oai-5g-ran/oai-gnb-cu-cp/templates/configmap.yaml b/charts/oai-5g-ran/oai-gnb-cu-cp/templates/configmap.yaml new file mode 100644 index 0000000000000000000000000000000000000000..bac0f370bc028269fdcfaab9cc05b8cb3d533490 --- /dev/null +++ b/charts/oai-5g-ran/oai-gnb-cu-cp/templates/configmap.yaml @@ -0,0 +1,239 @@ +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ .Chart.Name }}-configmap +data: + mounted.conf: | + Active_gNBs = ( "oai-cu-cp"); + # Asn1_verbosity, choice in: none, info, annoying + Asn1_verbosity = "none"; + Num_Threads_PUSCH = 8; + sa = 1; + + gNBs = + ( + { + ////////// Identification parameters: + gNB_CU_ID = 0xe00; + + # cell_type = "CELL_MACRO_GNB"; + + gNB_name = "oai-cu-cp"; + + // Tracking area code, 0x0000 and 0xfffe are reserved values + tracking_area_code = 1; + plmn_list = ({ mcc = {{ .Values.config.mcc }}; + mnc = {{ .Values.config.mnc }}; + mnc_length ={{ .Values.config.mncLength }}; + snssaiList = ({ sst = {{ .Values.config.nssaiSst }}, sd = {{ .Values.config.nssaiSd }} }) + }); + + + nr_cellid = 12345678L; + force_256qam_off = 1; + + tr_s_preference = "f1"; + + local_s_if_name = "net3"; + local_s_address = "{{ .Values.multus.f1cInterface.IPadd }}"; + remote_s_address = "{{ .Values.config.f1duIpAddress }}"; + local_s_portc = 501; + local_s_portd = 2152; + remote_s_portc = 500; + remote_s_portd = 2152; + + ssb_SubcarrierOffset = 0; + min_rxtxtime = 6; + + servingCellConfigCommon = ( + { + #spCellConfigCommon + + physCellId = 0; + + # downlinkConfigCommon + #frequencyInfoDL + # this is 3600 MHz + 43 PRBs@30kHz SCS (same as initial BWP) + absoluteFrequencySSB = 641280; + dl_frequencyBand = 78; + # this is 3600 MHz + dl_absoluteFrequencyPointA = 640008; + #scs-SpecificCarrierList + dl_offstToCarrier = 0; + # subcarrierSpacing + # 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + dl_subcarrierSpacing = 1; + dl_carrierBandwidth = 106; + #initialDownlinkBWP + #genericParameters + # this is RBstart=27,L=48 (275*(L-1))+RBstart + initialDLBWPlocationAndBandwidth = 28875; # 6366 12925 12956 28875 12952 + # subcarrierSpacing + # 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + initialDLBWPsubcarrierSpacing = 1; + #pdcch-ConfigCommon + initialDLBWPcontrolResourceSetZero = 11; + initialDLBWPsearchSpaceZero = 0; + + #uplinkConfigCommon + #frequencyInfoUL + ul_frequencyBand = 78; + #scs-SpecificCarrierList + ul_offstToCarrier = 0; + # subcarrierSpacing + # 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + ul_subcarrierSpacing = 1; + ul_carrierBandwidth = 106; + pMax = 20; + #initialUplinkBWP + #genericParameters + initialULBWPlocationAndBandwidth = 28875; + # subcarrierSpacing + # 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + initialULBWPsubcarrierSpacing = 1; + #rach-ConfigCommon + #rach-ConfigGeneric + prach_ConfigurationIndex = 98; + #prach_msg1_FDM + #0 = one, 1=two, 2=four, 3=eight + prach_msg1_FDM = 0; + prach_msg1_FrequencyStart = 0; + zeroCorrelationZoneConfig = 13; + preambleReceivedTargetPower = -96; + #preamblTransMax (0...10) = (3,4,5,6,7,8,10,20,50,100,200) + preambleTransMax = 6; + #powerRampingStep + # 0=dB0,1=dB2,2=dB4,3=dB6 + powerRampingStep = 1; + #ra_ReponseWindow + #1,2,4,8,10,20,40,80 + ra_ResponseWindow = 4; + #ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR + #1=oneeighth,2=onefourth,3=half,4=one,5=two,6=four,7=eight,8=sixteen + ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR = 4; + #oneHalf (0..15) 4,8,12,16,...60,64 + ssb_perRACH_OccasionAndCB_PreamblesPerSSB = 14; + #ra_ContentionResolutionTimer + #(0..7) 8,16,24,32,40,48,56,64 + ra_ContentionResolutionTimer = 7; + rsrp_ThresholdSSB = 19; + #prach-RootSequenceIndex_PR + #1 = 839, 2 = 139 + prach_RootSequenceIndex_PR = 2; + prach_RootSequenceIndex = 1; + # SCS for msg1, can only be 15 for 30 kHz < 6 GHz, takes precendence over the one derived from prach-ConfigIndex + # + msg1_SubcarrierSpacing = 1, + # restrictedSetConfig + # 0=unrestricted, 1=restricted type A, 2=restricted type B + restrictedSetConfig = 0, + + msg3_DeltaPreamble = 1; + p0_NominalWithGrant =-90; + + # pucch-ConfigCommon setup : + # pucchGroupHopping + # 0 = neither, 1= group hopping, 2=sequence hopping + pucchGroupHopping = 0; + hoppingId = 40; + p0_nominal = -90; + # ssb_PositionsInBurs_BitmapPR + # 1=short, 2=medium, 3=long + ssb_PositionsInBurst_PR = 2; + ssb_PositionsInBurst_Bitmap = 1; + + # ssb_periodicityServingCell + # 0 = ms5, 1=ms10, 2=ms20, 3=ms40, 4=ms80, 5=ms160, 6=spare2, 7=spare1 + ssb_periodicityServingCell = 2; + + # dmrs_TypeA_position + # 0 = pos2, 1 = pos3 + dmrs_TypeA_Position = 0; + + # subcarrierSpacing + # 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + subcarrierSpacing = 1; + + + #tdd-UL-DL-ConfigurationCommon + # subcarrierSpacing + # 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + referenceSubcarrierSpacing = 1; + # pattern1 + # dl_UL_TransmissionPeriodicity + # 0=ms0p5, 1=ms0p625, 2=ms1, 3=ms1p25, 4=ms2, 5=ms2p5, 6=ms5, 7=ms10 + dl_UL_TransmissionPeriodicity = 6; + nrofDownlinkSlots = 7; + nrofDownlinkSymbols = 6; + nrofUplinkSlots = 2; + nrofUplinkSymbols = 4; + + ssPBCH_BlockPower = -25; + } + + ); + # ------- SCTP definitions + SCTP : + { + # Number of streams to use in input/output + SCTP_INSTREAMS = 2; + SCTP_OUTSTREAMS = 2; + }; + + + ////////// AMF parameters: + amf_ip_address = ( { ipv4 = "{{ .Values.config.amfIpAddress }}"; + ipv6 = "192:168:30::17"; + active = "yes"; + preference = "ipv4"; + } + ); + + E1_INTERFACE = + ( + { + type = "cp"; + ipv4_cucp = "{{ .Values.multus.e1Interface.IPadd }}"; + port_cucp = 38462; + ipv4_cuup = "{{ .Values.config.e1IpAddress }}"; + port_cuup = 38462; + } + ) + + NETWORK_INTERFACES : + { + GNB_INTERFACE_NAME_FOR_NG_AMF = "net2"; + GNB_IPV4_ADDRESS_FOR_NG_AMF = "{{ .Values.multus.n2Interface.IPadd }}"; + }; + } + ); + + security = { + # preferred ciphering algorithms + # the first one of the list that an UE supports in chosen + # valid values: nea0, nea1, nea2, nea3 + ciphering_algorithms = ( "nea0" ); + + # preferred integrity algorithms + # the first one of the list that an UE supports in chosen + # valid values: nia0, nia1, nia2, nia3 + integrity_algorithms = ( "nia2", "nia0" ); + + # setting 'drb_ciphering' to "no" disables ciphering for DRBs, no matter + # what 'ciphering_algorithms' configures; same thing for 'drb_integrity' + drb_ciphering = "yes"; + drb_integrity = "no"; + }; + log_config : + { + global_log_level ="info"; + hw_log_level ="info"; + phy_log_level ="info"; + mac_log_level ="info"; + rlc_log_level ="debug"; + pdcp_log_level ="info"; + rrc_log_level ="info"; + f1ap_log_level ="info"; + ngap_log_level ="debug"; + }; diff --git a/charts/oai-5g-ran/oai-gnb-cu-cp/templates/deployment.yaml b/charts/oai-5g-ran/oai-gnb-cu-cp/templates/deployment.yaml new file mode 100644 index 0000000000000000000000000000000000000000..805778e08854e817a613ed98eb4866166a1108a4 --- /dev/null +++ b/charts/oai-5g-ran/oai-gnb-cu-cp/templates/deployment.yaml @@ -0,0 +1,134 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Chart.Name }} + labels: + {{- include "oai-gnb-cu-cp.labels" . | nindent 4 }} +spec: + replicas: 1 + selector: + matchLabels: + {{- include "oai-gnb-cu-cp.selectorLabels" . | nindent 6 }} + strategy: + type: Recreate + template: + metadata: + labels: + {{- include "oai-gnb-cu-cp.selectorLabels" . | nindent 8 }} + app: oai-gnb-cu-cp-cp + {{- if .Values.multus.e1Interface.create }} + annotations: + k8s.v1.cni.cncf.io/networks: >- + [{ + "name": "{{ .Chart.Name }}-net1" + {{- if .Values.multus.defaultGateway }} + ,"default-route": ["{{ .Values.multus.defaultGateway }}"] + {{- end }} + } + {{- if .Values.multus.n2Interface.create }} + ,{ + "name": "{{ .Chart.Name }}-net2" + } + {{- end }} + {{- if .Values.multus.f1cInterface.create }} + ,{ + "name": "{{ .Chart.Name }}-net3" + } + {{- end }} + ] + {{- end }} + spec: + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + {{- if .Values.imagePullSecrets }} + imagePullSecrets: + {{ toYaml .Values.imagePullSecrets | indent 8 }} + {{- end }} + containers: + - name: gnbcucp + image: "{{ .Values.nfimage.repository }}:{{ .Values.nfimage.version }}" + volumeMounts: + - mountPath: /opt/oai-gnb/etc/mounted.conf + name: configuration + subPath: mounted.conf + {{- if .Values.resources.define}} + resources: + requests: + memory: {{ .Values.resources.requests.nf.memory | quote }} + cpu: {{ .Values.resources.requests.nf.cpu | quote }} + limits: + memory: {{ .Values.resources.limits.nf.memory | quote }} + cpu: {{ .Values.resources.limits.nf.cpu | quote }} + {{- end}} + securityContext: + privileged: true + ports: + - containerPort: 36412 + name: n2 + protocol: SCTP + - containerPort: 38462 + name: e1 + protocol: SCTP + - containerPort: 38472 + name: f1c + protocol: UDP + {{- if .Values.start.gnbcucp}} + {{- else}} + command: + - /bin/sleep + - infinity + {{- end}} + env: + - name: TZ + value: {{ .Values.config.timeZone }} + - name: USE_ADDITIONAL_OPTIONS + value: {{ .Values.config.useAdditionalOptions }} + - name: USE_VOLUMED_CONF + value: "yes" + {{- if .Values.includeTcpDumpContainer }} + - name: tcpdump + image: "{{ .Values.tcpdumpimage.repository }}:{{ .Values.tcpdumpimage.version }}" + imagePullPolicy: {{ .Values.tcpdumpimage.pullPolicy }} + {{- if .Values.resources.define}} + resources: + requests: + memory: {{ .Values.resources.requests.tcpdump.memory | quote }} + cpu: {{ .Values.resources.requests.tcpdump.cpu | quote }} + limits: + memory: {{ .Values.resources.limits.tcpdump.memory | quote }} + cpu: {{ .Values.resources.limits.tcpdump.cpu | quote }} + {{- end}} + securityContext: + privileged: true + capabilities: + add: + - NET_ADMIN + drop: + - ALL + {{- if .Values.start.tcpdump}} + command: + - /bin/sh + - -c + - /usr/sbin/tcpdump -i any -w /tmp/pcap/{{ .Chart.Name }}_`date +%Y-%m-%d_%H_%M-%S-%Z`.pcap + {{- else}} + command: + - /bin/sleep + - infinity + {{- end}} + {{- end }} + volumes: + - configMap: + name: {{ .Chart.Name }}-configmap + name: configuration + dnsPolicy: ClusterFirst + restartPolicy: Always + schedulerName: default-scheduler + serviceAccountName: {{ .Values.serviceAccount.name }} + terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }} + {{- if .Values.nodeSelector}} + nodeSelector: + {{- toYaml .Values.nodeSelector | nindent 12 }} + {{- end }} + {{- if .Values.nodeName}} + nodeName: {{ .Values.nodeName }} + {{- end }} diff --git a/charts/oai-5g-ran/oai-gnb-cu-cp/templates/multus.yaml b/charts/oai-5g-ran/oai-gnb-cu-cp/templates/multus.yaml new file mode 100644 index 0000000000000000000000000000000000000000..bbe4529afe40f510dbb9c7cab8a527ed05cee7b2 --- /dev/null +++ b/charts/oai-5g-ran/oai-gnb-cu-cp/templates/multus.yaml @@ -0,0 +1,84 @@ +--- +{{- if .Values.multus.e1Interface.create }} +apiVersion: "k8s.cni.cncf.io/v1" +kind: NetworkAttachmentDefinition +metadata: + name: {{ .Chart.Name }}-net1 +spec: + config: '{ + "cniVersion": "0.3.1", + "type": "macvlan", + "master": {{- cat .Values.multus.e1Interface.hostInterface | nospace | quote }}, + "mode": "bridge", + "ipam": { + "type": "static", + "addresses": [ + { + "address": {{- cat .Values.multus.e1Interface.IPadd "/" .Values.multus.e1Interface.Netmask | nospace | quote }} + {{- if .Values.multus.e1Interface.Gateway }} + ,"gateway": {{- cat .Values.multus.e1Interface.Gateway | nospace | quote }} + {{- end }} + } + ] + {{- if .Values.multus.e1Interface.routes }} + ,"routes": {{- .Values.multus.e1Interface.routes | toJson }} + {{- end }} + } + }' +{{- end }} +{{- if .Values.multus.n2Interface.create }} +--- +apiVersion: "k8s.cni.cncf.io/v1" +kind: NetworkAttachmentDefinition +metadata: + name: {{ .Chart.Name }}-net2 +spec: + config: '{ + "cniVersion": "0.3.1", + "type": "macvlan", + "master": {{- cat .Values.multus.n2Interface.hostInterface | nospace | quote }}, + "mode": "bridge", + "ipam": { + "type": "static", + "addresses": [ + { + "address": {{- cat .Values.multus.n2Interface.IPadd "/" .Values.multus.n2Interface.Netmask | nospace | quote }} + {{- if .Values.multus.n2Interface.Gateway }} + ,"gateway": {{- cat .Values.multus.n2Interface.Gateway | nospace | quote }} + {{- end }} + } + ] + {{- if .Values.multus.n2Interface.routes }} + ,"routes": {{- .Values.multus.n2Interface.routes | toJson }} + {{- end }} + } + }' +{{- end }} +{{- if .Values.multus.f1cInterface.create }} +--- +apiVersion: "k8s.cni.cncf.io/v1" +kind: NetworkAttachmentDefinition +metadata: + name: {{ .Chart.Name }}-net3 +spec: + config: '{ + "cniVersion": "0.3.1", + "type": "macvlan", + "master": {{- cat .Values.multus.f1cInterface.hostInterface | nospace | quote }}, + "mode": "bridge", + "ipam": { + "type": "static", + "addresses": [ + { + "address": {{- cat .Values.multus.f1cInterface.IPadd "/" .Values.multus.f1cInterface.Netmask | nospace | quote }} + {{- if .Values.multus.f1cInterface.Gateway }} + ,"gateway": {{- cat .Values.multus.f1cInterface.Gateway | nospace | quote }} + {{- end }} + } + ] + {{- if .Values.multus.f1cInterface.routes }} + ,"routes": {{- .Values.multus.f1cInterface.routes | toJson }} + {{- end }} + } + }' +{{- end }} \ No newline at end of file diff --git a/charts/simulators/gnbsim/templates/rbac.yaml b/charts/oai-5g-ran/oai-gnb-cu-cp/templates/rbac.yaml similarity index 97% rename from charts/simulators/gnbsim/templates/rbac.yaml rename to charts/oai-5g-ran/oai-gnb-cu-cp/templates/rbac.yaml index aa869868b9fad08e0a9065f53c34c1db15e25983..aed4d16a89647719ce3fc71eea05ca8fdde0e2ac 100644 --- a/charts/simulators/gnbsim/templates/rbac.yaml +++ b/charts/oai-5g-ran/oai-gnb-cu-cp/templates/rbac.yaml @@ -8,7 +8,7 @@ rules: - apiGroups: - security.openshift.io resourceNames: - - anyuid + - privileged resources: - securitycontextconstraints verbs: diff --git a/charts/simulators/gnbsim/templates/serviceaccount.yaml b/charts/oai-5g-ran/oai-gnb-cu-cp/templates/serviceaccount.yaml similarity index 100% rename from charts/simulators/gnbsim/templates/serviceaccount.yaml rename to charts/oai-5g-ran/oai-gnb-cu-cp/templates/serviceaccount.yaml diff --git a/charts/oai-5g-ran/oai-gnb-cu-cp/values.yaml b/charts/oai-5g-ran/oai-gnb-cu-cp/values.yaml new file mode 100644 index 0000000000000000000000000000000000000000..3ed70117f0f89ff2c752573ec868a162cd02627b --- /dev/null +++ b/charts/oai-5g-ran/oai-gnb-cu-cp/values.yaml @@ -0,0 +1,122 @@ +kubernetesType: Vanilla #Vanilla for community kubernetes distribution else Openshift for Openshift + +## In case of using these charts on Openshift then please use UBI images +## To know more about them follow this tutorial https://gitlab.eurecom.fr/oai/cn5g/oai-cn5g-fed/-/tree/master/openshift +nfimage: # image name either locally present or in a public/private repository + repository: docker.io/oaisoftwarealliance/oai-gnb ## dockerhub oaisoftwarealliance/oai-gnb + version: 2023.w19 # image tag or develop + # pullPolicy: IfNotPresent or Never or Always + pullPolicy: IfNotPresent + +## good to use when pulling images from docker-hub mention +imagePullSecrets: + - name: "regcred" + +serviceAccount: + # Specifies whether a service account should be created + create: true + # Annotations to add to the service account + annotations: {} + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "oai-gnb-cu-cp-sa" + +## CU-CP can work with 1 virtual ip-address here we are using three different virtual interfaces. +## In case you are using 1 ip-address for all 3 logical interfaces then please change it template/configmap.yaml +## Change these ip-addresses according to your environment + +multus: + # if default gatway is empty then it will be removed + defaultGateway: "172.21.7.254" + e1Interface: + create: true + IPadd: "172.21.6.90" + Netmask: "22" + # if gatway is empty then it will be removed + #Gateway: "172.21.7.254" + #routes: [{'dst': '10.8.0.0/24','gw': '172.21.7.254'}, {'dst': '10.9.0.0/24','gw': '172.21.7.254'}] + hostInterface: "bond0" # Interface of the host machine on which this pod will be scheduled + n2Interface: + create: true + IPadd: "172.21.6.98" + Netmask: "22" + # if gatway is empty then it will be removed + #Gateway: "172.21.7.254" + #routes: + hostInterface: "bond0" # Interface of the host machine on which this pod will be scheduled + f1cInterface: + create: true + IPadd: "172.21.6.92" + Netmask: "22" + # if gatway is empty then it will be removed + #Gateway: "172.21.7.254" + #routes: + hostInterface: "bond0" # Interface of the host machine on which this pod will be scheduled + +## configuration file is in template/config.yaml +## It is taken from https://gitlab.eurecom.fr/oai/openairinterface5g/-/blob/develop/ci-scripts/conf_files/gnb-cucp.sa.f1.conf +config: + timeZone: "Europe/Paris" + useAdditionalOptions: "--sa --log_config.global_log_options level,nocolor,time" + mcc: "001" # check the information with AMF, SMF, UPF/SPGWU + mnc: "01" # check the information with AMF, SMF, UPF/SPGWU + mncLength: "2" # check the information with AMF, SMF, UPF/SPGWU + tac: "1" # check the information with AMF + nssaiSst: "1" #currently only 4 standard values are allowed 1,2,3,4 + nssaiSd: "0xffffff" #values in hexa-decimal format + amfIpAddress: "172.21.6.94" # amf ip-address + e1IpAddress: "172.21.6.91" ## CU-UP ip-address + #Normally you don't have to set this but at the moment there is a bug so we need to provide DU ip-address + f1duIpAddress: "172.21.6.100" + +# Debugging section +podSecurityContext: + runAsUser: 0 + runAsGroup: 0 + +start: + gnbcucp: true + tcpdump: false + +includeTcpDumpContainer: false #If true it will add a tcpdump container inside network function pod for debugging + +## For openshift you can use rhel8/support-tools:8.7-13 +tcpdumpimage: + repository: docker.io/corfr/tcpdump + version: latest + #pullPolicy: IfNotPresent or Never or Always + pullPolicy: IfNotPresent + +## NF is the network function and tcpdump is the tcpdump container. +## To know more about request and limit it is better to understand that how Kubernetes QoS works. +## https://kubernetes.io/docs/concepts/configuration/manage-resources-containers +## https://kubernetes.io/docs/concepts/workloads/pods/pod-qos +resources: + define: false + limits: + nf: + cpu: 100m + memory: 128Mi + #If tcpdump container is disabled this value will not be used + tcpdump: + cpu: 100m + memory: 128Mi + requests: + nf: + cpu: 100m + memory: 128Mi + #If tcpdump container is disabled this value will not be used + tcpdump: + cpu: 100m + memory: 128Mi + + +tolerations: [] + +affinity: {} + +terminationGracePeriodSeconds: 5 + +nodeSelector: {} + +nodeName: diff --git a/charts/oai-5g-ran/oai-gnb-cu-up/Chart.yaml b/charts/oai-5g-ran/oai-gnb-cu-up/Chart.yaml new file mode 100644 index 0000000000000000000000000000000000000000..155ac6b9811fa1d9fcacf1b110c7db69cfe9e9c1 --- /dev/null +++ b/charts/oai-5g-ran/oai-gnb-cu-up/Chart.yaml @@ -0,0 +1,58 @@ +################################################################################ +# Licensed to the OpenAirInterface (OAI) Software Alliance under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The OpenAirInterface Software Alliance licenses this file to You under +# the OAI Public License, Version 1.1 (the "License"); you may not use this file +# except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.openairinterface.org/?page_id=698 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#------------------------------------------------------------------------------- +# For more information about the OpenAirInterface (OAI) Software Alliance: +# contact@openairinterface.org +################################################################################ + +apiVersion: v2 +name: oai-gnb-cu-up +description: A Helm chart for gnb-cu network function + +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. +type: application + +icon: http://www.openairinterface.org/wp-content/uploads/2015/06/cropped-oai_final_logo.png + +# This is the chart version. This version number should be incremented each time you make changes +# to the chart and its templates, including the app version. +version: 1.0.0 + +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. +appVersion: develop + +keywords: + - RF_Simulator + - gNB + - RAN + - 5G + - CU-UP + +sources: + - https://gitlab.eurecom.fr/oai/openairinterface5g + +maintainers: + - name: OPENAIRINTERFACE + email: contact@openairinterface.org diff --git a/charts/oai-5g-ran/oai-gnb-cu-up/README.md b/charts/oai-5g-ran/oai-gnb-cu-up/README.md new file mode 100644 index 0000000000000000000000000000000000000000..50c81e6d3d0aebd318f0d4f6828cacadedf8454e --- /dev/null +++ b/charts/oai-5g-ran/oai-gnb-cu-up/README.md @@ -0,0 +1,146 @@ +# Helm Chart for OAI Central Unit User Plane (OAI-CU-UP) + +Before using this helm-chart we recommend you read about OAI codebase and its working from the documents listed on [OAI gitlab](https://gitlab.eurecom.fr/oai/openairinterface5g/-/tree/develop/doc). Here you can find a dedicated document on [F1 design](https://gitlab.eurecom.fr/oai/openairinterface5g/-/blob/develop/doc/F1-design.md) and [E1 design](https://gitlab.eurecom.fr/oai/openairinterface5g/-/blob/develop/doc/E1-design.md) + +**Note**: This chart is tested on [Minikube](https://minikube.sigs.k8s.io/docs/) and [Red Hat Openshift](https://www.redhat.com/fr/technologies/cloud-computing/openshift) 4.10 and 4.12. It requires minimum 1CPU and 1Gi RAM and [multus-cni](https://github.com/k8snetworkplumbingwg/multus-cni) plugin for multiple interfaces. + +## Introduction + +To know more about the feature set of OpenAirInterface you can check it [here](https://gitlab.eurecom.fr/oai/openairinterface5g/-/blob/develop/doc/FEATURE_SET.md#openairinterface-5g-nr-feature-set). + +The [codebase](https://gitlab.eurecom.fr/oai/openairinterface5g/-/tree/develop) for gNB, CU, DU, CU-CP/CU-UP, NR-UE is the same. Everyweek on [docker-hub](https://hub.docker.com/r/oaisoftwarealliance/oai-gnb) our [Jenkins Platform](https://jenkins-oai.eurecom.fr/view/RAN/) publishes two docker-images + +1. `oaisoftwarealliance/oai-gnb` for monolithic gNB, DU, CU, CU-CP +2. `oaisoftwarealliance/oai-nr-cuup` for CU-UP. + +Each image has develop tag and a dedicated week tag for example `2023.w18`. We only publish Ubuntu 18.04/20.04 images. We do not publish RedHat/UBI images. These images you have to build from the source code on your RedHat systems or Openshift Platform. You can follow this [tutorial](../../../openshift/README.md) for that. + +The helm chart of OAI-CU-UP creates multiples Kubernetes resources, + +1. Service +2. Role Base Access Control (RBAC) (role and role bindings) +3. Deployment +4. Configmap +5. Service account +6. Network-attachment-defination (Optional only when multus is used) + +The directory structure + +``` +. +├── Chart.yaml +├── templates +│  ├── configmap.yaml +│  ├── deployment.yaml +│  ├── _helpers.tpl +│  ├── multus.yaml +│  ├── NOTES.txt +│  ├── rbac.yaml +│  ├── serviceaccount.yaml +│  └── service.yaml +└── values.yaml +``` + +## Parameters + +[Values.yaml](./values.yaml) contains all the configurable parameters. Below table defines the configurable parameters. The ip-addresses of N3, E1 and F1U have to be pre-configured in the configuration. Most of the primary CNIs do not allow static ip-address allocation. To overcome this we are using multus-cni with static ip-address allocation. At minimum you have to create one multus interface which you can use for N3, E1 and F1U. If you want you can create dedicated interfaces for N3, E1 and F1U. + + +|Parameter |Allowed Values |Remark | +|---------------------------------|-------------------------------|---------------------------------| +|kubernetesType |Vanilla/Openshift |Vanilla Kubernetes or Openshift | +|nfimage.repository |Image Name | | +|nfimage.version |Image tag | | +|nfimage.pullPolicy |IfNotPresent or Never or Always| | +|imagePullSecrets.name |String |Good to use for docker hub | +|serviceAccount.create |true/false | | +|serviceAccount.annotations |String | | +|serviceAccount.name |String | | +|podSecurityContext.runAsUser |Integer (0,65534) | | +|podSecurityContext.runAsGroup |Integer (0,65534) | | +|multus.defaultGateway |Ip-Address |default route in the pod | +|multus.n3Interface.create |true/false | | +|multus.n3Interface.IPadd |Ip-Address | | +|multus.n3Interface.Netmask |Netmask | | +|multus.n3Interface.Gateway |Ip-Address | | +|multus.n3Interface.routes |Json |Routes you want to add in the pod| +|multus.n3Interface.hostInterface |host interface |Host machine interface name | +|multus.e1Interface.create |true/false | | +|multus.e1Interface.IPadd |Ip-Address) | | +|multus.e1Interface.Netmask |Netmask | | +|multus.e1Interface.Gateway |Ip-Address | | +|multus.e1Interface.hostInterface |host interface | | +|multus.e1Interface.routes |Json |Routes you want to add in the pod| +|multus.f1uInterface.create |true/false | | +|multus.f1uInterface.IPadd |Ip-Address | | +|multus.f1uInterface.Netmask |Netmask | | +|multus.f1uInterface.Gateway |Ip-Address | | +|multus.f1uInterface.routes |Json |Routes you want to add in the pod| +|multus.f1uInterface.hostInterface|host interface |Host machine interface name | + +The config parameters mentioned in `config` block of `values.yaml` are limited on purpose to maintain simplicity. They do not allow changing a lot of parameters of oai-gnb-cu. If you want to use your own configuration file for oai-gnb-cu-up. It is recommended to copy it in `templates/configmap.yaml` and set `config.mountConfig` as `true`. The command line for gnb is provided in `config.useAdditionalOptions`. + +You can find [here](https://gitlab.eurecom.fr/oai/openairinterface5g/-/tree/develop/targets/PROJECTS/GENERIC-NR-5GC/CONF) different sample configuration files for different bandwidths and frequencies. The binary of oai-gnb is called as `nr-softmodem`. To know more about its functioning and command line parameters you can visit this [page](https://gitlab.eurecom.fr/oai/openairinterface5g/-/blob/develop/doc/RUNMODEM.md) + +## Advanced Debugging Parameters + +Only needed if you are doing advanced debugging + + +|Parameter |Allowed Values |Remark | +|---------------------------------|-------------------------------|-----------------------------------------------| +|start.gnbcuup |true/false |If true gnbcuup container will go in sleep mode| +|start.tcpdump |true/false |If true tcpdump container will go in sleepmode | +|includeTcpDumpContainer |true/false |If false no tcpdump container will be there | +|tcpdumpimage.repository |Image Name | | +|tcpdumpimage.version |Image tag | | +|tcpdumpimage.pullPolicy |IfNotPresent or Never or Always| | +|persistent.sharedvolume |true/false |Save the pcaps in a shared volume with NRF | +|resources.define |true/false | | +|resources.limits.tcpdump.cpu |string |Unit m for milicpu or cpu | +|resources.limits.tcpdump.memory |string |Unit Mi/Gi/MB/GB | +|resources.limits.nf.cpu |string |Unit m for milicpu or cpu | +|resources.limits.nf.memory |string |Unit Mi/Gi/MB/GB | +|resources.requests.tcpdump.cpu |string |Unit m for milicpu or cpu | +|resources.requests.tcpdump.memory|string |Unit Mi/Gi/MB/GB | +|resources.requests.nf.cpu |string |Unit m for milicpu or cpu | +|resources.requests.nf.memory |string |Unit Mi/Gi/MB/GB | +|readinessProbe |true/false |default true | +|livenessProbe |true/false |default false | +|terminationGracePeriodSeconds |5 |In seconds (default 5) | +|nodeSelector |Node label | | +|nodeName |Node Name | | + +## How to use + +Make sure core network and `oai-gnb-cu-cp` is running before starting the `cu-up` + +```bash +helm install oai-gnb-cu-cp ../oai-gnb-cu-cp +#wait for cu-cp to start +helm install oai-gnb-cu-up . +helm install oai-gnb-du ../oai-gnb-du +``` + +### Connect the UE + +1. Configure the `oai-nr-ue` charts for `oai-gnb-du`, change `config.rfSimulator` to `oai-gnb-du` and `useAdditionalOptions` to "--sa --rfsim -r 106 --numerology 1 -C 3619200000 --nokrnmod --log_config.global_log_options level,nocolor,time". As the configuration of cu/du is set at this frequency and resource block. If you mount your own configuration file then set the configuration of nr-ue accordingly. + +```bash +helm install oai-nr-ue ../oai-nr-ue +``` + +2. Once NR-UE is connected you can go inside the pod and ping via `oai` interface. If you do not see this interface then the UE is not connected to gNB or have some issues at core network. + +```bash +kubectl exec -it <oai-nr-ue-pod-name> -- bash +#ping towards spgwu/upf +ping -I oaitun_ue1 12.1.1.1 +#ping towards google dns +ping -I oaitun_ue1 8.8.8.8 +``` + + +## Note + +1. If you are using multus then make sure it is properly configured and if you don't have a gateway for your multus interface then avoid using gateway and defaultGateway parameter. Either comment them or leave them empty. Wrong gateway configuration can create issues with pod networking and pod will not be able to resolve service names. \ No newline at end of file diff --git a/charts/oai-5g-ran/oai-gnb-cu-up/templates/NOTES.txt b/charts/oai-5g-ran/oai-gnb-cu-up/templates/NOTES.txt new file mode 100644 index 0000000000000000000000000000000000000000..b173b2265e255fba39fe6c6a719821d876dde6fe --- /dev/null +++ b/charts/oai-5g-ran/oai-gnb-cu-up/templates/NOTES.txt @@ -0,0 +1,5 @@ +1. Get the application name by running these commands: + export GNB__CU_POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "oai-gnb-cu-up.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") +2. Dockerhub images of OpenAirInterface requires avx2 capabilities in the cpu and they are built for x86 architecture, tested on UBUNTU OS only. +3. If you want to configure for a particular band then copy the configuration file in templates/configmap.yaml from here https://gitlab.eurecom.fr/oai/openairinterface5g/-/tree/develop/targets/PROJECTS/GENERIC-NR-5GC/CONF +4. For good performance make sure your underlying kernel is realtime and CPU sleep states are off diff --git a/charts/oai-5g-ran/oai-gnb-cu-up/templates/_helpers.tpl b/charts/oai-5g-ran/oai-gnb-cu-up/templates/_helpers.tpl new file mode 100644 index 0000000000000000000000000000000000000000..086f41508c745cb9a7d62697436809d8233c1d2a --- /dev/null +++ b/charts/oai-5g-ran/oai-gnb-cu-up/templates/_helpers.tpl @@ -0,0 +1,63 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "oai-gnb-cu-up.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "oai-gnb-cu-up.fullname" -}} +{{- if .Values.fullnameOverride -}} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- $name := default .Chart.Name .Values.nameOverride -}} +{{- if contains $name .Release.Name -}} +{{- .Release.Name | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} +{{- end -}} +{{- end -}} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "oai-gnb-cu-up.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Common labels +*/}} +{{- define "oai-gnb-cu-up.labels" -}} +helm.sh/chart: {{ include "oai-gnb-cu-up.chart" . }} +{{ include "oai-gnb-cu-up.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end -}} + +{{/* +Selector labels +*/}} +{{- define "oai-gnb-cu-up.selectorLabels" -}} +app.kubernetes.io/name: {{ include "oai-gnb-cu-up.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end -}} + +{{/* +Create the name of the service account to use +*/}} +{{- define "oai-gnb-cu-up.serviceAccountName" -}} +{{- if .Values.serviceAccount.create -}} + {{ default (include "oai-gnb-cu-up.fullname" .) .Values.serviceAccount.name }} +{{- else -}} + {{ default "default" .Values.serviceAccount.name }} +{{- end -}} +{{- end -}} diff --git a/charts/oai-5g-ran/oai-gnb-cu-up/templates/configmap.yaml b/charts/oai-5g-ran/oai-gnb-cu-up/templates/configmap.yaml new file mode 100644 index 0000000000000000000000000000000000000000..93f01a2ef4cd6ad7a26276b337e3c89c173ebfb0 --- /dev/null +++ b/charts/oai-5g-ran/oai-gnb-cu-up/templates/configmap.yaml @@ -0,0 +1,94 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ .Chart.Name }}-configmap +data: + mounted.conf: | + Active_gNBs = ( "oai-cu-up"); + # Asn1_verbosity, choice in: none, info, annoying + Asn1_verbosity = "none"; + sa = 1; + gNBs = + ( + { + ////////// Identification parameters: + gNB_CU_ID = 0xe00; + + # cell_type = "CELL_MACRO_GNB"; + + gNB_name = "oai-cu-up"; + + // Tracking area code, 0x0000 and 0xfffe are reserved values + tracking_area_code = 1; + plmn_list = ({ mcc = {{ .Values.config.mcc }}; + mnc = {{ .Values.config.mnc }}; + mnc_length ={{ .Values.config.mncLength }}; + snssaiList = ({ sst = {{ .Values.config.nssaiSst }}, sd = {{ .Values.config.nssaiSd }} }) + }); + + tr_s_preference = "f1"; + + local_s_if_name = "net3"; + local_s_address = "{{ .Values.multus.f1uInterface.IPadd }}"; + remote_s_address = "{{ .Values.config.f1duIpAddress }}"; + local_s_portc = 501; + local_s_portd = 2152; + remote_s_portc = 500; + remote_s_portd = 2152; + + # ------- SCTP definitions + SCTP : + { + # Number of streams to use in input/output + SCTP_INSTREAMS = 2; + SCTP_OUTSTREAMS = 2; + }; + + E1_INTERFACE = + ( + { + type = "up"; + ipv4_cucp = "{{ .Values.config.e1IpAddress }}"; + ipv4_cuup = "{{ .Values.multus.e1Interface.IPadd }}"; + } + ) + + NETWORK_INTERFACES : + { + GNB_INTERFACE_NAME_FOR_NG_AMF = "net2"; + GNB_IPV4_ADDRESS_FOR_NG_AMF = "{{ .Values.multus.n3Interface.IPadd }}"; + GNB_INTERFACE_NAME_FOR_NGU = "net2"; + GNB_IPV4_ADDRESS_FOR_NGU = "{{ .Values.multus.n3Interface.IPadd }}"; + GNB_PORT_FOR_S1U = 2152; # Spec 2152 + }; + } + ); + + security = { + # preferred ciphering algorithms + # the first one of the list that an UE supports in chosen + # valid values: nea0, nea1, nea2, nea3 + ciphering_algorithms = ( "nea0" ); + + # preferred integrity algorithms + # the first one of the list that an UE supports in chosen + # valid values: nia0, nia1, nia2, nia3 + integrity_algorithms = ( "nia2", "nia0" ); + + # setting 'drb_ciphering' to "no" disables ciphering for DRBs, no matter + # what 'ciphering_algorithms' configures; same thing for 'drb_integrity' + drb_ciphering = "yes"; + drb_integrity = "no"; + }; + log_config : + { + global_log_level ="info"; + hw_log_level ="info"; + phy_log_level ="info"; + mac_log_level ="info"; + rlc_log_level ="debug"; + pdcp_log_level ="info"; + rrc_log_level ="info"; + f1ap_log_level ="info"; + ngap_log_level ="debug"; + }; diff --git a/charts/oai-5g-ran/oai-gnb-cu-up/templates/deployment.yaml b/charts/oai-5g-ran/oai-gnb-cu-up/templates/deployment.yaml new file mode 100644 index 0000000000000000000000000000000000000000..c2e3a5b23e9a5212ef470700349316560bfa34e0 --- /dev/null +++ b/charts/oai-5g-ran/oai-gnb-cu-up/templates/deployment.yaml @@ -0,0 +1,134 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Chart.Name }} + labels: + {{- include "oai-gnb-cu-up.labels" . | nindent 4 }} +spec: + replicas: 1 + selector: + matchLabels: + {{- include "oai-gnb-cu-up.selectorLabels" . | nindent 6 }} + strategy: + type: Recreate + template: + metadata: + labels: + {{- include "oai-gnb-cu-up.selectorLabels" . | nindent 8 }} + app: oai-gnb-cu-up + {{- if .Values.multus.e1Interface.create }} + annotations: + k8s.v1.cni.cncf.io/networks: >- + [{ + "name": "{{ .Chart.Name }}-net1" + {{- if .Values.multus.defaultGateway }} + ,"default-route": ["{{ .Values.multus.defaultGateway }}"] + {{- end }} + } + {{- if .Values.multus.n3Interface.create }} + ,{ + "name": "{{ .Chart.Name }}-net2" + } + {{- end }} + {{- if .Values.multus.f1uInterface.create }} + ,{ + "name": "{{ .Chart.Name }}-net3" + } + {{- end }} + ] + {{- end }} + spec: + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + {{- if .Values.imagePullSecrets }} + imagePullSecrets: + {{ toYaml .Values.imagePullSecrets | indent 8 }} + {{- end }} + containers: + - name: gnbcuup + image: "{{ .Values.nfimage.repository }}:{{ .Values.nfimage.version }}" + volumeMounts: + - mountPath: /opt/oai-gnb/etc/mounted.conf + name: configuration + subPath: mounted.conf + {{- if .Values.resources.define}} + resources: + requests: + memory: {{ .Values.resources.requests.nf.memory | quote }} + cpu: {{ .Values.resources.requests.nf.cpu | quote }} + limits: + memory: {{ .Values.resources.limits.nf.memory | quote }} + cpu: {{ .Values.resources.limits.nf.cpu | quote }} + {{- end}} + securityContext: + privileged: true + ports: + - containerPort: 2152 + name: n3 + protocol: UDP + - containerPort: 38462 + name: e1 + protocol: SCTP + - containerPort: 2152 + name: f1u + protocol: UDP + {{- if .Values.start.gnbcuup}} + {{- else}} + command: + - /bin/sleep + - infinity + {{- end}} + env: + - name: TZ + value: {{ .Values.config.timeZone }} + - name: USE_ADDITIONAL_OPTIONS + value: {{ .Values.config.useAdditionalOptions }} + - name: USE_VOLUMED_CONF + value: "yes" + {{- if .Values.includeTcpDumpContainer }} + - name: tcpdump + image: "{{ .Values.tcpdumpimage.repository }}:{{ .Values.tcpdumpimage.version }}" + imagePullPolicy: {{ .Values.tcpdumpimage.pullPolicy }} + {{- if .Values.resources.define}} + resources: + requests: + memory: {{ .Values.resources.requests.tcpdump.memory | quote }} + cpu: {{ .Values.resources.requests.tcpdump.cpu | quote }} + limits: + memory: {{ .Values.resources.limits.tcpdump.memory | quote }} + cpu: {{ .Values.resources.limits.tcpdump.cpu | quote }} + {{- end}} + securityContext: + privileged: true + capabilities: + add: + - NET_ADMIN + drop: + - ALL + {{- if .Values.start.tcpdump}} + command: + - /bin/sh + - -c + - /usr/sbin/tcpdump -i any -w /tmp/pcap/{{ .Chart.Name }}_`date +%Y-%m-%d_%H_%M-%S-%Z`.pcap + {{- else}} + command: + - /bin/sleep + - infinity + {{- end}} + {{- end}} + volumes: + - configMap: + name: {{ .Chart.Name }}-configmap + name: configuration + dnsPolicy: ClusterFirst + restartPolicy: Always + schedulerName: default-scheduler + serviceAccountName: {{ .Values.serviceAccount.name }} + terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }} + {{- if .Values.nodeSelector}} + nodeSelector: + {{- toYaml .Values.nodeSelector | nindent 12 }} + {{- end }} + {{- if .Values.nodeName}} + nodeName: {{ .Values.nodeName }} + {{- end }} diff --git a/charts/oai-5g-ran/oai-gnb-cu-up/templates/multus.yaml b/charts/oai-5g-ran/oai-gnb-cu-up/templates/multus.yaml new file mode 100644 index 0000000000000000000000000000000000000000..61b86fb3737d512591c87f7f64be76340f7708fd --- /dev/null +++ b/charts/oai-5g-ran/oai-gnb-cu-up/templates/multus.yaml @@ -0,0 +1,84 @@ +--- +{{- if .Values.multus.e1Interface.create }} +apiVersion: "k8s.cni.cncf.io/v1" +kind: NetworkAttachmentDefinition +metadata: + name: {{ .Chart.Name }}-net1 +spec: + config: '{ + "cniVersion": "0.3.1", + "type": "macvlan", + "master": {{- cat .Values.multus.e1Interface.hostInterface | nospace | quote }}, + "mode": "bridge", + "ipam": { + "type": "static", + "addresses": [ + { + "address": {{- cat .Values.multus.e1Interface.IPadd "/" .Values.multus.e1Interface.Netmask | nospace | quote }} + {{- if .Values.multus.e1Interface.Gateway }} + ,"gateway": {{- cat .Values.multus.e1Interface.Gateway | nospace | quote }} + {{- end }} + } + ] + {{- if .Values.multus.e1Interface.routes }} + ,"routes": {{- .Values.multus.e1Interface.routes | toJson }} + {{- end }} + } + }' +{{- end }} +{{- if .Values.multus.n3Interface.create }} +--- +apiVersion: "k8s.cni.cncf.io/v1" +kind: NetworkAttachmentDefinition +metadata: + name: {{ .Chart.Name }}-net2 +spec: + config: '{ + "cniVersion": "0.3.1", + "type": "macvlan", + "master": {{- cat .Values.multus.n3Interface.hostInterface | nospace | quote }}, + "mode": "bridge", + "ipam": { + "type": "static", + "addresses": [ + { + "address": {{- cat .Values.multus.n3Interface.IPadd "/" .Values.multus.n3Interface.Netmask | nospace | quote }} + {{- if .Values.multus.n3Interface.Gateway }} + ,"gateway": {{- cat .Values.multus.n3Interface.Gateway | nospace | quote }} + {{- end }} + } + ] + {{- if .Values.multus.n3Interface.routes }} + ,"routes": {{- .Values.multus.n3Interface.routes | toJson }} + {{- end }} + } + }' +{{- end }} +{{- if .Values.multus.f1uInterface.create }} +--- +apiVersion: "k8s.cni.cncf.io/v1" +kind: NetworkAttachmentDefinition +metadata: + name: {{ .Chart.Name }}-net3 +spec: + config: '{ + "cniVersion": "0.3.1", + "type": "macvlan", + "master": {{- cat .Values.multus.f1uInterface.hostInterface | nospace | quote }}, + "mode": "bridge", + "ipam": { + "type": "static", + "addresses": [ + { + "address": {{- cat .Values.multus.f1uInterface.IPadd "/" .Values.multus.f1uInterface.Netmask | nospace | quote }} + {{- if .Values.multus.f1uInterface.Gateway }} + ,"gateway": {{- cat .Values.multus.f1uInterface.Gateway | nospace | quote }} + {{- end }} + } + ] + {{- if .Values.multus.f1uInterface.routes }} + ,"routes": {{- .Values.multus.f1uInterface.routes | toJson }} + {{- end }} + } + }' +{{- end }} \ No newline at end of file diff --git a/charts/oai-5g-ran/oai-gnb-cu-up/templates/rbac.yaml b/charts/oai-5g-ran/oai-gnb-cu-up/templates/rbac.yaml new file mode 100644 index 0000000000000000000000000000000000000000..aed4d16a89647719ce3fc71eea05ca8fdde0e2ac --- /dev/null +++ b/charts/oai-5g-ran/oai-gnb-cu-up/templates/rbac.yaml @@ -0,0 +1,29 @@ +--- +{{- if eq .Values.kubernetesType "Openshift" }} +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: {{ .Chart.Name }}-{{ .Release.Namespace }}-role +rules: +- apiGroups: + - security.openshift.io + resourceNames: + - privileged + resources: + - securitycontextconstraints + verbs: + - use +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: {{ .Chart.Name }}-{{ .Release.Namespace }}-binding +subjects: +- kind: ServiceAccount + name: {{ .Values.serviceAccount.name }} + namespace: {{ .Release.Namespace }} +roleRef: + kind: Role + name: {{ .Chart.Name }}-{{ .Release.Namespace }}-role + apiGroup: rbac.authorization.k8s.io +{{- end }} \ No newline at end of file diff --git a/charts/oai-5g-ran/oai-gnb-cu-up/templates/serviceaccount.yaml b/charts/oai-5g-ran/oai-gnb-cu-up/templates/serviceaccount.yaml new file mode 100644 index 0000000000000000000000000000000000000000..21c813d6a41f817b3c4eda3770cf4f86da0634ed --- /dev/null +++ b/charts/oai-5g-ran/oai-gnb-cu-up/templates/serviceaccount.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ .Values.serviceAccount.name }} diff --git a/charts/oai-5g-ran/oai-gnb-cu-up/values.yaml b/charts/oai-5g-ran/oai-gnb-cu-up/values.yaml new file mode 100644 index 0000000000000000000000000000000000000000..1417b37f8f3785048418c87528690ba5d69d7c6e --- /dev/null +++ b/charts/oai-5g-ran/oai-gnb-cu-up/values.yaml @@ -0,0 +1,120 @@ +kubernetesType: Vanilla #Vanilla for community kubernetes distribution else Openshift for Openshift + +## In case of using these charts on Openshift then please use UBI images +## To know more about them follow this tutorial https://gitlab.eurecom.fr/oai/cn5g/oai-cn5g-fed/-/tree/master/openshift +nfimage: # image name either locally present or in a public/private repository + repository: docker.io/oaisoftwarealliance/oai-nr-cuup ## dockerhub oaisoftwarealliance/oai-gnb + version: 2023.w19 # image tag or develop + # pullPolicy: IfNotPresent or Never or Always + pullPolicy: IfNotPresent + +## good to use when pulling images from docker-hub mention +imagePullSecrets: + - name: "regcred" + +serviceAccount: + # Specifies whether a service account should be created + create: true + # Annotations to add to the service account + annotations: {} + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "oai-gnb-cu-up-sa" + +## CU-UP can work with 1 virtual ip-address here we are using three different virtual interfaces. +## In case you are using 1 ip-address for all 3 logical interfaces then please change it template/configmap.yaml +## Change these ip-addresses according to your environment +multus: + #if defaultGateway is empty then it will be removed + defaultGateway: "172.21.7.254" + e1Interface: + create: true + IPadd: "172.21.6.91" + Netmask: "22" + # if gatway is empty then it will be removed + Gateway: + #routes: [{'dst': '10.8.0.0/24','gw': '172.21.7.254'}, {'dst': '10.9.0.0/24','gw': '172.21.7.254'}] + hostInterface: "bond0" # Interface of the host machine on which this pod will be scheduled + n3Interface: + create: true + IPadd: "172.21.6.97" + Netmask: "22" + # if gatway is empty then it will be removed + Gateway: + #routes: + hostInterface: "bond0" # Interface of the host machine on which this pod will be scheduled + f1uInterface: + create: true + IPadd: "172.21.6.93" + Netmask: "22" + # if gatway is empty then it will be removed + Gateway: + #routes: + hostInterface: "bond0" # Interface of the host machine on which this pod will be scheduled + +## configuration file is in template/config.yaml +## It is taken from https://gitlab.eurecom.fr/oai/openairinterface5g/-/blob/develop/ci-scripts/conf_files/gnb-cuup.sa.f1.conf +config: + timeZone: "Europe/Paris" + useAdditionalOptions: "--sa" + mcc: "001" # check the information with AMF, SMF, UPF/SPGWU + mnc: "01" # check the information with AMF, SMF, UPF/SPGWU + mncLength: "2" # check the information with AMF, SMF, UPF/SPGWU + tac: "1" # check the information with AMF + nssaiSst: "1" #currently only 4 standard values are allowed 1,2,3,4 + nssaiSd: "0xffffff" #values in hexa-decimal format + e1IpAddress: 172.21.6.90 + ## Its the DU which communicates with the CU so no need for DU ip-address + f1duIpAddress: "172.21.6.100" + + +## Debugging section +podSecurityContext: + runAsUser: 0 + runAsGroup: 0 + +start: + gnbcuup: true #If false the network function container will run in sleep mode for manually testing + tcpdump: false + +includeTcpDumpContainer: false #If true it will add a tcpdump container inside network function pod for debugging + +## For openshift you can use rhel8/support-tools:8.7-13 +tcpdumpimage: + repository: docker.io/corfr/tcpdump + version: latest + #pullPolicy: IfNotPresent or Never or Always + pullPolicy: IfNotPresent + +## NF is the network function and tcpdump is the tcpdump container. +## To know more about request and limit it is better to understand that how Kubernetes QoS works. +## https://kubernetes.io/docs/concepts/configuration/manage-resources-containers +## https://kubernetes.io/docs/concepts/workloads/pods/pod-qos +resources: + define: false + limits: + nf: + cpu: 100m + memory: 128Mi + #If tcpdump container is disabled this value will not be used + tcpdump: + cpu: 100m + memory: 128Mi + requests: + nf: + cpu: 100m + memory: 128Mi + #If tcpdump container is disabled this value will not be used + tcpdump: + cpu: 100m + memory: 128Mi + +tolerations: [] + +affinity: {} + +terminationGracePeriodSeconds: 5 + +nodeSelector: {} + +nodeName: diff --git a/charts/oai-5g-ran/oai-gnb-cu/Chart.yaml b/charts/oai-5g-ran/oai-gnb-cu/Chart.yaml index a393203673880e6f63c197ef2d6da7607daedc69..03455266f20f063ac2eb2ce1ecff5a27b5aa0b10 100644 --- a/charts/oai-5g-ran/oai-gnb-cu/Chart.yaml +++ b/charts/oai-5g-ran/oai-gnb-cu/Chart.yaml @@ -37,7 +37,7 @@ icon: http://www.openairinterface.org/wp-content/uploads/2015/06/cropped-oai_fin # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. -version: 0.1.1 +version: 1.0.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. diff --git a/charts/oai-5g-ran/oai-gnb-cu/README.md b/charts/oai-5g-ran/oai-gnb-cu/README.md new file mode 100644 index 0000000000000000000000000000000000000000..9eaac00c4f422597add5b00117d3ad99633401c9 --- /dev/null +++ b/charts/oai-5g-ran/oai-gnb-cu/README.md @@ -0,0 +1,148 @@ +# Helm Chart for OAI Central Unit (OAI-CU) + +Before using these helm-charts we recommend you read about OAI codebase and its working from the documents listed on [OAI gitlab](https://gitlab.eurecom.fr/oai/openairinterface5g/-/tree/develop/doc). Here you can find a dedicated document on [F1 design](https://gitlab.eurecom.fr/oai/openairinterface5g/-/blob/develop/doc/F1-design.md). + +**Note**: This chart is tested on [Minikube](https://minikube.sigs.k8s.io/docs/) and [Red Hat Openshift](https://www.redhat.com/fr/technologies/cloud-computing/openshift) 4.10 and 4.12. It requires minimum 1CPU and 1Gi RAM and [multus-cni](https://github.com/k8snetworkplumbingwg/multus-cni) plugin for multiple interfaces. + + +## Introduction + +To know more about the feature set of OpenAirInterface you can check it [here](https://gitlab.eurecom.fr/oai/openairinterface5g/-/blob/develop/doc/FEATURE_SET.md#openairinterface-5g-nr-feature-set). + +The [codebase](https://gitlab.eurecom.fr/oai/openairinterface5g/-/tree/develop) for gNB, CU, DU, CU-CP/CU-UP, NR-UE is the same. Everyweek on [docker-hub](https://hub.docker.com/r/oaisoftwarealliance/oai-gnb) our [Jenkins Platform](https://jenkins-oai.eurecom.fr/view/RAN/) publishes two docker-images + +1. `oaisoftwarealliance/oai-gnb` for monolithic gNB, DU, CU, CU-CP +2. `oaisoftwarealliance/oai-nr-cuup` for CU-UP. + +Each image has develop tag and a dedicated week tag for example `2023.w18`. We only publish Ubuntu 18.04/20.04 images. We do not publish RedHat/UBI images. These images you have to build from the source code on your RedHat systems or Openshift Platform. You can follow this [tutorial](../../../openshift/README.md) for that. + +The helm chart of OAI-CU creates multiples Kubernetes resources, + +1. Service +2. Role Base Access Control (RBAC) (role and role bindings) +3. Deployment +4. Configmap +5. Service account +6. Network-attachment-defination (Optional only when multus is used) + +The directory structure + +``` +. +├── Chart.yaml +├── templates +│  ├── configmap.yaml +│  ├── deployment.yaml +│  ├── _helpers.tpl +│  ├── multus.yaml +│  ├── NOTES.txt +│  ├── rbac.yaml +│  ├── serviceaccount.yaml +│  └── service.yaml +└── values.yaml +``` + +## Parameters + +[Values.yaml](./values.yaml) contains all the configurable parameters. Below table defines the configurable parameters. You can use the same interface for N2,N3 and F1. If you want you can create dedicated interface for N2, N3 and F1. + + +|Parameter |Allowed Values |Remark | +|--------------------------------|-------------------------------|--------------------------------------| +|kubernetesType |Vanilla/Openshift |Vanilla Kubernetes or Openshift | +|nfimage.repository |Image Name | | +|nfimage.version |Image tag | | +|nfimage.pullPolicy |IfNotPresent or Never or Always| | +|imagePullSecrets.name |String |Good to use for docker hub | +|serviceAccount.create |true/false | | +|serviceAccount.annotations |String | | +|serviceAccount.name |String | | +|podSecurityContext.runAsUser |Integer (0,65534) | | +|podSecurityContext.runAsGroup |Integer (0,65534) | | +|multus.defaultGateway |Ip-Address |default route in the pod | +|multus.n2Interface.create |true/false | | +|multus.n2Interface.IPadd |Ip-Address | | +|multus.n2Interface.Netmask |Netmask | | +|multus.n2Interface.Gateway |Ip-Address | | +|multus.n2Interface.routes |Json |Routes you want to add in the pod | +|multus.n2Interface.hostInterface|host interface |Host machine interface name | +|multus.n3Interface.create |true/false | | +|multus.n3Interface.IPadd |Ip-Address | | +|multus.n3Interface.Netmask |Netmask | | +|multus.n3Interface.Gateway |Ip-Address | | +|multus.n3Interface.routes |Json |Routes you want to add in the pod | +|multus.n3Interface.hostInterface|host interface |Host machine interface name | +|multus.f1Interface.create |true/false | | +|multus.f1Interface.IPadd |Ip-Address | | +|multus.f1Interface.Netmask |Netmask | | +|multus.f1Interface.Gateway |Ip-Address | | +|multus.f1Interface.hostInterface|host interface |Host machine interface name | + + +The config parameters mentioned in `config` block of `values.yaml` are limited on purpose to maintain simplicity. They do not allow changing a lot of parameters of oai-gnb-cu. If you want to use your own configuration file for oai-gnb-cu. It is recommended to copy it in `templates/configmap.yaml` and set `config.mountConfig` as `true`. The command line for gnb is provided in `config.useAdditionalOptions`. + +The charts are configured to be used with primary CNI of Kubernetes. When you will mount the configuration file you have to define static ip-addresses for N2, N3 and F1. Most of the primary CNIs do not allow static ip-address allocation. To overcome this we are using multus-cni with static ip-address allocation. At minimum you have to create one multus interface which you can use for N2, N3 and F1. If you want you can create dedicated interfaces. + +You can find [here](https://gitlab.eurecom.fr/oai/openairinterface5g/-/tree/develop/targets/PROJECTS/GENERIC-NR-5GC/CONF) different sample configuration files for different bandwidths and frequencies. The binary of oai-gnb is called as `nr-softmodem`. To know more about its functioning and command line parameters you can visit this [page](https://gitlab.eurecom.fr/oai/openairinterface5g/-/blob/develop/doc/RUNMODEM.md) + +## Advanced Debugging Parameters + +Only needed if you are doing advanced debugging + +|Parameter |Allowed Values |Remark | +|---------------------------------|-------------------------------|----------------------------------------------| +|start.gnbcu |true/false |If true gnbcu container will go in sleep mode | +|start.tcpdump |true/false |If true tcpdump container will go in sleepmode| +|includeTcpDumpContainer |true/false |If false no tcpdump container will be there | +|tcpdumpimage.repository |Image Name | | +|tcpdumpimage.version |Image tag | | +|tcpdumpimage.pullPolicy |IfNotPresent or Never or Always| | +|persistent.sharedvolume |true/false |Save the pcaps in a shared volume with NRF | +|resources.define |true/false | | +|resources.limits.tcpdump.cpu |string |Unit m for milicpu or cpu | +|resources.limits.tcpdump.memory |string |Unit Mi/Gi/MB/GB | +|resources.limits.nf.cpu |string |Unit m for milicpu or cpu | +|resources.limits.nf.memory |string |Unit Mi/Gi/MB/GB | +|resources.requests.tcpdump.cpu |string |Unit m for milicpu or cpu | +|resources.requests.tcpdump.memory|string |Unit Mi/Gi/MB/GB | +|resources.requests.nf.cpu |string |Unit m for milicpu or cpu | +|resources.requests.nf.memory |string |Unit Mi/Gi/MB/GB | +|readinessProbe |true/false |default true | +|livenessProbe |true/false |default false | +|terminationGracePeriodSeconds |5 |In seconds (default 5) | +|nodeSelector |Node label | | +|nodeName |Node Name | | + +## How to use + +1. If you want to mount your configuration file then you set can `config.mountConfig`. The configuration file should be added in `templates/configmap.yaml`. Once the CU is configured. + +```bash +helm install oai-gnb-cu . +``` + +2. Configure and install the DU, in case you want to mount the configuration file you set can `config.mountConfig`. The configuration file should be added in `templates/configmap.yaml`. Once the DU is configured. + +```bash +helm install oai-gnb-du ../oai-gnb-du +``` + +3. Configure the `oai-nr-ue` charts for `oai-gnb-du`, change `config.rfSimulator` to `oai-gnb-du` and `useAdditionalOptions` to "--sa --rfsim -r 106 --numerology 1 -C 3619200000 --nokrnmod --log_config.global_log_options level,nocolor,time". As the configuration of cu/du is set at this frequency and resource block. If you mount your own configuration file then set the configuration of nr-ue accordingly. + +```bash +helm install oai-nr-ue ../oai-nr-ue +``` + +4. Once NR-UE is connected you can go inside the pod and ping via `oai` interface. If you do not see this interface then the UE is not connected to gNB or have some issues at core network. + +```bash +kubectl exec -it <oai-nr-ue-pod-name> -- bash +#ping towards spgwu/upf +ping -I oaitun_ue1 12.1.1.1 +#ping towards google dns +ping -I oaitun_ue1 8.8.8.8 +``` + +## Note + +1. If you are using multus then make sure it is properly configured and if you don't have a gateway for your multus interface then avoid using gateway and defaultGateway parameter. Either comment them or leave them empty. Wrong gateway configuration can create issues with pod networking and pod will not be able to resolve service names. \ No newline at end of file diff --git a/charts/oai-5g-ran/oai-gnb-cu/templates/NOTES.txt b/charts/oai-5g-ran/oai-gnb-cu/templates/NOTES.txt index 1a04b1df47acc06feb2635da8b408b030ce6dc02..753cde337f72ffcccd6e5fadacb45ff70f02dd7b 100644 --- a/charts/oai-5g-ran/oai-gnb-cu/templates/NOTES.txt +++ b/charts/oai-5g-ran/oai-gnb-cu/templates/NOTES.txt @@ -1,4 +1,5 @@ 1. Get the application name by running these commands: export GNB__CU_POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "oai-gnb-cu.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") export GNB_CU_eth0_IP=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "oai-gnb-cu.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[*].status.podIP}") -2. Note: This helm chart of OAI-gNB-CU is only tested in RF-simulator mode not tested with hardware on Openshift/Kubernetes Cluster \ No newline at end of file +2. Dockerhub images of OpenAirInterface requires avx2 capabilities in the cpu and they are built for x86 architecture, tested on UBUNTU OS only. +3. If you want to configure for a particular band then copy the configuration file in templates/configmap.yaml from here https://gitlab.eurecom.fr/oai/openairinterface5g/-/tree/develop/targets/PROJECTS/GENERIC-NR-5GC/CONF \ No newline at end of file diff --git a/charts/oai-5g-ran/oai-gnb-cu/templates/configmap.yaml b/charts/oai-5g-ran/oai-gnb-cu/templates/configmap.yaml index 034b4f55ba1a899b2676420470cf20d1a1af06fe..2889ec25188181a913d393a71142cf11b87858ec 100644 --- a/charts/oai-5g-ran/oai-gnb-cu/templates/configmap.yaml +++ b/charts/oai-5g-ran/oai-gnb-cu/templates/configmap.yaml @@ -1,3 +1,4 @@ +{{- if not .Values.config.mountConfig }} apiVersion: v1 kind: ConfigMap metadata: @@ -6,16 +7,16 @@ data: {{- range $key, $val := .Values.config }} {{ $key }}: {{ $val | quote }} {{- end }} - +{{- else }} --- -{{- if .Values.config.mountConfig }} apiVersion: v1 kind: ConfigMap metadata: name: {{ .Chart.Name }}-configmap data: + #Taken from --> https://gitlab.eurecom.fr/oai/openairinterface5g/-/blob/develop/ci-scripts/conf_files/gNB_SA_CU.conf mounted.conf: | - Active_gNBs = ( "oai-cu-rfsim"); + Active_gNBs = ( "oai-cu"); # Asn1_verbosity, choice in: none, info, annoying Asn1_verbosity = "none"; Num_Threads_PUSCH = 8; @@ -28,7 +29,7 @@ data: # cell_type = "CELL_MACRO_GNB"; - gNB_name = "oai-cu-rfsim"; + gNB_name = "oai-cu"; // Tracking area code, 0x0000 and 0xfffe are reserved values tracking_area_code = 1; @@ -40,22 +41,15 @@ data: tr_s_preference = "f1"; - local_s_if_name = "eth0"; - local_s_address = "10.244.0.83"; + local_s_if_name = "f1"; + local_s_address = "172.21.6.92"; remote_s_address = "127.0.0.1"; local_s_portc = 501; - local_s_portd = 2153; + local_s_portd = 2152; remote_s_portc = 500; - remote_s_portd = 2153; + remote_s_portd = 2152; min_rxtxtime = 6; - pdcch_ConfigSIB1 = ( - { - controlResourceSetZero = 12; - searchSpaceZero = 0; - } - ); - servingCellConfigCommon = ( { #spCellConfigCommon @@ -193,7 +187,7 @@ data: ////////// AMF parameters: - amf_ip_address = ( { ipv4 = "10.244.0.72"; + amf_ip_address = ( { ipv4 = "172.21.6.94"; ipv6 = "192:168:30::17"; active = "yes"; preference = "ipv4"; @@ -202,11 +196,10 @@ data: NETWORK_INTERFACES : { - - GNB_INTERFACE_NAME_FOR_NG_AMF = "eth0"; - GNB_IPV4_ADDRESS_FOR_NG_AMF = "10.244.0.83"; - GNB_INTERFACE_NAME_FOR_NGU = "eth0"; - GNB_IPV4_ADDRESS_FOR_NGU = "10.244.0.83"; + GNB_INTERFACE_NAME_FOR_NG_AMF = "n2"; + GNB_IPV4_ADDRESS_FOR_NG_AMF = "172.21.6.90"; + GNB_INTERFACE_NAME_FOR_NGU = "n3"; + GNB_IPV4_ADDRESS_FOR_NGU = "172.21.6.91"; GNB_PORT_FOR_S1U = 2152; # Spec 2152 }; } @@ -237,7 +230,7 @@ data: rlc_log_level ="debug"; pdcp_log_level ="info"; rrc_log_level ="info"; - f1ap_log_level ="debug"; + f1ap_log_level ="info"; ngap_log_level ="debug"; }; {{- end }} \ No newline at end of file diff --git a/charts/oai-5g-ran/oai-gnb-cu/templates/deployment.yaml b/charts/oai-5g-ran/oai-gnb-cu/templates/deployment.yaml index f74fb6e7d7dd2a71a674fe27f33760e943f7f979..2f0a86ed0924a9f7673ebc8ae83e7529b6e7a878 100644 --- a/charts/oai-5g-ran/oai-gnb-cu/templates/deployment.yaml +++ b/charts/oai-5g-ran/oai-gnb-cu/templates/deployment.yaml @@ -15,14 +15,30 @@ spec: metadata: labels: {{- include "oai-gnb-cu.selectorLabels" . | nindent 8 }} - app: 5grf-sim - {{- if .Values.multus.create }} + app: oai-gnb-cu + {{- if .Values.multus.n2Interface.create }} annotations: k8s.v1.cni.cncf.io/networks: >- [{ "name": "{{ .Chart.Name }}-net1", - "default-route": ["{{ .Values.multus.defaultGateway }}"] - }] + "interface": "n2" + {{- if .Values.multus.defaultGateway }} + ,"default-route": ["{{ .Values.multus.defaultGateway }}"] + {{- end }} + } + {{- if .Values.multus.n3Interface.create }} + ,{ + "name": "{{ .Chart.Name }}-net2", + "interface": "n3" + } + {{- end }} + {{- if .Values.multus.f1Interface.create }} + ,{ + "name": "{{ .Chart.Name }}-net3", + "interface": "f1" + } + {{- end }} + ] {{- end }} spec: securityContext: @@ -34,22 +50,21 @@ spec: containers: - name: gnbcu image: "{{ .Values.nfimage.repository }}:{{ .Values.nfimage.version }}" - {{- if .Values.config.mountConfig}} volumeMounts: - - mountPath: /opt/oai-gnb/etc + - mountPath: /opt/oai-gnb/etc/mounted.conf name: configuration - {{- end}} + subPath: mounted.conf {{- if .Values.resources.define}} resources: requests: - memory: {{ .Values.resources.requests.memory | quote }} - cpu: {{ .Values.resources.requests.cpu | quote }} + memory: {{ .Values.resources.requests.nf.memory | quote }} + cpu: {{ .Values.resources.requests.nf.cpu | quote }} limits: - memory: {{ .Values.resources.limits.memory | quote }} - cpu: {{ .Values.resources.limits.cpu | quote }} + memory: {{ .Values.resources.limits.nf.memory | quote }} + cpu: {{ .Values.resources.limits.nf.cpu | quote }} {{- end}} securityContext: - {{- toYaml .Values.securityContext | nindent 12 }} + privileged: true ports: - containerPort: 2152 name: n3 @@ -68,22 +83,14 @@ spec: {{- end}} env: - name: TZ - valueFrom: - configMapKeyRef: - name: {{ .Chart.Name }}-configmap - key: timeZone + value: {{ .Values.config.timeZone }} + - name: USE_ADDITIONAL_OPTIONS + value: {{ .Values.config.useAdditionalOptions }} {{- if .Values.config.mountConfig}} - name: USE_VOLUMED_CONF - valueFrom: - configMapKeyRef: - name: {{ .Chart.Name }}-configmap - key: mountConfig + value: "yes" {{- end}} - - name: RFSIMULATOR - valueFrom: - configMapKeyRef: - name: {{ .Chart.Name }}-configmap - key: rfSimulator + {{- if not .Values.config.mountConfig}} - name: USE_SA_CU valueFrom: configMapKeyRef: @@ -192,31 +199,42 @@ spec: configMapKeyRef: name: {{ .Chart.Name }}-configmap key: f1duPort - - name: USE_ADDITIONAL_OPTIONS - valueFrom: - configMapKeyRef: - name: {{ .Chart.Name }}-configmap - key: useAdditionalOptions + {{- end}} + {{- if .Values.includeTcpDumpContainer }} - name: tcpdump image: "{{ .Values.tcpdumpimage.repository }}:{{ .Values.tcpdumpimage.version }}" + imagePullPolicy: {{ .Values.tcpdumpimage.pullPolicy }} + {{- if .Values.resources.define}} + resources: + requests: + memory: {{ .Values.resources.requests.tcpdump.memory | quote }} + cpu: {{ .Values.resources.requests.tcpdump.cpu | quote }} + limits: + memory: {{ .Values.resources.limits.tcpdump.memory | quote }} + cpu: {{ .Values.resources.limits.tcpdump.cpu | quote }} + {{- end}} securityContext: - {{- toYaml .Values.securityContext | nindent 12 }} + privileged: true + capabilities: + add: + - NET_ADMIN + drop: + - ALL {{- if .Values.start.tcpdump}} command: - /bin/sh - -c - - /usr/sbin/tcpdump -i any -w /tmp/oai-gnb-cu_`date +%Y-%m-%d_%H_%M-%S-%Z`.pcap + - /usr/sbin/tcpdump -i any -w /tmp/pcap/{{ .Chart.Name }}_`date +%Y-%m-%d_%H_%M-%S-%Z`.pcap {{- else}} command: - /bin/sleep - infinity {{- end}} - {{- if .Values.config.mountConfig}} + {{- end }} volumes: - configMap: name: {{ .Chart.Name }}-configmap name: configuration - {{- end}} dnsPolicy: ClusterFirst restartPolicy: Always schedulerName: default-scheduler @@ -229,5 +247,3 @@ spec: {{- if .Values.nodeName}} nodeName: {{ .Values.nodeName }} {{- end }} - - diff --git a/charts/oai-5g-ran/oai-gnb-cu/templates/multus.yaml b/charts/oai-5g-ran/oai-gnb-cu/templates/multus.yaml index db2a304e45bd20922188506b2b6c55a3a50a8499..5a3e0ab9b35dc7df37c8e1a73976639cdd427704 100644 --- a/charts/oai-5g-ran/oai-gnb-cu/templates/multus.yaml +++ b/charts/oai-5g-ran/oai-gnb-cu/templates/multus.yaml @@ -1,22 +1,84 @@ --- -{{- if .Values.multus.create }} +{{- if .Values.multus.n2Interface.create }} apiVersion: "k8s.cni.cncf.io/v1" kind: NetworkAttachmentDefinition metadata: name: {{ .Chart.Name }}-net1 spec: config: '{ - "cniVersion": "0.3.0", + "cniVersion": "0.3.1", "type": "macvlan", - "master": {{- cat .Values.multus.hostInterface | nospace | quote }}, + "master": {{- cat .Values.multus.n2Interface.hostInterface | nospace | quote }}, "mode": "bridge", "ipam": { "type": "static", "addresses": [ { - "address": {{- cat .Values.multus.IPadd "/" .Values.multus.Netmask | nospace | quote }} + "address": {{- cat .Values.multus.n2Interface.IPadd "/" .Values.multus.n2Interface.Netmask | nospace | quote }} + {{- if .Values.multus.n2Interface.Gateway }} + ,"gateway": {{- cat .Values.multus.n2Interface.Gateway | nospace | quote }} + {{- end }} } ] + {{- if .Values.multus.n2Interface.routes }} + ,"routes": {{- .Values.multus.n2Interface.routes | toJson }} + {{- end }} + } + }' +{{- end }} +{{- if .Values.multus.n3Interface.create }} +--- +apiVersion: "k8s.cni.cncf.io/v1" +kind: NetworkAttachmentDefinition +metadata: + name: {{ .Chart.Name }}-net2 +spec: + config: '{ + "cniVersion": "0.3.1", + "type": "macvlan", + "master": {{- cat .Values.multus.n3Interface.hostInterface | nospace | quote }}, + "mode": "bridge", + "ipam": { + "type": "static", + "addresses": [ + { + "address": {{- cat .Values.multus.n3Interface.IPadd "/" .Values.multus.n3Interface.Netmask | nospace | quote }} + {{- if .Values.multus.n3Interface.Gateway }} + ,"gateway": {{- cat .Values.multus.n3Interface.Gateway | nospace | quote }} + {{- end }} + } + ] + {{- if .Values.multus.n3Interface.routes }} + ,"routes": {{- .Values.multus.n3Interface.routes | toJson }} + {{- end }} + } + }' +{{- end }} +{{- if .Values.multus.f1Interface.create }} +--- +apiVersion: "k8s.cni.cncf.io/v1" +kind: NetworkAttachmentDefinition +metadata: + name: {{ .Chart.Name }}-net3 +spec: + config: '{ + "cniVersion": "0.3.1", + "type": "macvlan", + "master": {{- cat .Values.multus.f1Interface.hostInterface | nospace | quote }}, + "mode": "bridge", + "ipam": { + "type": "static", + "addresses": [ + { + "address": {{- cat .Values.multus.f1Interface.IPadd "/" .Values.multus.f1Interface.Netmask | nospace | quote }} + {{- if .Values.multus.f1Interface.Gateway }} + ,"gateway": {{- cat .Values.multus.f1Interface.Gateway | nospace | quote }} + {{- end }} + } + ] + {{- if .Values.multus.f1Interface.routes }} + ,"routes": {{- .Values.multus.f1Interface.routes | toJson }} + {{- end }} } }' {{- end }} \ No newline at end of file diff --git a/charts/oai-5g-ran/oai-gnb-cu/values.yaml b/charts/oai-5g-ran/oai-gnb-cu/values.yaml index 6fa0154d3b91eafb981fbc853f7a71619df7f0b1..d70ae8de3945fb33eccf29fed9f3edb8a1e8d18a 100644 --- a/charts/oai-5g-ran/oai-gnb-cu/values.yaml +++ b/charts/oai-5g-ran/oai-gnb-cu/values.yaml @@ -1,19 +1,15 @@ -kubernetesType: Vanilla #Vanilla for community kubernetes distribution +kubernetesType: Vanilla #Vanilla for community kubernetes distribution else Openshift for Openshift +## In case of using these charts on Openshift then please use UBI images +## To know more about them follow this tutorial https://gitlab.eurecom.fr/oai/cn5g/oai-cn5g-fed/-/tree/master/openshift nfimage: # image name either locally present or in a public/private repository repository: docker.io/oaisoftwarealliance/oai-gnb ## dockerhub oaisoftwarealliance/oai-gnb - version: develop # image tag + version: 2023.w19 # image tag or develop # pullPolicy: IfNotPresent or Never or Always pullPolicy: IfNotPresent -tcpdumpimage: - repository: docker.io/corfr/tcpdump - version: latest - #pullPolicy: IfNotPresent or Never or Always - pullPolicy: IfNotPresent - ## good to use when pulling images from docker-hub mention -imagePullSecrets: +imagePullSecrets: - name: "regcred" serviceAccount: @@ -25,43 +21,54 @@ serviceAccount: # If not set and create is true, a name is generated using the fullname template name: "oai-gnb-cu-sa" -podSecurityContext: - runAsUser: 0 - runAsGroup: 0 - -securityContext: - privileged: true - # capabilities: - # drop: - # - ALL - # readOnlyRootFilesystem: true - # runAsNonRoot: true - # runAsUser: 1000 - - -start: - gnbcu: true - tcpdump: false - -# gNB needs two seperate interface one for ngap (N2) and other one for gtpu (N3) -# But for experimentation only one interface can be used. -# When you need multus: -# 1. you want seperate interface for N2 and N3 -# 2. You want static ip-address for N2 and N3 interface -# 3. Different interfaces for different packets - -multus: # needed when gnB service will run on another interface rather than traditional eth0 - create: false - IPadd: "172.21.10.16" - Netmask: "22" - defaultGateway: "172.21.11.254" - hostInterface: "ens2f0np0" # Interface of the host machine on which this pod will be scheduled - +# oai-cu can be configured with multiple interface which may correspond to 3GPP logical interfaces. There can be one to one or one to many. +# In case of one to one mapping f1, n2, n3 all can have seperate virtual interfaces. +# In one to many mapping f1,n2 and n3 all can be mapped to one virtual interface. +# Interface mapping is strictly based on your networking environment +## Change these ip-addresses according to your environment +multus: + # if default gatway is empty then it will be removed + defaultGateway: 172.21.7.254 + n2Interface: + create: false + IPadd: "172.21.6.90" + # #name inside the pod is hardcoded right now + # name: "n2" + Netmask: "22" + # if gatway is empty then it will be removed + #Gateway: "172.21.7.254" + #routes: [{'dst': '10.8.0.0/24','gw': '172.21.7.254'}, {'dst': '10.9.0.0/24','gw': '172.21.7.254'}] + hostInterface: "bond0" # Interface of the host machine on which this pod will be scheduled + n3Interface: + create: false + IPadd: "172.21.6.91" + Netmask: "22" + # #name inside the pod is hardcoded right now + # name: "n3" + # if gatway is commented then it will be removed + #Gateway: "172.21.7.254" + #routes: + hostInterface: "bond0" # Interface of the host machine on which this pod will be scheduled + f1Interface: + create: false + IPadd: "172.21.6.92" + Netmask: "22" + # #name inside the pod is hardcoded right now + # name: "f1" + # if gatway is commented then it will be removed + #Gateway: "172.21.7.254" + #routes: + hostInterface: "bond0" # Interface of the host machine on which this pod will be scheduled + +## If you want to change more configuration parameters then you should mount the config file +# in templates/configmap.yaml +# Example config files --> https://gitlab.eurecom.fr/oai/openairinterface5g/-/tree/develop/targets/PROJECTS/GENERIC-NR-5GC/CONF config: mountConfig: false #If config file is mounted then please edit mount.conf in configmap.yaml properly timeZone: "Europe/Paris" - rfSimulator: "server" - gnbcuName: "oai-cu-rfsim" + useAdditionalOptions: "--sa --log_config.global_log_options level,nocolor,time" + # If mounting the configuration file then below parameters are not used + gnbcuName: "oai-cu" useSAcu: "yes" mcc: "001" # check the information with AMF, SMF, UPF/SPGWU mnc: "01" # check the information with AMF, SMF, UPF/SPGWU @@ -69,27 +76,59 @@ config: tac: "1" # check the information with AMF nssaiSst: "1" #currently only 4 standard values are allowed 1,2,3,4 nssaiSd0: "ffffff" #values in hexa-decimal format - amfIpAddress: "oai-amf-svc" # amf ip-address - gnbNgaIfName: "eth0" # net1 in case multus create is true that means another interface is created for ngap interface, n2 to communicate with amf - gnbNgaIpAddress: "status.podIP" # n2IPadd in case multus create is true - gnbNguIfName: "eth0" #net2 in case multus create is true gtu interface for upf/spgwu - gnbNguIpAddress: "status.podIP" # n3IPadd in case multus create is true - f1IfName: "eth0" # net3 incase multus create is true - f1cuIpAddress: "status.podIP" + #entrypoint.sh tries to resolve the amfHost name if the resolution did not work gNB will not start + amfIpAddress: "oai-amf-svc" # amf ip-address or service-name oai-amf-svc or 172.21.6.94 + gnbNgaIfName: "eth0" # if multus.n2Interface.create is true then use n2 + gnbNgaIpAddress: "status.podIP" # if multus.n2Interface.create is true then use multus.n2Interface.Ipadd + gnbNguIfName: "eth0" #if multus.n3Interface.create is true then use n3 or you can only use 1 interface n2 or eth0 + gnbNguIpAddress: "status.podIP" # if multus.n3Interface.create is true then use multus.n3Interface.Ipadd or multus.n2Interface.Ipadd if you are using only 1 extra interface + f1IfName: "eth0" # if multus.n2Interface.create is true then use multus.n2Interface.Ipadd + f1cuIpAddress: "status.podIP" # if multus.f1Interface.create is true then use multus.f1Interface.Ipadd or multus.n2Interface.Ipadd if you are using only 1 extra interface + ## Its the DU which communicates with the CU so no need for DU ip-address f1duIpAddress: "127.0.0.1" - f1cuPort: "2153" - f1duPort: "2153" - useAdditionalOptions: "--sa --rfsim --log_config.global_log_options level,nocolor,time" + f1cuPort: "2152" + f1duPort: "2152" + +## Debugging section +podSecurityContext: + runAsUser: 0 + runAsGroup: 0 +start: + gnbcu: true #If false the network function container will run in sleep mode for manually testing + tcpdump: false +includeTcpDumpContainer: false #If true it will add a tcpdump container inside network function pod for debugging + +## For openshift you can use rhel8/support-tools:8.7-13 +tcpdumpimage: + repository: docker.io/corfr/tcpdump + version: latest + #pullPolicy: IfNotPresent or Never or Always + pullPolicy: IfNotPresent + +## NF is the network function and tcpdump is the tcpdump container. +## To know more about request and limit it is better to understand that how Kubernetes QoS works. +## https://kubernetes.io/docs/concepts/configuration/manage-resources-containers +## https://kubernetes.io/docs/concepts/workloads/pods/pod-qos resources: define: false limits: - cpu: 100m - memory: 128Mi + nf: + cpu: 100m + memory: 128Mi + #If tcpdump container is disabled this value will not be used + tcpdump: + cpu: 100m + memory: 128Mi requests: - cpu: 100m - memory: 256Mi + nf: + cpu: 100m + memory: 128Mi + #If tcpdump container is disabled this value will not be used + tcpdump: + cpu: 100m + memory: 128Mi tolerations: [] @@ -100,4 +139,4 @@ terminationGracePeriodSeconds: 5 nodeSelector: {} -nodeName: \ No newline at end of file +nodeName: diff --git a/charts/oai-5g-ran/oai-gnb-du/Chart.yaml b/charts/oai-5g-ran/oai-gnb-du/Chart.yaml index 36cf967a7e6401acc268eb12f09f1dda75232bc3..53dad756d1de52b37f3919166983f7dde8637837 100644 --- a/charts/oai-5g-ran/oai-gnb-du/Chart.yaml +++ b/charts/oai-5g-ran/oai-gnb-du/Chart.yaml @@ -37,7 +37,7 @@ icon: http://www.openairinterface.org/wp-content/uploads/2015/06/cropped-oai_fin # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. -version: 0.1.1 +version: 1.0.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. diff --git a/charts/oai-5g-ran/oai-gnb-du/README.md b/charts/oai-5g-ran/oai-gnb-du/README.md new file mode 100644 index 0000000000000000000000000000000000000000..ec9b589a2cf750a2fd78fca31a327fe6e3872eaf --- /dev/null +++ b/charts/oai-5g-ran/oai-gnb-du/README.md @@ -0,0 +1,155 @@ +# Helm Chart for OAI Distributed Unit (OAI-DU) + +This helm-chart is only tested for [RF Simulated oai-du](https://gitlab.eurecom.fr/oai/openairinterface5g/-/blob/develop/radio/rfsimulator/README.md). Though it is designed to work with split 8 radio units or USRPs. In `template/deployment.yaml` there is a section to use it with USB based USRPs. The option to use RFSIM, USRPs or Radio Units is decided via configuration file. The container image always remains the same. + +We are in the process of testing the helm-chart with different USRPs, Radio Units and extend it for O-RAN 7.2 interface. We have already implemented 7.2 interface in OAI codebase. + +Before using this helm-chart we recommend you read about OAI codebase and its working from the documents listed on [OAI gitlab](https://gitlab.eurecom.fr/oai/openairinterface5g/-/tree/develop/doc) + +**Note**: This chart is tested on [Minikube](https://minikube.sigs.k8s.io/docs/) and [Red Hat Openshift](https://www.redhat.com/fr/technologies/cloud-computing/openshift) 4.10 and 4.12. RFSIM requires minimum 2CPU and 2Gi RAM. + +## Introduction + +To know more about the feature set of OpenAirInterface you can check it [here](https://gitlab.eurecom.fr/oai/openairinterface5g/-/blob/develop/doc/FEATURE_SET.md#openairinterface-5g-nr-feature-set). + +The [codebase](https://gitlab.eurecom.fr/oai/openairinterface5g/-/tree/develop) for gNB, CU, DU, CU-CP/CU-UP, NR-UE is the same. Everyweek on [docker-hub](https://hub.docker.com/r/oaisoftwarealliance/oai-gnb) our [Jenkins Platform](https://jenkins-oai.eurecom.fr/view/RAN/) publishes two docker-images + +1. `oaisoftwarealliance/oai-gnb` for monolithic gNB, DU, CU, CU-CP +2. `oaisoftwarealliance/oai-nr-cuup` for CU-UP. + +Each image has develop tag and a dedicated week tag for example `2023.w18`. We only publish Ubuntu 18.04/20.04 images. We do not publish RedHat/UBI images. These images you have to build from the source code on your RedHat systems or Openshift Platform. You can follow this [tutorial](../../../openshift/README.md) for that. + +The helm chart of OAI-DU creates multiples Kubernetes resources, + +1. Service +2. Role Base Access Control (RBAC) (role and role bindings) +3. Deployment +4. Configmap +5. Service account +6. Network-attachment-defination (Optional only when multus is used) + +The directory structure + +``` +. +├── Chart.yaml +├── templates +│  ├── configmap.yaml +│  ├── deployment.yaml +│  ├── _helpers.tpl +│  ├── multus.yaml +│  ├── NOTES.txt +│  ├── rbac.yaml +│  ├── serviceaccount.yaml +│  └── service.yaml +└── values.yaml +``` + +## Parameters + +[Values.yaml](./values.yaml) contains all the configurable parameters. Below table defines the configurable parameters. You need a dedicated interface for Fronthaul. + + + +|Parameter |Allowed Values |Remark | +|--------------------------------|-------------------------------|---------------------------------| +|kubernetesType |Vanilla/Openshift |Vanilla Kubernetes or Openshift | +|nfimage.repository |Image Name | | +|nfimage.version |Image tag | | +|nfimage.pullPolicy |IfNotPresent or Never or Always| | +|imagePullSecrets.name |String |Good to use for docker hub | +|serviceAccount.create |true/false | | +|serviceAccount.annotations |String | | +|serviceAccount.name |String | | +|podSecurityContext.runAsUser |Integer (0,65534) | | +|podSecurityContext.runAsGroup |Integer (0,65534) | | +|multus.defaultGateway |Ip-Address |default route in the pod | +|multus.f1Interface.create |true/false | | +|multus.f1Interface.IPadd |Ip-Address | | +|multus.f1Interface.Netmask |Netmask | | +|multus.f1Interface.Gateway |Ip-Address | | +|multus.f1Interface.routes |Json |Routes you want to add in the pod| +|multus.f1Interface.hostInterface|host interface |Host machine interface name | +|multus.ruInterface.create |true/false | | +|multus.ruInterface.IPadd |Ip-Address | | +|multus.ruInterface.Netmask |Netmask | | +|multus.ruInterface.Gateway |Ip-Address | | +|multus.ruInterface.hostInterface|host interface |Host machine interface name | +|multus.ruInterface.mtu |Integer ||Range [0, Parent interface MTU] | + + +The config parameters mentioned in `config` block of `values.yaml` are limited on purpose to maintain simplicity. They do not allow changing a lot of parameters of oai-gnb. If you want to use your own configuration file for oai-gnb-du. It is recommended to copy it in `templates/configmap.yaml` and set `config.mountConfig` as `true`. The command line for gnb is provided in `config.useAdditionalOptions`. + +The charts are configured to be used with primary CNI of Kubernetes. When you will mount the configuration file you have to define static ip-addresses for F1 and RU. Most of the primary CNIs do not allow static ip-address allocation. To overcome this we are using multus-cni with static ip-address allocation. At minimum you have to create one multus interface which you can use for F1 and RU. If you want you can create dedicated interfaces. + +You can find [here](https://gitlab.eurecom.fr/oai/openairinterface5g/-/tree/develop/targets/PROJECTS/GENERIC-NR-5GC/CONF) different sample configuration files for different bandwidths and frequencies. The binary of oai-gnb is called as `nr-softmodem`. To know more about its functioning and command line parameters you can visit this [page](https://gitlab.eurecom.fr/oai/openairinterface5g/-/blob/develop/doc/RUNMODEM.md) + +## Advanced Debugging Parameters + +Only needed if you are doing advanced debugging + +|Parameter |Allowed Values |Remark | +|---------------------------------|-------------------------------|----------------------------------------------| +|start.gnbdu |true/false |If true gnbdu container will go in sleep mode | +|start.tcpdump |true/false |If true tcpdump container will go in sleepmode| +|includeTcpDumpContainer |true/false |If false no tcpdump container will be there | +|tcpdumpimage.repository |Image Name | | +|tcpdumpimage.version |Image tag | | +|tcpdumpimage.pullPolicy |IfNotPresent or Never or Always| | +|persistent.sharedvolume |true/false |Save the pcaps in a shared volume with NRF | +|resources.define |true/false | | +|resources.limits.tcpdump.cpu |string |Unit m for milicpu or cpu | +|resources.limits.tcpdump.memory |string |Unit Mi/Gi/MB/GB | +|resources.limits.nf.cpu |string |Unit m for milicpu or cpu | +|resources.limits.nf.memory |string |Unit Mi/Gi/MB/GB | +|resources.requests.tcpdump.cpu |string |Unit m for milicpu or cpu | +|resources.requests.tcpdump.memory|string |Unit Mi/Gi/MB/GB | +|resources.requests.nf.cpu |string |Unit m for milicpu or cpu | +|resources.requests.nf.memory |string |Unit Mi/Gi/MB/GB | +|readinessProbe |true/false |default true | +|livenessProbe |true/false |default false | +|terminationGracePeriodSeconds |5 |In seconds (default 5) | +|nodeSelector |Node label | | +|nodeName |Node Name | | + +## How to use + +### F1 split only + +Make sure core network and `cu` is running before starting the `du` + +```bash +helm install oai-gnb-cu ../oai-gnb-cu +#wait for cu to start +helm install oai-gnb-du . +``` +### F1 and E1 split + +```bash +helm install oai-gnb-cu-cp ../oai-gnb-cu-cp +#wait for cu-cp to start +helm install oai-gnb-cu-up ../oai-gnb-cu-up +helm install oai-gnb-du . +``` + +### Connect the UE + +1. Configure the `oai-nr-ue` charts for `oai-gnb-du`, change `config.rfSimulator` to `oai-gnb-du` and `useAdditionalOptions` to "--sa --rfsim -r 106 --numerology 1 -C 3619200000 --nokrnmod --log_config.global_log_options level,nocolor,time". As the configuration of cu/du is set at this frequency and resource block. If you mount your own configuration file then set the configuration of nr-ue accordingly. + +```bash +helm install oai-nr-ue ../oai-nr-ue +``` + +2. Once NR-UE is connected you can go inside the pod and ping via `oai` interface. If you do not see this interface then the UE is not connected to gNB or have some issues at core network. + +```bash +kubectl exec -it <oai-nr-ue-pod-name> -- bash +#ping towards spgwu/upf +ping -I oaitun_ue1 12.1.1.1 +#ping towards google dns +ping -I oaitun_ue1 8.8.8.8 +``` + +## Note + +1. If you are using multus then make sure it is properly configured and if you don't have a gateway for your multus interface then avoid using gateway and defaultGateway parameter. Either comment them or leave them empty. Wrong gateway configuration can create issues with pod networking and pod will not be able to resolve service names. \ No newline at end of file diff --git a/charts/oai-5g-ran/oai-gnb-du/templates/NOTES.txt b/charts/oai-5g-ran/oai-gnb-du/templates/NOTES.txt index 82e91fb70251a27bd096eefc5244f4ba83a2594e..68b89edbd8c690391524b5e1195175749bad72b7 100644 --- a/charts/oai-5g-ran/oai-gnb-du/templates/NOTES.txt +++ b/charts/oai-5g-ran/oai-gnb-du/templates/NOTES.txt @@ -1,4 +1,8 @@ 1. Get the application name by running these commands: export GNB_DU_POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "oai-gnb-du.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") export GNB_DU_eth0_IP=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "oai-gnb-du.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[*].status.podIP}") -2. Note: This helm chart of OAI-gNB-DU is only tested in RF-simulator mode not tested with hardware on Openshift/Kubernetes Cluster \ No newline at end of file +2. Dockerhub images of OpenAirInterface requires avx2 capabilities in the cpu and they are built for x86 architecture, tested on UBUNTU OS only. +3. Note: This helm chart of OAI-gNB-DU is only tested in RF-simulator mode and is not tested with USRPs/RUs on Openshift/Kubernetes Cluster +4. In case you want to test these charts with USRP/RU then make sure your underlying kernel is realtime and CPU sleep states are off +5. If you want to configure for a particular band then copy the configuration file in templates/configmap.yaml from here https://gitlab.eurecom.fr/oai/openairinterface5g/-/tree/develop/targets/PROJECTS/GENERIC-NR-5GC/CONF + \ No newline at end of file diff --git a/charts/oai-5g-ran/oai-gnb-du/templates/configmap.yaml b/charts/oai-5g-ran/oai-gnb-du/templates/configmap.yaml index a8c350c89ab873494800e803c5181a938048551c..e7607490c643c1c04d044b46832d80ca0350bfec 100644 --- a/charts/oai-5g-ran/oai-gnb-du/templates/configmap.yaml +++ b/charts/oai-5g-ran/oai-gnb-du/templates/configmap.yaml @@ -1,3 +1,4 @@ +{{- if not .Values.config.mountConfig }} apiVersion: v1 kind: ConfigMap metadata: @@ -6,13 +7,13 @@ data: {{- range $key, $val := .Values.config }} {{ $key }}: {{ $val | quote }} {{- end }} - +{{- else }} --- -{{- if .Values.config.mountConfig }} apiVersion: v1 kind: ConfigMap metadata: name: {{ .Chart.Name }}-configmap +#https://gitlab.eurecom.fr/oai/openairinterface5g/-/blob/develop/ci-scripts/conf_files/gNB_SA_DU.conf data: mounted.conf: | Active_gNBs = ( "oai-du-rfsim"); @@ -41,13 +42,6 @@ data: min_rxtxtime = 6; force_256qam_off = 1; - pdcch_ConfigSIB1 = ( - { - controlResourceSetZero = 12; - searchSpaceZero = 0; - } - ); - servingCellConfigCommon = ( { #spCellConfigCommon @@ -192,15 +186,16 @@ data: num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "f1"; - local_n_if_name = "eth0"; - local_n_address = "10.244.0.84"; - remote_n_address = "10.244.0.1"; + local_n_if_name = "f1"; + local_n_address = "172.21.6.100"; + remote_n_address = "172.21.6.92"; local_n_portc = 500; - local_n_portd = 2153; + local_n_portd = 2152; remote_n_portc = 501; - remote_n_portd = 2153; + remote_n_portd = 2152; pusch_TargetSNRx10 = 200; pucch_TargetSNRx10 = 200; + ulsch_max_frame_inactivity = 1; } ); @@ -256,7 +251,7 @@ data: rlc_log_level ="info"; pdcp_log_level ="info"; rrc_log_level ="info"; - f1ap_log_level ="debug"; + f1ap_log_level ="info"; ngap_log_level ="debug"; }; {{- end }} \ No newline at end of file diff --git a/charts/oai-5g-ran/oai-gnb-du/templates/deployment.yaml b/charts/oai-5g-ran/oai-gnb-du/templates/deployment.yaml index 9f01097765ecadff4ea2fde1da228decff8f3057..bde73300ae3df1d8065ef2339689667a6f595899 100644 --- a/charts/oai-5g-ran/oai-gnb-du/templates/deployment.yaml +++ b/charts/oai-5g-ran/oai-gnb-du/templates/deployment.yaml @@ -15,17 +15,22 @@ spec: metadata: labels: {{- include "oai-gnb-du.selectorLabels" . | nindent 8 }} - app: 5grf-sim - {{- if .Values.multus.create }} + app: oai-gnb-du + {{- if .Values.multus.f1Interface.create }} annotations: k8s.v1.cni.cncf.io/networks: >- [{ - "name": "{{ .Chart.Name }}-net1", - "default-route": ["{{ .Values.multus.defaultGateway }}"] - }, - { + "name": "{{ .Chart.Name }}-net1" + {{- if .Values.multus.defaultGateway }} + ,"default-route": ["{{ .Values.multus.defaultGateway }}"] + {{- end }} + } + {{- if .Values.multus.ruInterface.create }} + ,{ "name": "{{ .Chart.Name }}-net2" - }] + } + {{- end }} + ] {{- end }} spec: securityContext: @@ -37,31 +42,27 @@ spec: containers: - name: gnbdu image: "{{ .Values.nfimage.repository }}:{{ .Values.nfimage.version }}" - {{- if .Values.config.mountConfig}} volumeMounts: - - mountPath: /opt/oai-gnb/etc + - mountPath: /opt/oai-gnb/etc/mounted.conf name: configuration - {{- end}} + subPath: mounted.conf {{- if .Values.resources.define}} resources: requests: - memory: {{ .Values.resources.requests.memory | quote }} - cpu: {{ .Values.resources.requests.cpu | quote }} + memory: {{ .Values.resources.requests.nf.memory | quote }} + cpu: {{ .Values.resources.requests.nf.cpu | quote }} limits: - memory: {{ .Values.resources.limits.memory | quote }} - cpu: {{ .Values.resources.limits.cpu | quote }} + memory: {{ .Values.resources.limits.nf.memory | quote }} + cpu: {{ .Values.resources.limits.nf.cpu | quote }} {{- end}} securityContext: - {{- toYaml .Values.securityContext | nindent 12 }} + privileged: true ports: - - containerPort: 2152 - name: n3 - protocol: UDP - - containerPort: 36412 - name: n2 + - containerPort: 38472 + name: f1c protocol: SCTP - - containerPort: 2153 - name: f1 + - containerPort: 2152 + name: f1u protocol: UDP {{- if .Values.start.gnbdu}} {{- else}} @@ -71,27 +72,21 @@ spec: {{- end}} env: - name: TZ - valueFrom: - configMapKeyRef: - name: {{ .Chart.Name }}-configmap - key: timeZone + value: {{ .Values.config.timeZone }} + - name: RFSIMULATOR + value: {{ .Values.config.rfSimulator }} + - name: USE_ADDITIONAL_OPTIONS + value: {{ .Values.config.useAdditionalOptions }} {{- if .Values.config.mountConfig}} - name: USE_VOLUMED_CONF - valueFrom: - configMapKeyRef: - name: {{ .Chart.Name }}-configmap - key: mountConfig + value: "yes" {{- end}} - - name: RFSIMULATOR - valueFrom: - configMapKeyRef: - name: {{ .Chart.Name }}-configmap - key: rfSimulator + {{- if not .Values.config.mountConfig}} - name: USE_SA_TDD_DU valueFrom: configMapKeyRef: name: {{ .Chart.Name }}-configmap - key: useSaTDDcu + key: useSaTDDdu - name: GNB_NAME valueFrom: configMapKeyRef: @@ -195,31 +190,42 @@ spec: configMapKeyRef: name: {{ .Chart.Name }}-configmap key: f1duPort - - name: USE_ADDITIONAL_OPTIONS - valueFrom: - configMapKeyRef: - name: {{ .Chart.Name }}-configmap - key: useAdditionalOptions + {{- end}} + {{- if .Values.includeTcpDumpContainer }} - name: tcpdump image: "{{ .Values.tcpdumpimage.repository }}:{{ .Values.tcpdumpimage.version }}" + imagePullPolicy: {{ .Values.tcpdumpimage.pullPolicy }} + {{- if .Values.resources.define}} + resources: + requests: + memory: {{ .Values.resources.requests.tcpdump.memory | quote }} + cpu: {{ .Values.resources.requests.tcpdump.cpu | quote }} + limits: + memory: {{ .Values.resources.limits.tcpdump.memory | quote }} + cpu: {{ .Values.resources.limits.tcpdump.cpu | quote }} + {{- end}} securityContext: - {{- toYaml .Values.securityContext | nindent 12 }} + privileged: true + capabilities: + add: + - NET_ADMIN + drop: + - ALL {{- if .Values.start.tcpdump}} command: - /bin/sh - -c - - /usr/sbin/tcpdump -i any -w /tmp/oai-gnb-du_`date +%Y-%m-%d_%H_%M-%S-%Z`.pcap + - /usr/sbin/tcpdump -i any -w /tmp/pcap/{{ .Chart.Name }}_`date +%Y-%m-%d_%H_%M-%S-%Z`.pcap {{- else}} command: - /bin/sleep - infinity {{- end}} - {{- if .Values.config.mountConfig}} + {{- end }} volumes: - configMap: name: {{ .Chart.Name }}-configmap name: configuration - {{- end}} dnsPolicy: ClusterFirst restartPolicy: Always schedulerName: default-scheduler @@ -231,4 +237,4 @@ spec: {{- end }} {{- if .Values.nodeName}} nodeName: {{ .Values.nodeName }} - {{- end }} \ No newline at end of file + {{- end }} diff --git a/charts/oai-5g-ran/oai-gnb-du/templates/multus.yaml b/charts/oai-5g-ran/oai-gnb-du/templates/multus.yaml index 1dcad83f4b213ccb28de66b54d9cf71f92fe3be1..f0c9df0f62b4c05fa769be62de987d40585a1290 100644 --- a/charts/oai-5g-ran/oai-gnb-du/templates/multus.yaml +++ b/charts/oai-5g-ran/oai-gnb-du/templates/multus.yaml @@ -1,24 +1,32 @@ --- -{{- if .Values.multus.create }} +{{- if .Values.multus.f1Interface.create }} apiVersion: "k8s.cni.cncf.io/v1" kind: NetworkAttachmentDefinition metadata: name: {{ .Chart.Name }}-net1 spec: config: '{ - "cniVersion": "0.3.0", + "cniVersion": "0.3.1", "type": "macvlan", - "master": {{- cat .Values.multus.f1HostInterface | nospace | quote }}, + "master": {{- cat .Values.multus.f1Interface.hostInterface | nospace | quote }}, "mode": "bridge", "ipam": { "type": "static", "addresses": [ { - "address": {{- cat .Values.multus.f1IPadd "/" .Values.multus.f1Netmask | nospace | quote }} + "address": {{- cat .Values.multus.f1Interface.IPadd "/" .Values.multus.f1Interface.Netmask | nospace | quote }} + {{- if .Values.multus.f1Interface.Gateway }} + ,"gateway": {{- cat .Values.multus.f1Interface.Gateway | nospace | quote }} + {{- end }} } ] + {{- if .Values.multus.f1Interface.routes }} + ,"routes": {{- .Values.multus.f1Interface.routes | toJson }} + {{- end }} } }' +{{- end }} +{{- if .Values.multus.ruInterface.create }} --- apiVersion: "k8s.cni.cncf.io/v1" kind: NetworkAttachmentDefinition @@ -26,17 +34,23 @@ metadata: name: {{ .Chart.Name }}-net2 spec: config: '{ - "cniVersion": "0.3.0", + "cniVersion": "0.3.1", "type": "macvlan", - "master": {{- cat .Values.multus.rruHostInterface | nospace | quote }}, + "master": {{- cat .Values.multus.ruInterface.hostInterface | nospace | quote }}, + {{- if .Values.multus.ruInterface.mtu }} + "mtu": {{ .Values.multus.ruInterface.mtu }}, + {{- end }} "mode": "bridge", "ipam": { "type": "static", "addresses": [ { - "address": {{- cat .Values.multus.rruInterfaceIpadd "/" .Values.multus.rruInterfaceNetmask | nospace | quote }} + "address": {{- cat .Values.multus.ruInterface.IPadd "/" .Values.multus.ruInterface.Netmask | nospace | quote }} + {{- if .Values.multus.ruInterface.Gateway }} + ,"gateway": {{- cat .Values.multus.ruInterface.Gateway | nospace | quote }} + {{- end }} } ] } }' -{{- end }} \ No newline at end of file +{{- end }} diff --git a/charts/oai-5g-ran/oai-gnb-du/templates/service.yaml b/charts/oai-5g-ran/oai-gnb-du/templates/service.yaml index 2ab828ba019195c6edd9733f9cc8d18ed052b939..12d00419386d65c8ca32791dc2640b119154e46f 100644 --- a/charts/oai-5g-ran/oai-gnb-du/templates/service.yaml +++ b/charts/oai-5g-ran/oai-gnb-du/templates/service.yaml @@ -8,17 +8,13 @@ spec: type: ClusterIP clusterIP: None ports: - - name: n2 - port: 36412 - targetPort: 36412 + - name: f1c + port: 38472 + targetPort: 38472 protocol: SCTP - - name: n3 + - name: f1u port: 2152 targetPort: 2152 protocol: UDP - - name: f1 - port: 2153 - targetPort: 2153 - protocol: UDP selector: {{- include "oai-gnb-du.selectorLabels" . | nindent 4 }} diff --git a/charts/oai-5g-ran/oai-gnb-du/values.yaml b/charts/oai-5g-ran/oai-gnb-du/values.yaml index 362baa95259ecaceff5502a5adea2f1152013b24..6916c21faabc981790d05fddec7d4371ea5ae112 100644 --- a/charts/oai-5g-ran/oai-gnb-du/values.yaml +++ b/charts/oai-5g-ran/oai-gnb-du/values.yaml @@ -1,17 +1,13 @@ -kubernetesType: Vanilla #Vanilla for community kubernetes distribution +kubernetesType: Vanilla #Vanilla for community kubernetes distribution else Openshift for Openshift +## In case of using these charts on Openshift then please use UBI images +## To know more about them follow this tutorial https://gitlab.eurecom.fr/oai/cn5g/oai-cn5g-fed/-/tree/master/openshift nfimage: # image name either locally present or in a public/private repository repository: docker.io/oaisoftwarealliance/oai-gnb ## dockerhub oaisoftwarealliance/oai-gnb - version: develop # image tag + version: 2023.w19 # image tag or develop # pullPolicy: IfNotPresent or Never or Always pullPolicy: IfNotPresent -tcpdumpimage: - repository: docker.io/corfr/tcpdump - version: latest - #pullPolicy: IfNotPresent or Never or Always - pullPolicy: IfNotPresent - ## good to use when pulling images from docker-hub mention imagePullSecrets: - name: "regcred" @@ -25,73 +21,102 @@ serviceAccount: # If not set and create is true, a name is generated using the fullname template name: "oai-gnb-du-sa" -podSecurityContext: - runAsUser: 0 - runAsGroup: 0 - -securityContext: - privileged: true - # capabilities: - # drop: - # - ALL - # readOnlyRootFilesystem: true - # runAsNonRoot: true - # runAsUser: 1000 -start: - gnbdu: true - tcpdump: false +# oai-gnb-du helm-charts can be used in RFSimulated mode which does not require multiple interaces. +# In case you use the charts with a RU/USRP you need a dedicated interface with the RU. +## Change these ip-addresses according to your environment -# gNB needs two seperate interface one for ngap (N2) and other one for gtpu (N3) -# But for experimentation only one interface can be used. -# When you need multus: -# 1. you want seperate interface for N2 and N3 -# 2. You want static ip-address for N2 and N3 interface -# 3. Different interfaces for different packets - -multus: # needed when gnB service will run on another interface rather than traditional eth0 - create: false - f1IPadd: "172.21.6.17" - f1Netmask: "22" +multus: + # if default gatway is commented or left blank then it will be removed defaultGateway: "172.21.7.254" - f1HostInterface: "bond0" # Interface of the host machine on which this pod will be scheduled - rruInterfaceIpadd: "192.168.80.95" - rruInterfaceNetmask: "24" - rruHostInterface: "bond1" - + f1Interface: + create: false + IPadd: "172.21.6.100" + Netmask: "22" + # if gatway is empty then it will be removed + #Gateway: "172.21.7.254" + #routes: [{'dst': '10.8.0.0/24','gw': '172.21.7.254'}, {'dst': '10.9.0.0/24','gw': '172.21.7.254'}] + hostInterface: "bond0" # Interface of the host machine on which this pod will be scheduled + ruInterface: #Only needed if using a ethernet based RU/USRP + create: false + IPadd: "192.168.80.90" + Netmask: "24" + # if gatway is commented then it will be remove + #Gateway: "192.168.80.1" #In case you don't have a gateway remove it from here + ## The value must be [0, master's MTU]. If commented it will masters MTU + #mtu: 9000 + hostInterface: "bond0" # Interface of the host machine on which this pod will be scheduled + +## If you want to change more configuration parameters then you should mount the config file +# in templates/configmap.yaml +# Example config files --> https://gitlab.eurecom.fr/oai/openairinterface5g/-/tree/develop/targets/PROJECTS/GENERIC-NR-5GC/CONF config: - mountConfig: false #If config file is mounted then please edit mount.conf in configmap.yaml properly + mountConfig: false #If config file is mounted then please edit mount.conf in templates/configmap.yaml properly timeZone: "Europe/Paris" - rfSimulator: "server" + useAdditionalOptions: "--sa --rfsim --log_config.global_log_options level,nocolor,time" + rfSimulator: "server" #If you are not using in RFsimulator mode then you can leave this empty + # If mounting the configuration file then below parameters are not used gnbduName: "oai-du-rfsim" - useSaTDDcu: "yes" + useSaTDDdu: "yes" mcc: "001" # check the information with AMF, SMF, UPF/SPGWU mnc: "01" # check the information with AMF, SMF, UPF/SPGWU mncLength: "2" # check the information with AMF, SMF, UPF/SPGWU tac: "1" # check the information with AMF nssaiSst: "1" #currently only 4 standard values are allowed 1,2,3,4 nssaiSd0: "ffffff" #values in hexa-decimal format - amfIpAddress: "oai-amf-svc" # Not mandatory, you can leave it like this in coming release it will be removed + f1IfName: "eth0" # net1 incase multus create is true + f1cuIpAddress: "172.21.6.92" # replace this value with CU f1 ip-address or CU-CP F1C ip-address if not using multus + f1duIpAddress: "status.podIP" # 172.21.6.100 if using multus + f1cuPort: "2152" + f1duPort: "2152" + #Not mandatory + amfIpAddress: "127.0.0.1" # Not mandatory, you can leave it like this in coming release it will be removed gnbNgaIfName: "eth0" # net1 in case multus create is true that means another interface is created for ngap interface, n2 to communicate with amf - gnbNgaIpAddress: "status.podIP" # n2IPadd in case multus create is true - gnbNguIfName: "eth0" #net2 in case multus create is true gtu interface for upf/spgwu - gnbNguIpAddress: "status.podIP" # n3IPadd in case multus create is true - f1IfName: "eth0" # net3 incase multus create is true - f1cuIpAddress: "10.244.0.92" # replace this value with GNB_CU_eth0_IP if not using multus - f1duIpAddress: "status.podIP" - f1cuPort: "2153" - f1duPort: "2153" - useAdditionalOptions: "--sa --rfsim --log_config.global_log_options level,nocolor,time" + gnbNgaIpAddress: "status.podIP" # f1Interface.Ipadd in case multus create is true + gnbNguIfName: "eth0" #net1 in case multus create is true gtu interface for upf/spgwu + gnbNguIpAddress: "status.podIP" # f1Interface.Ipadd in case multus create is true + +## Debugging section +podSecurityContext: + runAsUser: 0 + runAsGroup: 0 + +start: + gnbdu: true #If false the network function container will run in sleep mode for manually testing + tcpdump: false + +includeTcpDumpContainer: false #If true it will add a tcpdump container inside network function pod for debugging + +## For openshift you can use rhel8/support-tools:8.7-13 +tcpdumpimage: + repository: docker.io/corfr/tcpdump + version: latest + #pullPolicy: IfNotPresent or Never or Always + pullPolicy: IfNotPresent + +## NF is the network function and tcpdump is the tcpdump container. +## To know more about request and limit it is better to understand that how Kubernetes QoS works. +## https://kubernetes.io/docs/concepts/configuration/manage-resources-containers +## https://kubernetes.io/docs/concepts/workloads/pods/pod-qos resources: define: false limits: - cpu: 100m - memory: 128Mi + nf: + cpu: 2000m + memory: 2Gi + #If tcpdump container is disabled this value will not be used + tcpdump: + cpu: 200m + memory: 128Mi requests: - cpu: 100m - memory: 256Mi - + nf: + cpu: 2000m + memory: 2Gi + #If tcpdump container is disabled this value will not be used + tcpdump: + cpu: 100m + memory: 128Mi tolerations: [] @@ -101,4 +126,4 @@ terminationGracePeriodSeconds: 5 nodeSelector: {} -nodeName: \ No newline at end of file +nodeName: \ No newline at end of file diff --git a/charts/oai-5g-ran/oai-gnb/Chart.yaml b/charts/oai-5g-ran/oai-gnb/Chart.yaml index 6c91e664685b38d5777f932717d1fd2d867c3b3c..98bb0426a3063e1fe78d32d9c3c5384bf10c029b 100644 --- a/charts/oai-5g-ran/oai-gnb/Chart.yaml +++ b/charts/oai-5g-ran/oai-gnb/Chart.yaml @@ -37,7 +37,7 @@ icon: http://www.openairinterface.org/wp-content/uploads/2015/06/cropped-oai_fin # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. -version: 0.1.1 +version: 1.0.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. diff --git a/charts/oai-5g-ran/oai-gnb/README.md b/charts/oai-5g-ran/oai-gnb/README.md new file mode 100644 index 0000000000000000000000000000000000000000..8f3e581c029f520e6392f52eb3ffedda3c6d3501 --- /dev/null +++ b/charts/oai-5g-ran/oai-gnb/README.md @@ -0,0 +1,149 @@ +# Helm Chart for OAI Next Generation Node B (OAI-gNB) + +This helm-chart is only tested for [RF Simulated oai-gnb](https://gitlab.eurecom.fr/oai/openairinterface5g/-/blob/develop/radio/rfsimulator/README.md). Though it is designed to work with split 8 radio units or USRPs. You can define dedicated interfaces for fronthaul, N2 and N3. In `template/deployment.yaml` there is a section to use it with USB based USRPs. The option to use RFSIM, USRPs or Radio Units is decided via configuration file. The container image always remains the same. + +We are in the process of testing the helm-chart with different USRPs, Radio Units and extend it for O-RAN 7.2 interface. We have already implemented 7.2 interface in OAI codebase. + +Before using this helm-chart we recommend you read about OAI codebase and its working from the documents listed on [OAI gitlab](https://gitlab.eurecom.fr/oai/openairinterface5g/-/tree/develop/doc) + +**Note**: This chart is tested on [Minikube](https://minikube.sigs.k8s.io/docs/) and [Red Hat Openshift](https://www.redhat.com/fr/technologies/cloud-computing/openshift) 4.10 and 4.12. RFSIM-GNB requires minimum 2CPU and 2Gi RAM and [multus-cni](https://github.com/k8snetworkplumbingwg/multus-cni) plugin for multiple interfaces. + +All the extra interfaces/multus interfaces created inside the pod are using `macvlan` mode. If your environment does not allow using `macvlan` then you need to change the multus definations. + +## Introduction + +To know more about the feature set of OpenAirInterface you can check it [here](https://gitlab.eurecom.fr/oai/openairinterface5g/-/blob/develop/doc/FEATURE_SET.md#openairinterface-5g-nr-feature-set). + +The [codebase](https://gitlab.eurecom.fr/oai/openairinterface5g/-/tree/develop) for gNB, CU, DU, CU-CP/CU-UP, NR-UE is the same. Everyweek on [docker-hub](https://hub.docker.com/r/oaisoftwarealliance/oai-gnb) our [Jenkins Platform](https://jenkins-oai.eurecom.fr/view/RAN/) publishes two docker-images + +1. `oaisoftwarealliance/oai-gnb` for monolithic gNB, DU, CU, CU-CP +2. `oaisoftwarealliance/oai-nr-cuup` for CU-UP. + +Each image has develop tag and a dedicated week tag for example `2023.w18`. We only publish Ubuntu 18.04/20.04 images. We do not publish RedHat/UBI images. These images you have to build from the source code on your RedHat systems or Openshift Platform. You can follow this [tutorial](../../../openshift/README.md) for that. + +The helm chart of OAI-GNB creates multiples Kubernetes resources, + +1. Service +2. Role Base Access Control (RBAC) (role and role bindings) +3. Deployment +4. Configmap +5. Service account +6. Network-attachment-defination (Optional only when multus is used) + +The directory structure + +``` +. +├── Chart.yaml +├── templates +│  ├── configmap.yaml +│  ├── deployment.yaml +│  ├── _helpers.tpl +│  ├── multus.yaml +│  ├── NOTES.txt +│  ├── rbac.yaml +│  ├── serviceaccount.yaml +│  └── service.yaml +└── values.yaml +``` + +## Parameters + +[Values.yaml](./values.yaml) contains all the configurable parameters. Below table defines the configurable parameters. You need a dedicated interface for Fronthaul. Creating deadicated interfaces for N2 and N3 is optional. You can use a single interface for N2 and N3. + + + +|Parameter |Allowed Values |Remark | +|--------------------------------|-------------------------------|------------------------------------------------| +|kubernetesType |Vanilla/Openshift |Vanilla Kubernetes or Openshift | +|nfimage.repository |Image Name | | +|nfimage.version |Image tag | | +|nfimage.pullPolicy |IfNotPresent or Never or Always| | +|imagePullSecrets.name |String |Good to use for docker hub | +|serviceAccount.create |true/false | | +|serviceAccount.annotations |String | | +|serviceAccount.name |String | | +|podSecurityContext.runAsUser |Integer (0,65534) | | +|podSecurityContext.runAsGroup |Integer (0,65534) | | +|multus.defaultGateway |Ip-Address |default route in the pod | +|multus.n2Interface.create |true/false | | +|multus.n2Interface.IPadd |Ip-Address | | +|multus.n2Interface.Netmask |Netmask | | +|multus.n2Interface.Gateway |Ip-Address | | +|multus.n2Interface.hostInterface|host interface |Host interface of the machine where pod will run| +|multus.n2Interface.routes |Json |Routes you want to add in the pod | +|multus.n3Interface.create |true/false | | +|multus.n3Interface.IPadd |Ip-Address) | | +|multus.n3Interface.Netmask |Netmask | | +|multus.n3Interface.Gateway |Ip-Address | | +|multus.n3Interface.hostInterface|host interface |Host interface of the machine where pod will run| +|multus.n3Interface.routes |Json |Routes you want to add in the pod | +|multus.ruInterface.create |true/false | | +|multus.ruInterface.IPadd |Ip-Address | | +|multus.ruInterface.Netmask |Netmask | | +|multus.ruInterface.Gateway |Ip-Address | | +|multus.ruInterface.hostInterface|host interface |Host interface of the machine where pod will run| +|multus.ruInterface.mtu |Integer |Range [0, Parent interface MTU] | + +The config parameters mentioned in `config` block of `values.yaml` are limited on purpose to maintain simplicity. They do not allow changing a lot of parameters of oai-gnb. If you want to use your own configuration file for oai-gnb. It is recommended to copy it in `templates/configmap.yaml` and set `config.mountConfig` as `true`. The command line for gnb is provided in `config.useAdditionalOptions`. + +The charts are configured to be used with primary CNI of Kubernetes. When you will mount the configuration file you have to define static ip-addresses for N2, N3 and RU. Most of the primary CNIs do not allow static ip-address allocation. To overcome this we are using multus-cni with static ip-address allocation. At minimum you have to create one multus interface which you can use for N2, N3 and RU. If you want you can create dedicated interfaces. + +You can find [here](https://gitlab.eurecom.fr/oai/openairinterface5g/-/tree/develop/targets/PROJECTS/GENERIC-NR-5GC/CONF) different sample configuration files for different bandwidths and frequencies. The binary of oai-gnb is called as `nr-softmodem`. To know more about its functioning and command line parameters you can visit this [page](https://gitlab.eurecom.fr/oai/openairinterface5g/-/blob/develop/doc/RUNMODEM.md) + +## Advanced Debugging Parameters + +Only needed if you are doing advanced debugging + +|Parameter |Allowed Values |Remark | +|---------------------------------|-------------------------------|----------------------------------------------| +|start.gnb |true/false |If true gnb container will go in sleep mode | +|start.tcpdump |true/false |If true tcpdump container will go in sleepmode| +|includeTcpDumpContainer |true/false |If false no tcpdump container will be there | +|tcpdumpimage.repository |Image Name | | +|tcpdumpimage.version |Image tag | | +|tcpdumpimage.pullPolicy |IfNotPresent or Never or Always| | +|persistent.sharedvolume |true/false |Save the pcaps in a shared volume with NRF | +|resources.define |true/false | | +|resources.limits.tcpdump.cpu |string |Unit m for milicpu or cpu | +|resources.limits.tcpdump.memory |string |Unit Mi/Gi/MB/GB | +|resources.limits.nf.cpu |string |Unit m for milicpu or cpu | +|resources.limits.nf.memory |string |Unit Mi/Gi/MB/GB | +|resources.requests.tcpdump.cpu |string |Unit m for milicpu or cpu | +|resources.requests.tcpdump.memory|string |Unit Mi/Gi/MB/GB | +|resources.requests.nf.cpu |string |Unit m for milicpu or cpu | +|resources.requests.nf.memory |string |Unit Mi/Gi/MB/GB | +|readinessProbe |true/false |default true | +|livenessProbe |true/false |default false | +|terminationGracePeriodSeconds |5 |In seconds (default 5) | +|nodeSelector |Node label | | +|nodeName |Node Name | | + +## How to use + + +1. If you want to mount your configuration file then you set can `config.mountConfig`. The configuration file should be added in `templates/configmap.yaml`. Once the GNB is configured. + +```bash +helm install oai-gnb . +``` + +2. Configure the `oai-nr-ue` charts for `oai-gnb`, change `config.rfSimulator` to `oai-gnb` and `useAdditionalOptions` to "--sa -E --rfsim -r 106 --numerology 1 -C 3319680000 --nokrnmod --log_config.global_log_options level,nocolor,time". As the configuration of cu/du is set at this frequency and resource block. If you mount your own configuration file then set the configuration of nr-ue accordingly. + +```bash +helm install oai-nr-ue ../oai-nr-ue +``` + +3. Once NR-UE is connected you can go inside the pod and ping via `oai` interface. If you do not see this interface then the UE is not connected to gNB or have some issues at core network. + +```bash +kubectl exec -it <oai-nr-ue-pod-name> -- bash +#ping towards spgwu/upf +ping -I oaitun_ue1 12.1.1.1 +#ping towards google dns +ping -I oaitun_ue1 8.8.8.8 +``` + +## Note + +1. If you are using multus then make sure it is properly configured and if you don't have a gateway for your multus interface then avoid using gateway and defaultGateway parameter. Either comment them or leave them empty. Wrong gateway configuration can create issues with pod networking and pod will not be able to resolve service names. \ No newline at end of file diff --git a/charts/oai-5g-ran/oai-gnb/templates/NOTES.txt b/charts/oai-5g-ran/oai-gnb/templates/NOTES.txt index ffabda67fc48f7820cd54ecf81e6373ce3d53d01..93f26672333e1c0534cf683bd5f6f43be4b6cff6 100644 --- a/charts/oai-5g-ran/oai-gnb/templates/NOTES.txt +++ b/charts/oai-5g-ran/oai-gnb/templates/NOTES.txt @@ -1,4 +1,8 @@ 1. Get the application name by running these commands: export GNB_POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "oai-gnb.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") export GNB_eth0_IP=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "oai-gnb.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[*].status.podIP}") -2. Note: This helm chart of OAI-gNB is only tested in RF-simulator mode not tested with hardware on Openshift/Kubernetes Cluster \ No newline at end of file +2. Dockerhub images of OpenAirInterface requires avx2 capabilities in the cpu and they are built for x86 architecture, tested on UBUNTU OS only. +3. Note: This helm chart of OAI-gNB is only tested in RF-simulator mode and is not tested with USRPs/RUs on Openshift/Kubernetes Cluster +4. In case you want to test these charts with USRP/RU then make sure your underlying kernel is realtime and CPU sleep states are off. + Also for good performance it is better to use MTU 9000 for Fronthaul interface. +5. If you want to configure for a particular band then copy the configuration file in templates/configmap.yaml from here https://gitlab.eurecom.fr/oai/openairinterface5g/-/tree/develop/targets/PROJECTS/GENERIC-NR-5GC/CONF diff --git a/charts/oai-5g-ran/oai-gnb/templates/configmap.yaml b/charts/oai-5g-ran/oai-gnb/templates/configmap.yaml index 0cea2a0e4d0f2c4a129bc765a58d865499c88b4c..96fbc6a322392fcafde888655175592f0ef7cd4e 100644 --- a/charts/oai-5g-ran/oai-gnb/templates/configmap.yaml +++ b/charts/oai-5g-ran/oai-gnb/templates/configmap.yaml @@ -9,13 +9,14 @@ data: {{- end }} {{- else }} --- +## Configuration file for band77 and 51 PRB tested with B210 apiVersion: v1 kind: ConfigMap metadata: name: {{ .Chart.Name }}-configmap data: mounted.conf: | - Active_gNBs = ( "gnb-in-docker"); + Active_gNBs = ( "oai-gnb-rfsim"); # Asn1_verbosity, choice in: none, info, annoying Asn1_verbosity = "none"; @@ -24,7 +25,7 @@ data: { ////////// Identification parameters: gNB_ID = 0xe00; - gNB_name = "gnb-in-docker"; + gNB_name = "oai-gnb-rfsim"; // Tracking area code, 0x0000 and 0xfffe are reserved values tracking_area_code = 1 ; @@ -192,10 +193,10 @@ data: NETWORK_INTERFACES : { - GNB_INTERFACE_NAME_FOR_NG_AMF = "enp3s0"; - GNB_IPV4_ADDRESS_FOR_NG_AMF = "172.21.19.40/22"; - GNB_INTERFACE_NAME_FOR_NGU = "enp3s0"; - GNB_IPV4_ADDRESS_FOR_NGU = "172.21.19.40/22"; + GNB_INTERFACE_NAME_FOR_NG_AMF = "n2"; + GNB_IPV4_ADDRESS_FOR_NG_AMF = "172.21.6.90"; + GNB_INTERFACE_NAME_FOR_NGU = "n3"; + GNB_IPV4_ADDRESS_FOR_NGU = "172.21.6.91"; GNB_PORT_FOR_S1U = 2152; # Spec 2152 }; @@ -231,7 +232,7 @@ data: nb_rx = 1 att_tx = 14; att_rx = 14; - bands = [78]; + bands = [77]; max_pdschReferenceSignalPower = -27; max_rxgain = 114; eNB_instances = [0]; diff --git a/charts/oai-5g-ran/oai-gnb/templates/deployment.yaml b/charts/oai-5g-ran/oai-gnb/templates/deployment.yaml index 36d7c69c0d4662ce2e677eb66bf6d2eb6d309ba2..f1108778c1ba02c8ff89c70bac6a078bada58c70 100644 --- a/charts/oai-5g-ran/oai-gnb/templates/deployment.yaml +++ b/charts/oai-5g-ran/oai-gnb/templates/deployment.yaml @@ -15,14 +15,36 @@ spec: metadata: labels: {{- include "oai-gnb.selectorLabels" . | nindent 8 }} - app: 5grf-sim - {{- if .Values.multus.create }} + app: oai-gnb + {{- if .Values.multus.n2Interface.create }} annotations: k8s.v1.cni.cncf.io/networks: >- [{ - "name": "{{ .Chart.Name }}-net1", - "default-route": ["{{ .Values.multus.defaultGateway }}"] - }] + "name": "{{ .Chart.Name }}-n2", + "interface": "n2", + {{- if .Values.multus.defaultGateway }} + ,"default-route": ["{{ .Values.multus.defaultGateway }}"] + {{- end }} + } + {{- if .Values.multus.n3Interface.create }} + ,{ + "name": "{{ .Chart.Name }}-n3", + "interface": "n3", + {{- if .Values.multus.n3Interface.Gateway }} + ,"gateway": {{ .Values.multus.n3Interface.Gateway }} + {{- end }} + } + {{- end }} + {{- if .Values.multus.ruInterface.create }} + ,{ + "name": "{{ .Chart.Name }}-ru", + "interface": "ru", + {{- if .Values.multus.ruInterface.Gateway }} + ,"gateway": {{ .Values.multus.ruInterface.Gateway }} + {{- end }} + } + {{- end }} + ] {{- end }} spec: securityContext: @@ -41,17 +63,25 @@ spec: name: configuration subPath: mounted.conf {{- end}} + ## USRP B210/B200 Mini + # - mountPath: /dev/bus/usb/ + # name: usrp {{- if .Values.resources.define}} resources: requests: - memory: {{ .Values.resources.requests.memory | quote }} - cpu: {{ .Values.resources.requests.cpu | quote }} + memory: {{ .Values.resources.requests.nf.memory | quote }} + cpu: {{ .Values.resources.requests.nf.cpu | quote }} limits: - memory: {{ .Values.resources.limits.memory | quote }} - cpu: {{ .Values.resources.limits.cpu | quote }} + memory: {{ .Values.resources.limits.nf.memory | quote }} + cpu: {{ .Values.resources.limits.nf.cpu | quote }} {{- end}} securityContext: - {{- toYaml .Values.securityContext | nindent 12 }} + privileged: true + # capabilities: + # add: + # - NET_ADMIN + # drop: + # - ALL ports: - containerPort: 2152 name: n3 @@ -165,27 +195,46 @@ spec: name: {{ .Chart.Name }}-configmap key: sdrAddrs {{- end}} + {{- if .Values.includeTcpDumpContainer }} - name: tcpdump image: "{{ .Values.tcpdumpimage.repository }}:{{ .Values.tcpdumpimage.version }}" imagePullPolicy: {{ .Values.tcpdumpimage.pullPolicy }} + {{- if .Values.resources.define}} + resources: + requests: + memory: {{ .Values.resources.requests.tcpdump.memory | quote }} + cpu: {{ .Values.resources.requests.tcpdump.cpu | quote }} + limits: + memory: {{ .Values.resources.limits.tcpdump.memory | quote }} + cpu: {{ .Values.resources.limits.tcpdump.cpu | quote }} + {{- end}} securityContext: - {{- toYaml .Values.securityContext | nindent 12 }} + privileged: true + capabilities: + add: + - NET_ADMIN + drop: + - ALL {{- if .Values.start.tcpdump}} command: - /bin/sh - -c - - /usr/sbin/tcpdump -i any -w /tmp/oai-gnb_`date +%Y-%m-%d_%H_%M-%S-%Z`.pcap + - /usr/sbin/tcpdump -i any -w /tmp/pcap/{{ .Chart.Name }}_`date +%Y-%m-%d_%H_%M-%S-%Z`.pcap {{- else}} command: - /bin/sleep - infinity {{- end}} - {{- if .Values.config.mountConfig}} + {{- end }} + {{- if.Values.config.mountConfig }} volumes: - configMap: name: {{ .Chart.Name }}-configmap name: configuration {{- end}} + # - name: usrp + # hostPath: + # path: /dev/bus/usb/ dnsPolicy: ClusterFirst restartPolicy: Always schedulerName: default-scheduler @@ -198,5 +247,3 @@ spec: {{- if .Values.nodeName}} nodeName: {{ .Values.nodeName }} {{- end }} - - diff --git a/charts/oai-5g-ran/oai-gnb/templates/multus.yaml b/charts/oai-5g-ran/oai-gnb/templates/multus.yaml index aa1fd4b3334851490d60edf911284e6024ba41eb..9de4bd3b7f60782ab6bea0b5c6bcab642d125c24 100644 --- a/charts/oai-5g-ran/oai-gnb/templates/multus.yaml +++ b/charts/oai-5g-ran/oai-gnb/templates/multus.yaml @@ -1,20 +1,73 @@ --- -{{- if .Values.multus.create }} +{{- if .Values.multus.n2Interface.create }} apiVersion: "k8s.cni.cncf.io/v1" kind: NetworkAttachmentDefinition metadata: - name: {{ .Chart.Name }}-net1 + name: {{ .Chart.Name }}-n2 spec: config: '{ - "cniVersion": "0.3.0", + "cniVersion": "0.3.1", "type": "macvlan", - "master": {{- cat .Values.multus.hostInterface | nospace | quote }}, + "master": {{- cat .Values.multus.n2Interface.hostInterface | nospace | quote }}, "mode": "bridge", "ipam": { "type": "static", "addresses": [ { - "address": {{- cat .Values.multus.n2n3IPadd "/" .Values.multus.n2n3Netmask | nospace | quote }} + "address": {{- cat .Values.multus.n2Interface.IPadd "/" .Values.multus.n2Interface.Netmask | nospace | quote }} + } + ] + {{- if .Values.multus.n2Interface.routes }} + ,"routes": {{- .Values.multus.n2Interface.routes | toJson }} + {{- end }} + } + }' +{{- end }} +--- +{{- if .Values.multus.n3Interface.create }} +apiVersion: "k8s.cni.cncf.io/v1" +kind: NetworkAttachmentDefinition +metadata: + name: {{ .Chart.Name }}-n3 +spec: + config: '{ + "cniVersion": "0.3.1", + "type": "macvlan", + "master": {{- cat .Values.multus.n3Interface.hostInterface | nospace | quote }}, + "mode": "bridge", + "ipam": { + "type": "static", + "addresses": [ + { + "address": {{- cat .Values.multus.n3Interface.IPadd "/" .Values.multus.n3Interface.Netmask | nospace | quote }} + } + ] + {{- if .Values.multus.n3Interface.routes }} + ,"routes": {{- .Values.multus.n3Interface.routes | toJson }} + {{- end }} + } + }' +{{- end }} +--- +{{- if .Values.multus.ruInterface.create }} +apiVersion: "k8s.cni.cncf.io/v1" +kind: NetworkAttachmentDefinition +metadata: + name: {{ .Chart.Name }}-ru +spec: + config: '{ + "cniVersion": "0.3.1", + "type": "macvlan", + "master": {{- cat .Values.multus.ruInterface.hostInterface | nospace | quote }}, + {{- if .Values.multus.ruInterface.mtu }} + "mtu": {{ .Values.multus.ruInterface.mtu }}, + {{- end }} + "mode": "bridge", + "ipam": { + "type": "static", + "addresses": [ + { + "address": {{- cat .Values.multus.ruInterface.IPadd "/" .Values.multus.ruInterface.Netmask | nospace | quote }} } ] } diff --git a/charts/oai-5g-ran/oai-gnb/values.yaml b/charts/oai-5g-ran/oai-gnb/values.yaml index 55a21866b2b8b4eeca80b4c14f9079936ea9b579..3b93a96fd6441885b99bf30a3031d85029c99c9c 100644 --- a/charts/oai-5g-ran/oai-gnb/values.yaml +++ b/charts/oai-5g-ran/oai-gnb/values.yaml @@ -1,17 +1,13 @@ -kubernetesType: Vanilla #Vanilla for community kubernetes distribution +kubernetesType: Vanilla #Vanilla for community kubernetes distribution else Openshift for Openshift +## In case of using these charts on Openshift then please use UBI images +## To know more about them follow this tutorial https://gitlab.eurecom.fr/oai/cn5g/oai-cn5g-fed/-/tree/master/openshift nfimage: # image name either locally present or in a public/private repository repository: docker.io/oaisoftwarealliance/oai-gnb - version: develop # image tag + version: 2023.w19 # image tag or develop # pullPolicy: IfNotPresent or Never or Always pullPolicy: IfNotPresent -tcpdumpimage: - repository: docker.io/corfr/tcpdump - version: latest - #pullPolicy: IfNotPresent or Never or Always - pullPolicy: IfNotPresent - # good to use when pulling images from docker-hub mention imagePullSecrets: - name: "regcred" @@ -25,74 +21,122 @@ serviceAccount: # If not set and create is true, a name is generated using the fullname template name: "oai-gnb-sa" -podSecurityContext: - runAsUser: 0 - runAsGroup: 0 +#service type is fixed to clusterIP, it is only support for non multus interface (eth0) -securityContext: - privileged: true - # capabilities: - # drop: - # - ALL - # readOnlyRootFilesystem: true - # runAsNonRoot: true - # runAsUser: 1000 +# These helm-charts can be used for two purpose +# 1. RFSimulated oai-gNB: Only requires 1 interface for N2 and N3. You can use Kubernetes default interface eth0 +# 2. Physical gNB with Ethernet based USRP or RRU: You need to use ruInterface to connect with RU. Make sure that the ip-address you choose can reach to RU. +# Using a dedicated interface for N2 or N3 is optional you can still use eth0. +# 3. Another thing you can chose to use same virtual interface for N2/N3 its optional to have two different -#service type is fixed to clusterIP, it is only support for non multus interface (eth0) +## NOTE: To use these charts with USRP B210 you need to modify and mount usb from the host. +## Change these ip-addresses according to your environment -start: - gnb: true - tcpdump: false -# gNB needs two seperate interface one for ngap (N2) and other one for gtpu (N3) -# But for experimentation only one interface can be used. -# When you need multus: -# 1. you want seperate interface for N2 and N3 -# 2. You want static ip-address for N2 and N3 interface -# 3. Different interfaces for different packets - -multus: # needed when gnB service will run on another interface rather than traditional eth0 - create: false - n2n3IPadd: "172.21.6.203" - n2n3Netmask: "22" +multus: + # if default gatway is empty then it will be removed defaultGateway: "172.21.7.254" - hostInterface: "bond0" # Interface of the host machine on which this pod will be scheduled - + n2Interface: + create: false + # #name inside the pod is hardcoded right now + # name: "n2" + IPadd: "172.21.6.90" + Netmask: "22" + # if gatway is empty then it will be removed + Gateway: "172.21.7.254" + #routes: [{'dst': '10.8.0.0/24','gw': '172.21.7.254'}, {'dst': '10.9.0.0/24','gw': '172.21.7.254'}] + hostInterface: "bond0" # Interface of the host machine on which this pod will be scheduled + n3Interface: + create: false + IPadd: "172.21.6.91" + # #name inside the pod is hardcoded right now + # name: "n3" + Netmask: "22" + # if gatway is empty then it will be removed + Gateway: "172.21.7.254" + #routes: + hostInterface: "bond0" # Interface of the host machine on which this pod will be scheduled + ruInterface: #Only needed if using a ethernet based RU/USRP + create: false + IPadd: "192.168.80.90" + # #name inside the pod is hardcoded right now + # name: "ru" + Netmask: "24" + # if gatway is commented then it will be removed + Gateway: "192.168.80.1" #In case you don't have a gateway remove it from here + ## The value must be [0, master's MTU]. If commented it will masters MTU + #mtu: 1500 + hostInterface: "bond0" # Interface of the host machine on which this pod will be scheduled + +## If you want to change more configuration parameters then you should mount the config file +# in templates/configmap.yaml +# Example config files --> https://gitlab.eurecom.fr/oai/openairinterface5g/-/tree/develop/targets/PROJECTS/GENERIC-NR-5GC/CONF config: mountConfig: false #If config file is mounted then please edit mount.conf in configmap.yaml properly - useSATddMono: true + rfSimulator: "server" #If you are not using in RFsimulator mode then you can leave this empty timeZone: "Europe/Paris" - rfSimulator: "server" + ## -E is to apply three-quarter of sampling frequency, 23.04 Msps to reduce the data rate on USB/PCIe transfers (only valid for 20 MHz) + useAdditionalOptions: "--sa -E --rfsim --log_config.global_log_options level,nocolor,time" + # If mounting the configuration file then below parameters are not used useSATddMono: "yes" - gnbName: "gnb-rfsim" + gnbName: "oai-gnb-rfsim" mcc: "001" # check the information with AMF, SMF, UPF/SPGWU mnc: "01" # check the information with AMF, SMF, UPF/SPGWU mncLength: "2" # check the information with AMF, SMF, UPF/SPGWU tac: "1" # check the information with AMF nssaiSst: "1" #currently only 4 standard values are allowed 1,2,3,4 nssaiSd0: "ffffff" #values in hexa-decimal format - amfIpAddress: "oai-amf-svc" # amf ip-address or service-name oai-amf-svc - gnbNgaIfName: "eth0" # net1 in case multus create is true that means another interface is created for ngap interface, n2 to communicate with amf - gnbNgaIpAddress: "status.podIP" # n2n3IPadd in case multus create is true - gnbNguIfName: "eth0" #net1 in case multus create is true gtu interface for upf/spgwu - gnbNguIpAddress: "status.podIP" # n2n3IPadd in case multus create is true - useAdditionalOptions: "--sa -E --rfsim --log_config.global_log_options level,nocolor,time" + #entrypoint.sh tries to resolve the amfHost name if the resolution did not work gNB will not start + amfIpAddress: "oai-amf-svc" # amf ip-address or service-name oai-amf-svc or 172.21.6.94 + gnbNgaIfName: "eth0" # if multus.n2Interface.create is true then use n2 + gnbNgaIpAddress: "status.podIP" # if multus.n2Interface.create is true then use multus.n2Interface.Ipadd + gnbNguIfName: "eth0" #if multus.n3Interface.create is true then use n3 or you can only use 1 interface n2 or eth0 + gnbNguIpAddress: "status.podIP" # if multus.n3Interface.create is true then use multus.n3Interface.Ipadd or multus.n2Interface.Ipadd if you are using only 1 extra interface threadParallelConfig: "PARALLEL_SINGLE_THREAD" sdrAddrs: "serial=XXXXXXX" +## Debugging section +start: + gnb: true #If false the network function container will run in sleep mode for manually testing + tcpdump: false + +includeTcpDumpContainer: false #If true it will add a tcpdump container inside network function pod for debugging +podSecurityContext: + runAsUser: 0 + runAsGroup: 0 + +## For openshift you can use rhel8/support-tools:8.7-13 +tcpdumpimage: + repository: docker.io/corfr/tcpdump + version: latest + #pullPolicy: IfNotPresent or Never or Always + pullPolicy: IfNotPresent + +## NF is the network function and tcpdump is the tcpdump container. +## To know more about request and limit it is better to understand that how Kubernetes QoS works. +## https://kubernetes.io/docs/concepts/configuration/manage-resources-containers +## https://kubernetes.io/docs/concepts/workloads/pods/pod-qos resources: define: false limits: - cpu: 100m - memory: 128Mi + nf: + cpu: 2000m + memory: 2Gi + #If tcpdump container is disabled this value will not be used + tcpdump: + cpu: 200m + memory: 128Mi requests: - cpu: 100m - memory: 256Mi - + nf: + cpu: 2000m + memory: 2Gi + #If tcpdump container is disabled this value will not be used + tcpdump: + cpu: 100m + memory: 128Mi tolerations: [] - affinity: {} terminationGracePeriodSeconds: 5 diff --git a/charts/oai-5g-ran/oai-nr-ue/Chart.yaml b/charts/oai-5g-ran/oai-nr-ue/Chart.yaml index 0d5a5e1e1633b4d1e214c2cb01b1b4c01e88b318..7aea9b1cf5ef95cd339ad23096a06b2dd4440e46 100644 --- a/charts/oai-5g-ran/oai-nr-ue/Chart.yaml +++ b/charts/oai-5g-ran/oai-nr-ue/Chart.yaml @@ -37,7 +37,7 @@ icon: http://www.openairinterface.org/wp-content/uploads/2015/06/cropped-oai_fin # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. -version: 0.1.1 +version: 1.0.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. diff --git a/charts/oai-5g-ran/oai-nr-ue/README.md b/charts/oai-5g-ran/oai-nr-ue/README.md new file mode 100644 index 0000000000000000000000000000000000000000..5443b3696b6877c22d97f6a9dd8a0767ad428252 --- /dev/null +++ b/charts/oai-5g-ran/oai-nr-ue/README.md @@ -0,0 +1,103 @@ +# Helm Chart for OAI New Radio User Equipment (OAI-NR-UE) + +This helm-chart is only tested for [RF Simulated oai-nr-ue](https://gitlab.eurecom.fr/oai/openairinterface5g/-/blob/develop/radio/rfsimulator/README.md). You can read about the design of [oai-nr-ue](https://gitlab.eurecom.fr/oai/openairinterface5g/-/blob/develop/doc/nr-ue-design.md) and a non helm-chart based [tutorial](https://gitlab.eurecom.fr/oai/openairinterface5g/-/blob/develop/doc/NR_SA_Tutorial_OAI_nrUE.md#3-oai-gnb-and-oai-nrue) with USRP B210. + +**Note**: This chart is tested on [Minikube](https://minikube.sigs.k8s.io/docs/) and [Red Hat Openshift](https://www.redhat.com/fr/technologies/cloud-computing/openshift) 4.10 and 4.12. RFSIM requires minimum 2CPU and 2Gi RAM and [multus-cni](https://github.com/k8snetworkplumbingwg/multus-cni) plugin for multiple interfaces. + +## Introduction + +To know more about the feature set of OpenAirInterface you can check it [here](https://gitlab.eurecom.fr/oai/openairinterface5g/-/blob/develop/doc/FEATURE_SET.md#openairinterface-5g-nr-feature-set). + +The [codebase](https://gitlab.eurecom.fr/oai/openairinterface5g/-/tree/develop) for NR-UE is same as gNB, CU, DU, CU-CP/CU-UP. Everyweek on [docker-hub](https://hub.docker.com/r/oaisoftwarealliance/oai-gnb) our [Jenkins Platform](https://jenkins-oai.eurecom.fr/view/RAN/) publishes docker-images for `oaisoftwarealliance/oai-nr-ue` + +Each image has develop tag and a dedicated week tag for example `2023.w18`. We only publish Ubuntu 18.04/20.04 images. We do not publish RedHat/UBI images. These images you have to build from the source code on your RedHat systems or Openshift Platform. You can follow this [tutorial](../../../openshift/README.md) for that. + +The helm chart of OAI-NR-UE creates multiples Kubernetes resources, + +1. Service +2. Role Base Access Control (RBAC) (role and role bindings) +3. Deployment +4. Configmap +5. Service account +6. Network-attachment-defination (Optional only when multus is used) + +The directory structure + +``` +. +├── Chart.yaml +├── templates +│  ├── configmap.yaml +│  ├── deployment.yaml +│  ├── _helpers.tpl +│  ├── multus.yaml +│  ├── NOTES.txt +│  ├── rbac.yaml +│  ├── serviceaccount.yaml +│  └── service.yaml +└── values.yaml +``` + +## Parameters + +[Values.yaml](./values.yaml) contains all the configurable parameters. Below table defines the configurable parameters. You need a dedicated interface for for NR-UE when it will run on a different cluster then gNB/DU. + + +|Parameter |Allowed Values |Remark | +|--------------------------------|-------------------------------|-------------------------------------| +|kubernetesType |Vanilla/Openshift |Vanilla Kubernetes or Openshift | +|nfimage.repository |Image Name | | +|nfimage.version |Image tag | | +|nfimage.pullPolicy |IfNotPresent or Never or Always| | +|imagePullSecrets.name |String |Good to use for docker hub | +|serviceAccount.create |true/false | | +|serviceAccount.annotations |String | | +|serviceAccount.name |String | | +|podSecurityContext.runAsUser |Integer (0,65534) | | +|podSecurityContext.runAsGroup |Integer (0,65534) | | +|multus.n2Interface.create |true/false | | +|multus.n2Interface.Ipadd |Ip-Address | | +|multus.n2Interface.Netmask |Netmask | | +|multus.n2Interface.Gateway |Ip-Address | | +|multus.n2Interface.routes |Json |Routes if you want to add in your pod| +|multus.n2Interface.hostInterface|host interface |Host interface on which pod will run | +|multus.defaultGateway |Ip-Address |Default route inside pod | + + +## Advanced Debugging Parameters + +Only needed if you are doing advanced debugging + +|Parameter |Allowed Values |Remark | +|---------------------------------|-------------------------------|----------------------------------------------| +|start.nrue |true/false |If true nrue container will go in sleep mode | +|start.tcpdump |true/false |If true tcpdump container will go in sleepmode| +|includeTcpDumpContainer |true/false |If false no tcpdump container will be there | +|tcpdumpimage.repository |Image Name | | +|tcpdumpimage.version |Image tag | | +|tcpdumpimage.pullPolicy |IfNotPresent or Never or Always| | +|persistent.sharedvolume |true/false |Save the pcaps in a shared volume with NRF | +|resources.define |true/false | | +|resources.limits.tcpdump.cpu |string |Unit m for milicpu or cpu | +|resources.limits.tcpdump.memory |string |Unit Mi/Gi/MB/GB | +|resources.limits.nf.cpu |string |Unit m for milicpu or cpu | +|resources.limits.nf.memory |string |Unit Mi/Gi/MB/GB | +|resources.requests.tcpdump.cpu |string |Unit m for milicpu or cpu | +|resources.requests.tcpdump.memory|string |Unit Mi/Gi/MB/GB | +|resources.requests.nf.cpu |string |Unit m for milicpu or cpu | +|resources.requests.nf.memory |string |Unit Mi/Gi/MB/GB | +|readinessProbe |true/false |default true | +|livenessProbe |true/false |default false | +|terminationGracePeriodSeconds |5 |In seconds (default 5) | +|nodeSelector |Node label | | +|nodeName |Node Name | | + +## How to use + +```bash +helm install oai-nr-ue . +``` + +## Note + +1. If you are using multus then make sure it is properly configured and if you don't have a gateway for your multus interface then avoid using gateway and defaultGateway parameter. Either comment them or leave them empty. Wrong gateway configuration can create issues with pod networking and pod will not be able to resolve service names. \ No newline at end of file diff --git a/charts/oai-5g-ran/oai-nr-ue/templates/NOTES.txt b/charts/oai-5g-ran/oai-nr-ue/templates/NOTES.txt index b716319bc1c77a85717c29ba3e357bfb713e6a9b..2a1e39711e2648e986ef049241f3941c87a4d8f5 100644 --- a/charts/oai-5g-ran/oai-nr-ue/templates/NOTES.txt +++ b/charts/oai-5g-ran/oai-nr-ue/templates/NOTES.txt @@ -1,3 +1,5 @@ 1. Get the application name by running these commands: export NR_UE_POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "oai-nr-ue.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") -2. Note: This helm chart of OAI-NR-UE is only tested in RF-simulator mode not tested with hardware on Openshift/Kubernetes Cluster \ No newline at end of file +2. Dockerhub images of OpenAirInterface requires avx2 capabilities in the cpu and they are built for x86 architecture, tested on UBUNTU OS only. +3. Note: This helm chart of OAI-NR-UE is only tested in RF-simulator mode not tested with hardware on Openshift/Kubernetes Cluster +4. In case you want to test these charts with USRP then make sure your CPU sleep states are off diff --git a/charts/oai-5g-ran/oai-nr-ue/templates/configmap.yaml b/charts/oai-5g-ran/oai-nr-ue/templates/configmap.yaml index 53fef496714afea164b7bf1eaf2d6caa67186c95..88ab17758964b64b1d1addd0f28602e468ec9bf2 100644 --- a/charts/oai-5g-ran/oai-nr-ue/templates/configmap.yaml +++ b/charts/oai-5g-ran/oai-nr-ue/templates/configmap.yaml @@ -5,4 +5,20 @@ metadata: data: {{- range $key, $val := .Values.config }} {{ $key }}: {{ $val | quote }} - {{- end }} \ No newline at end of file + {{- end }} + +# --- +# apiVersion: v1 +# kind: ConfigMap +# metadata: +# name: {{ .Chart.Name }}-configmap +# data: +# nrue.conf: | +# uicc0 = { +# imsi = "{{ .Values.config.fullImsi }}"; +# key = "{{ .Values.config.fullKey }}"; +# opc= "{{ .Values.config.opc }}"; +# dnn= "{{ .Values.config.dnn }}"; +# nssai_sst="{{ .Values.config.nssaiSst }}"; +# nssai_sd="{{ .Values.config.nssaiSd }}"; +# } \ No newline at end of file diff --git a/charts/oai-5g-ran/oai-nr-ue/templates/deployment.yaml b/charts/oai-5g-ran/oai-nr-ue/templates/deployment.yaml index 07b98915c9a38eae1eee135c50b7bcba87cd2446..443a15a793b55260395827cbdf1f166f1b1d6fe5 100644 --- a/charts/oai-5g-ran/oai-nr-ue/templates/deployment.yaml +++ b/charts/oai-5g-ran/oai-nr-ue/templates/deployment.yaml @@ -15,7 +15,7 @@ spec: metadata: labels: {{- include "oai-nr-ue.selectorLabels" . | nindent 8 }} - app: 5grf-sim + app: oai-nr-ue annotations: {{- if .Values.multus.create }} k8s.v1.cni.cncf.io/networks: >- @@ -37,14 +37,14 @@ spec: {{- if .Values.resources.define}} resources: requests: - memory: {{ .Values.resources.requests.memory | quote }} - cpu: {{ .Values.resources.requests.cpu | quote }} + memory: {{ .Values.resources.requests.nf.memory | quote }} + cpu: {{ .Values.resources.requests.nf.cpu | quote }} limits: - memory: {{ .Values.resources.limits.memory | quote }} - cpu: {{ .Values.resources.limits.cpu | quote }} + memory: {{ .Values.resources.limits.nf.memory | quote }} + cpu: {{ .Values.resources.limits.nf.cpu | quote }} {{- end}} securityContext: - {{- toYaml .Values.securityContext | nindent 12 }} + privileged: true {{- if .Values.start.nrue}} {{- else}} command: @@ -97,20 +97,37 @@ spec: configMapKeyRef: name: {{ .Chart.Name }}-configmap key: useAdditionalOptions + {{- if .Values.includeTcpDumpContainer }} - name: tcpdump image: "{{ .Values.tcpdumpimage.repository }}:{{ .Values.tcpdumpimage.version }}" + imagePullPolicy: {{ .Values.tcpdumpimage.pullPolicy }} + {{- if .Values.resources.define}} + resources: + requests: + memory: {{ .Values.resources.requests.tcpdump.memory | quote }} + cpu: {{ .Values.resources.requests.tcpdump.cpu | quote }} + limits: + memory: {{ .Values.resources.limits.tcpdump.memory | quote }} + cpu: {{ .Values.resources.limits.tcpdump.cpu | quote }} + {{- end}} securityContext: - {{- toYaml .Values.securityContext | nindent 12 }} + privileged: true + capabilities: + add: + - NET_ADMIN + drop: + - ALL {{- if .Values.start.tcpdump}} command: - /bin/sh - -c - - /usr/sbin/tcpdump -i any -w /tmp/oai-nr-ue_`date +%Y-%m-%d_%H_%M-%S-%Z`.pcap + - /usr/sbin/tcpdump -i any -w /tmp/pcap/{{ .Chart.Name }}_`date +%Y-%m-%d_%H_%M-%S-%Z`.pcap {{- else}} command: - /bin/sleep - infinity {{- end}} + {{- end }} dnsPolicy: ClusterFirst restartPolicy: Always serviceAccountName: {{ .Values.serviceAccount.name }} diff --git a/charts/oai-5g-ran/oai-nr-ue/values.yaml b/charts/oai-5g-ran/oai-nr-ue/values.yaml index 989dbe31f8b54c883e0b3c3d7621e3cbb3ca4566..5cae234da3a79459311a440e51976235b7fa1adb 100644 --- a/charts/oai-5g-ran/oai-nr-ue/values.yaml +++ b/charts/oai-5g-ran/oai-nr-ue/values.yaml @@ -1,17 +1,13 @@ -kubernetesType: Vanilla #Vanilla for community kubernetes distribution +kubernetesType: Vanilla #Vanilla for community kubernetes distribution else Openshift for Openshift +## In case of using these charts on Openshift then please use UBI images +## To know more about them follow this tutorial https://gitlab.eurecom.fr/oai/cn5g/oai-cn5g-fed/-/tree/master/openshift nfimage: repository: docker.io/oaisoftwarealliance/oai-nr-ue # dockehub oaisoftwarealliance/oai-nr-ue - version: develop # image tag # develop tag experimental features + version: 2023.w19 # image tag or develop # pullPolicy: IfNotPresent or Never or Always pullPolicy: IfNotPresent -tcpdumpimage: - repository: docker.io/corfr/tcpdump - version: latest - #pullPolicy: IfNotPresent or Never or Always - pullPolicy: IfNotPresent - serviceAccount: # Specifies whether a service account should be created create: true @@ -21,31 +17,14 @@ serviceAccount: # If not set and create is true, a name is generated using the fullname template name: "oai-nr-ue-sa" -## good to use when pulling images from docker-hub mention -#imagePullSecrets: -# - name: "regcred" - - -podSecurityContext: - runAsUser: 0 - runAsGroup: 0 - -securityContext: - privileged: true - # capabilities: - # drop: - # - ALL - # readOnlyRootFilesystem: true - # runAsNonRoot: true - # runAsUser: 1000 - -start: - nrue: true - tcpdump: false # if false then started in sleep mode else it will start capturing packets, nr ue will have a lot of packets per sec better avoid this or add a filter in the deployment.yaml +# good to use when pulling images from docker-hub mention +imagePullSecrets: + - name: "regcred" +## Change these ip-addresses according to your environment multus: create: false - ipadd: "172.21.6.204" # interface needed to connect with gnb + ipadd: "172.21.6.27" # interface needed to connect with gnb netmask: "22" defaultGateway: "172.21.7.254" hostInterface: "bond0" @@ -59,19 +38,50 @@ config: dnn: "oai" nssaiSst: "1" # configure according to gnb and amf, smf and upf nssaiSd: "16777215" - useAdditionalOptions: "-E --sa --rfsim -r 106 --numerology 1 -C 3619200000 --nokrnmod" + useAdditionalOptions: "--sa -E --rfsim -r 106 --numerology 1 -C 3319680000 --nokrnmod --log_config.global_log_options level,nocolor,time" # in case of du change the command #"--sa --rfsim -r 106 --numerology 1 -C 3619200000 --nokrnmod --log_config.global_log_options level,nocolor,time" +podSecurityContext: + runAsUser: 0 + runAsGroup: 0 + +start: + nrue: true + tcpdump: false # if false then started in sleep mode else it will start capturing packets, nr ue will have a lot of packets per sec better avoid this or add a filter in the deployment.yaml + +includeTcpDumpContainer: false #If true it will add a tcpdump container inside network function pod for debugging + +## For openshift you can use rhel8/support-tools:8.7-13 +tcpdumpimage: + repository: docker.io/corfr/tcpdump + version: latest + #pullPolicy: IfNotPresent or Never or Always + pullPolicy: IfNotPresent + +## NF is the network function and tcpdump is the tcpdump container. +## To know more about request and limit it is better to understand that how Kubernetes QoS works. +## https://kubernetes.io/docs/concepts/configuration/manage-resources-containers +## https://kubernetes.io/docs/concepts/workloads/pods/pod-qos resources: define: false limits: - cpu: 100m - memory: 128Mi + nf: + cpu: 1500m + memory: 1Gi + #If tcpdump container is disabled this value will not be used + tcpdump: + cpu: 200m + memory: 128Mi requests: - cpu: 100m - memory: 256Mi + nf: + cpu: 1500m + memory: 1Gi + #If tcpdump container is disabled this value will not be used + tcpdump: + cpu: 100m + memory: 128Mi terminationGracePeriodSeconds: 5 diff --git a/charts/simulators/gnbsim/Chart.yaml b/charts/simulators/gnbsim/Chart.yaml deleted file mode 100644 index d6097ea7365b20d7c870604c00df806583111169..0000000000000000000000000000000000000000 --- a/charts/simulators/gnbsim/Chart.yaml +++ /dev/null @@ -1,21 +0,0 @@ -apiVersion: v2 -name: gnbsim -description: A Helm chart for GNBSIM network function - -type: application - -icon: http://www.openairinterface.org/wp-content/uploads/2015/06/cropped-oai_final_logo.png - -version: 0.0.0 - -appVersion: 0.0.0 - -keywords: - - GNBSIM - -sources: - - https://gitlab.eurecom.fr/kharade/gnbsim/-/tree/master - -maintainers: - - name: OPENAIRINTERFACE - email: contact@openairinterface.org diff --git a/charts/simulators/gnbsim/templates/NOTES.txt b/charts/simulators/gnbsim/templates/NOTES.txt deleted file mode 100644 index 7ab949d12577857c74a3d4ce83ee1d8ef5e4f2f7..0000000000000000000000000000000000000000 --- a/charts/simulators/gnbsim/templates/NOTES.txt +++ /dev/null @@ -1,11 +0,0 @@ -1. Get the application name by running these commands: -{{- if contains "NodePort" .Values.service.type }} - export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "gnbsim.fullname" . }}) - export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") -{{- else if contains "LoadBalancer" .Values.service.type }} - NOTE: It may take a few minutes for the LoadBalancer IP to be available. - You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "gnbsim.fullname" . }}' - export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "gnbsim.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") -{{- else if contains "ClusterIP" .Values.service.type }} - export GNBSIM_POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "gnbsim.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") -{{- end }} diff --git a/charts/simulators/gnbsim/templates/configmap.yaml b/charts/simulators/gnbsim/templates/configmap.yaml deleted file mode 100644 index a2cc06b35d9c8878666b49d5da1ae00e89637452..0000000000000000000000000000000000000000 --- a/charts/simulators/gnbsim/templates/configmap.yaml +++ /dev/null @@ -1,8 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ .Chart.Name }}-configmap -data: - {{- range $key, $val := .Values.config }} - {{ $key }}: {{ $val | quote }} - {{- end }} diff --git a/charts/simulators/gnbsim/templates/deployment.yaml b/charts/simulators/gnbsim/templates/deployment.yaml deleted file mode 100644 index 72399e4215aa10d7195bdbb7cb6bb21e3d6d2f15..0000000000000000000000000000000000000000 --- a/charts/simulators/gnbsim/templates/deployment.yaml +++ /dev/null @@ -1,198 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: {{ .Chart.Name }} - labels: - {{- include "gnbsim.labels" . | nindent 4 }} -spec: - replicas: 1 - selector: - matchLabels: - {{- include "gnbsim.selectorLabels" . | nindent 6 }} - strategy: - type: Recreate - template: - metadata: - labels: - {{- include "gnbsim.selectorLabels" . | nindent 8 }} - spec: - securityContext: - {{- toYaml .Values.podSecurityContext | nindent 8 }} - {{- if .Values.imagePullSecrets }} - imagePullSecrets: - {{ toYaml .Values.imagePullSecrets | indent 8 }} - {{- end }} - containers: - - name: tcpdump - image: "{{ .Values.tcpdumpimage.repository }}:{{ .Values.tcpdumpimage.version }}" - imagePullPolicy: {{ .Values.tcpdumpimage.pullPolicy }} - {{- if .Values.start.tcpdump}} - command: - - /bin/sh - - -c - - /usr/sbin/tcpdump -i any -w /pcap/{{ .Chart.Name }}_`date +%Y-%m-%d_%H_%M-%S-%Z`.pcap - {{- else}} - command: - - /bin/sleep - - infinity - {{- end}} - {{- if .Values.persistent.sharedvolume}} - volumeMounts: - - mountPath: "/pcap" - name: cn5g-pvc - {{- end}} - - name: gnbsim - image: "{{ .Values.nfimage.repository }}:{{ .Values.nfimage.version }}" - imagePullPolicy: {{ .Values.nfimage.pullPolicy }} - {{- if .Values.start.gnbsim}} - {{- else}} - command: - - /bin/sleep - - infinity - {{- end}} - {{- if .Values.resources.define}} - resources: - requests: - memory: {{ .Values.resources.requests.memory | quote }} - cpu: {{ .Values.resources.requests.cpu | quote }} - limits: - memory: {{ .Values.resources.limits.memory | quote }} - cpu: {{ .Values.resources.limits.cpu | quote }} - {{- end}} - securityContext: - {{- toYaml .Values.securityContext | nindent 12 }} - ports: - - containerPort: {{ .Values.service.ngapPort }} - name: ngap - protocol: SCTP - - containerPort: {{ .Values.service.gtpPort }} - name: gtp - protocol: UDP - env: - - name: MCC - valueFrom: - configMapKeyRef: - name: {{ .Chart.Name }}-configmap - key: mcc - - name: MNC - valueFrom: - configMapKeyRef: - name: {{ .Chart.Name }}-configmap - key: mnc - - name: GNBID - valueFrom: - configMapKeyRef: - name: {{ .Chart.Name }}-configmap - key: gnbid - - name: TAC - valueFrom: - configMapKeyRef: - name: {{ .Chart.Name }}-configmap - key: tac - - name: SST - valueFrom: - configMapKeyRef: - name: {{ .Chart.Name }}-configmap - key: sst - - name: SD - valueFrom: - configMapKeyRef: - name: {{ .Chart.Name }}-configmap - key: sd - - name: PagingDRX - valueFrom: - configMapKeyRef: - name: {{ .Chart.Name }}-configmap - key: pagingdrx - - name: RANUENGAPID - valueFrom: - configMapKeyRef: - name: {{ .Chart.Name }}-configmap - key: ranuengapid - - name: IMEISV - valueFrom: - configMapKeyRef: - name: {{ .Chart.Name }}-configmap - key: imeisv - - name: MSIN - valueFrom: - configMapKeyRef: - name: {{ .Chart.Name }}-configmap - key: msin - - name: RoutingIndicator - valueFrom: - configMapKeyRef: - name: {{ .Chart.Name }}-configmap - key: routingindicator - - name: ProtectionScheme - valueFrom: - configMapKeyRef: - name: {{ .Chart.Name }}-configmap - key: protectionscheme - - name: KEY - valueFrom: - configMapKeyRef: - name: {{ .Chart.Name }}-configmap - key: key - - name: OPc - valueFrom: - configMapKeyRef: - name: {{ .Chart.Name }}-configmap - key: opc - - name: DNN - valueFrom: - configMapKeyRef: - name: {{ .Chart.Name }}-configmap - key: dnn - - name: URL - valueFrom: - configMapKeyRef: - name: {{ .Chart.Name }}-configmap - key: url - - name: NRCellID - valueFrom: - configMapKeyRef: - name: {{ .Chart.Name }}-configmap - key: nrcellid - - name: USE_FQDN - valueFrom: - configMapKeyRef: - name: {{ .Chart.Name }}-configmap - key: useFqdn - - name: AMF_FQDN - valueFrom: - configMapKeyRef: - name: {{ .Chart.Name }}-configmap - key: amfFqdn - - name: NGAPPeerAddr - valueFrom: - configMapKeyRef: - name: {{ .Chart.Name }}-configmap - key: ngappeeraddr - - name: GTPuLocalAddr - {{- if eq .Values.config.gtpulocaladdr "status.podIP" }} - valueFrom: - fieldRef: - fieldPath: status.podIP - {{- else}} - valueFrom: - configMapKeyRef: - name: {{ .Chart.Name }}-configmap - key: gtpulocaladdr - {{- end}} - - name: GTPuIFname - valueFrom: - configMapKeyRef: - name: {{ .Chart.Name }}-configmap - key: gtpuifname - dnsPolicy: ClusterFirst - restartPolicy: Always - serviceAccountName: {{ .Values.serviceAccount.name }} - terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }} - {{- if .Values.nodeSelector}} - nodeSelector: {{- toYaml .Values.nodeSelector | nindent 4 }} - {{- end }} - {{- if .Values.nodeName}} - nodeName: {{ .Values.nodeName }} - {{- end }} - diff --git a/charts/simulators/gnbsim/templates/multus.yaml b/charts/simulators/gnbsim/templates/multus.yaml deleted file mode 100644 index 14fa87fdde1a79830d18da53c804ea4996219940..0000000000000000000000000000000000000000 --- a/charts/simulators/gnbsim/templates/multus.yaml +++ /dev/null @@ -1,43 +0,0 @@ ---- -{{- if .Values.multus.create }} -apiVersion: "k8s.cni.cncf.io/v1" -kind: NetworkAttachmentDefinition -metadata: - name: {{ .Chart.Name }}-n2-net1 -spec: - config: '{ - "cniVersion": "0.3.0", - "type": "macvlan", - "master": {{- cat .Values.multus.hostInterface | nospace | quote }}, - "mode": "bridge", - "ipam": { - "type": "static", - "addresses": [ - { - "address": {{- cat .Values.multus.n2IPadd "/" .Values.multus.n2Netmask | nospace | quote }} - } - ] - } - }' ---- -apiVersion: "k8s.cni.cncf.io/v1" -kind: NetworkAttachmentDefinition -metadata: - name: {{ .Chart.Name }}-gtp-net2 -spec: - config: '{ - "cniVersion": "0.3.0", - "type": "macvlan", - "master": {{- cat .Values.multus.hostInterface | nospace | quote }}, - "mode": "bridge", - "ipam": { - "type": "static", - "addresses": [ - { - "address": {{- cat .Values.multus.gtpIPadd "/" .Values.multus.gtpNetmask | nospace | quote }} - } - ] - } - }' ---- -{{- end }} \ No newline at end of file diff --git a/charts/simulators/gnbsim/templates/service.yaml b/charts/simulators/gnbsim/templates/service.yaml deleted file mode 100644 index 73bff24e546388813afc3109f8f6ee020f421be0..0000000000000000000000000000000000000000 --- a/charts/simulators/gnbsim/templates/service.yaml +++ /dev/null @@ -1,27 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ .Chart.Name }}-svc - labels: - {{- include "gnbsim.labels" . | nindent 4 }} -spec: - type: {{ .Values.service.type }} - {{- if eq .Values.service.type "ClusterIP" }} - clusterIP: None - {{ end }} - ports: - - name: ngap - # Port accessible outside cluster - port: {{ .Values.service.ngapPort }} - # Port to forward to inside the pod - targetPort: {{ .Values.service.ngapPort }} - protocol: SCTP - - name: gtp - # Port accessible outside cluster - port: {{ .Values.service.gtpPort }} - # Port to forward to inside the pod - targetPort: {{ .Values.service.gtpPort }} - protocol: UDP - # - selector: - {{- include "gnbsim.selectorLabels" . | nindent 4 }} diff --git a/charts/simulators/gnbsim/values.yaml b/charts/simulators/gnbsim/values.yaml deleted file mode 100644 index b7442e6c02c08009aff684d74c1999c375cc0e6a..0000000000000000000000000000000000000000 --- a/charts/simulators/gnbsim/values.yaml +++ /dev/null @@ -1,90 +0,0 @@ -kubernetesType: Vanila #Vanila for community kubernetes distribution - -# NF image -nfimage: - repository: docker.io/rohankharade/gnbsim - version: develop - # pullPolicy: IfNotPresent or Never or Always - pullPolicy: IfNotPresent - -tcpdumpimage: - repository: corfr/tcpdump - version: latest - # pullPolicy: IfNotPresent or Never or Always - pullPolicy: IfNotPresent - -## good to use when pulling images from docker-hub mention -imagePullSecrets: - - name: "regcred" - -serviceAccount: - # Specifies whether a service account should be created - create: true - # The name of the service account to use. - # If not set and create is true, a name is generated using the fullname template - name: "gnbsim-sa" - -podSecurityContext: - runAsUser: 0 - runAsGroup: 0 - -securityContext: - privileged: true - -service: - type: ClusterIP - ngapPort: 80 - gtpPort: 9090 - -start: - gnbsim: true - tcpdump: false #start tcpdump collection to analyse but beware it will take a lot of space in the container/persistent volume - -# create multus interface in case the NRF wants to use a separate interface -# than kubernetes general CNI or it needs to be accessed from outside cluster network using ip-address. - -multus: - create: false - n2IPadd: "172.21.10.6" - n2Netmask: "22" - n2Gateway: "172.21.11.254" - hostInterface: "bond0" # Interface of the host machine on which this pod will be scheduled - -config: - mcc: "001" - mnc: "01" - gnbid: "1" - tac: "0x0001" - sst: "1" - sd: "1" - pagingdrx: "v32" - ranuengapid: "0" - imeisv: "35609204079514" - msin: "0000000100" - routingindicator: "1234" - protectionscheme: "null" - key: "fec86ba6eb707ed08905757b1bb44b8f" - opc: "C42449363BBAD02B66D16BC975D77CC1" - dnn: "oai" - useFqdn: "no" - amfFqdn: "oai-amf-svc" - url: "http://google.fr" - nrcellid: "1" - ngappeeraddr: "172.17.0.8" - gtpulocaladdr: "status.podIP" #in case of using multus just provide the above multus gtpu ip-address - gtpuifname: "eth0" - -resources: - define: false - limits: - cpu: 100m - memory: 128Mi - requests: - cpu: 100m - memory: 256Mi - -terminationGracePeriodSeconds: 5 - -nodeSelector: {} - -nodeName: \ No newline at end of file diff --git a/docs/DEPLOY_SA5G_HC.md b/docs/DEPLOY_SA5G_HC.md index 0f4fcf3add8e7a5027aa9e665d8b6286c545bd8c..157f4a2b44a7446fd10ca10c6d6e9c70388ab3e3 100644 --- a/docs/DEPLOY_SA5G_HC.md +++ b/docs/DEPLOY_SA5G_HC.md @@ -46,13 +46,13 @@ $: git clone -b <Branch> https://gitlab.eurecom.fr/oai/cn5g/oai-cn5g-fed The helm charts can be used on any production grade kubernetes cluster or even vanilla kubernetes. We have also tested on a single node 4 CPU and 16 GB ram minikube cluster with docker virtualization environment. In our testing environment we deploy these charts on our inhouse Openshift clusters the cluster information can be found below. -| Software | Version | -|:--------------------------------|:---------------------------------------| -| Openshift Client Version | 4.9.X | -| Kubernetes Version | Kubernetes Version: v1.22.5+5c84e52 | -| helm | v3.6.2+5.el8 | -| helm-spray (plugin) | v4.0.10 | -| Base images of Network functions| Ubuntu 18.04/20.04/22.04/UBI 8.X(RHEL8)| +| Software | Version | +|:--------------------------------|:----------------------------------------| +| Openshift Client Version | 4.10.X | +| Kubernetes Version | Kubernetes Version: v1.23.12+8a6bfe4 | +| helm | v3.6.2+5.el8 | +| helm-spray (plugin) | v4.0.10 | +| Base images of Network functions| Ubuntu 18.04/20.04/22.04/UBI 8.X(RHEL8) | We are deploying the helm charts using `helm spray` plugin of `helm` as the network functions have dependency and they are required to be deployed in a certain order. To get more information on helm spray you can follow this [link](https://github.com/ThalesGroup/helm-spray). @@ -161,10 +161,17 @@ Network function discovers each-other using NRF and instead of using the ip-addr ``` ## Example from oai-amf/values.yaml multus: - create: true - n2IPadd: "<provide-an-ip-address>" - n2Netmask: "<provide-a-netmask>" - n2Gateway: "<Gateway>" + ## If you don't want to add a default route in your pod then leave this field empty + defaultGateway: "172.21.7.254" + n2Interface: + create: false + Ipadd: "172.21.6.94" + Netmask: "22" + ## If you do not have a gateway leave the field empty + Gateway: + ## If you do not want to add any routes in your pod then leave this field empty + routes: [{'dst': '10.8.0.0/24','gw': '172.21.7.254'}] + hostInterface: "bond0" # Interface of the host machine on which this pod will be scheduled ``` #### 3.1.2 Use Single Interface diff --git a/openshift/oai-gnb-build-config.yaml b/openshift/oai-gnb-build-config.yaml index d95c51834ed115a45bccb407e2a1534ce17671c6..ccf32829a53c45d534910dc43b879f4cf247ac05 100644 --- a/openshift/oai-gnb-build-config.yaml +++ b/openshift/oai-gnb-build-config.yaml @@ -61,14 +61,12 @@ spec: libX11 \ atlas \ lksctp-tools \ - nettle \ tzdata \ gdb \ python3 \ python3-pip \ net-tools \ - iputils \ - libyaml && \ + iputils && \ pip3 install six && \ pip3 install requests && \ echo "/usr/local/lib" > /etc/ld.so.conf.d/local-lib.conf && \ @@ -92,6 +90,7 @@ spec: /oai-ran/cmake_targets/ran_build/build/libldpc_optim8seg.so \ /oai-ran/cmake_targets/ran_build/build/libldpc_orig.so \ /oai-ran/cmake_targets/ran_build/build/libtelnetsrv.so \ + /oai-ran/cmake_targets/ran_build/build/libtelnetsrv_ci.so \ /usr/local/lib/ COPY --from=gnb-base \ @@ -118,8 +117,7 @@ spec: # Now we are copying from builder-image the UHD files. COPY --from=gnb-base /usr/local/bin/uhd_find_devices /usr/local/bin - COPY --from=gnb-base /usr/lib64/libprotobuf-c.so.1 /usr/local/lib - COPY --from=gnb-base /usr/local/lib64/libuhd.so.3.15.0 /usr/local/lib64 + COPY --from=gnb-base /usr/local/lib64/libuhd.so.4.4.0 /usr/local/lib64 COPY --from=gnb-base /usr/local/lib64/uhd/utils/uhd_images_downloader.py /opt/oai-gnb/bin WORKDIR /usr/local/share/uhd/rfnoc @@ -133,12 +131,6 @@ spec: COPY --from=gnb-build /oai-ran/docker/etc . WORKDIR /opt/oai-gnb - #EXPOSE 2152/udp # S1U, GTP/UDP - #EXPOSE 22100/tcp # ? - #EXPOSE 36412/udp # S1C, SCTP/UDP - #EXPOSE 36422/udp # X2C, SCTP/UDP - #EXPOSE 50000/udp # IF5 / ORI (control) - #EXPOSE 50001/udp # IF5 / ECPRI (data) ENTRYPOINT ["/opt/oai-gnb/bin/entrypoint.sh"] CMD ["/opt/oai-gnb/bin/nr-softmodem", "-O", "/opt/oai-gnb/etc/gnb.conf"] \ No newline at end of file diff --git a/openshift/oai-nr-ue-build-config.yaml b/openshift/oai-nr-ue-build-config.yaml index 6d447a32a85da91cd2cb393363a4634877efafea..b7fac89dcbcccacdab4c80f4bed2e019144bed5e 100644 --- a/openshift/oai-nr-ue-build-config.yaml +++ b/openshift/oai-nr-ue-build-config.yaml @@ -58,7 +58,6 @@ spec: lksctp-tools \ procps-ng \ tzdata \ - nettle \ net-tools \ iputils \ iproute \ @@ -67,8 +66,7 @@ spec: python3 \ python3-pip \ libXpm \ - libX11 \ - libyaml && \ + libX11 && \ pip3 install six && \ pip3 install requests && \ echo "/usr/local/lib" > /etc/ld.so.conf.d/local-lib.conf && \ @@ -125,8 +123,7 @@ spec: # Now we are copying from builder-image the UHD files. COPY --from=nr-ue-base /usr/local/bin/uhd_find_devices /usr/local/bin - COPY --from=nr-ue-base /usr/lib64/libprotobuf-c.so.1 /usr/local/lib - COPY --from=nr-ue-base /usr/local/lib64/libuhd.so.3.15.0 /usr/local/lib64 + COPY --from=nr-ue-base /usr/local/lib64/libuhd.so.4.4.0 /usr/local/lib64 COPY --from=nr-ue-base /usr/local/lib64/uhd/utils/uhd_images_downloader.py /opt/oai-nr-ue/bin WORKDIR /usr/local/share/uhd/rfnoc @@ -141,4 +138,4 @@ spec: WORKDIR /opt/oai-nr-ue CMD ["/opt/oai-nr-ue/bin/nr-uesoftmodem", "-O", "/opt/oai-nr-ue/etc/nr-ue.conf"] - ENTRYPOINT ["/opt/oai-nr-ue/bin/entrypoint.sh"] + ENTRYPOINT ["/opt/oai-nr-ue/bin/entrypoint.sh"] \ No newline at end of file