Commit 2fc07d60 authored by Mohammed Ismail's avatar Mohammed Ismail Committed by Raphael Defosseux
Browse files

Updated the tutorials


Signed-off-by: default avatarMohammed Ismail <mohammed.ismail@openairinterface.org>
parent dea1951e
This diff is collapsed.
......@@ -230,6 +230,11 @@ spec:
configMapKeyRef:
name: {{ .Chart.Name }}-configmap
key: smfFqdn0
- name: SELECTED_0
valueFrom:
configMapKeyRef:
name: {{ .Chart.Name }}-configmap
key: selected0
- name: SMF_INSTANCE_ID_1
valueFrom:
configMapKeyRef:
......@@ -250,6 +255,11 @@ spec:
configMapKeyRef:
name: {{ .Chart.Name }}-configmap
key: smfFqdn1
- name: SELECTED_1
valueFrom:
configMapKeyRef:
name: {{ .Chart.Name }}-configmap
key: selected1
- name: NRF_IPV4_ADDRESS
valueFrom:
configMapKeyRef:
......@@ -285,6 +295,11 @@ spec:
configMapKeyRef:
name: {{ .Chart.Name }}-configmap
key: ausfApiVersion
- name: AUSF_FQDN
valueFrom:
configMapKeyRef:
name: {{ .Chart.Name }}-configmap
key: ausfFqdn
- name: NF_REGISTRATION
valueFrom:
configMapKeyRef:
......@@ -300,6 +315,11 @@ spec:
configMapKeyRef:
name: {{ .Chart.Name }}-configmap
key: useFqdnDns
- name: EXTERNAL_AUSF
valueFrom:
configMapKeyRef:
name: {{ .Chart.Name }}-configmap
key: externalAusf
- name: MYSQL_SERVER
valueFrom:
configMapKeyRef:
......@@ -343,4 +363,4 @@ spec:
{{- end }}
{{- if .Values.nodeName}}
nodeName: {{ .Values.nodeName }}
{{- end }}
\ No newline at end of file
{{- end }}
......@@ -82,11 +82,13 @@ config:
smfInstanceId0: "1" # Only configure if not using NRF
smfIpv4Addr0: "0.0.0.0" # Only configure if not using NRF
smfHttpVersion0: "v1" # Only configure if not using NRF
smfFqdn0: "localhost" # Only configure if not using NRF
smfFqdn0: "oai-amf-svc" # Only configure if not using NRF
selected0: "true"
smfInstanceId1: "2" # Currently disabled in the amf.conf no need to configure
smfIpv4Addr1: "0.0.0.0" # Currently disabled in the amf.conf no need to configure
smfHttpVersion1: "v1" # Currently disabled in the amf.conf no need to configure
smfFqdn1: "localhost" # Currently disabled in the amf.conf no need to configure
smfFqdn1: "oai-amf-svc" # Currently disabled in the amf.conf no need to configure
selected1: "false"
nrfIpv4Addr: "0.0.0.0"
nrfPort: 80
nrfApiVersion: "v1"
......@@ -94,9 +96,11 @@ config:
ausfIpv4Addr: "127.0.0.1" # configure only if there is an external AUSF else it will communicate with mysql directly
ausfPort: 80
ausfApiVersion: "v1"
ausfFqdn: "oai-ausf-svc"
nfRegistration: "yes"
smfSelection: "yes"
useFqdnDns: "yes" # Important to avoid mentioning any static ip-address
externalAusf: "yes"
mySqlServer: "mysql" # used only if not using AUSF
mySqlUser: "root" # used only if not using AUSF
mySqlPass: "linux" # used only if not using AUSF
......
apiVersion: v1
name: oai-ausf
description: A Helm chart for AUSF network function
type: application
icon: http://www.openairinterface.org/wp-content/uploads/2015/06/cropped-oai_final_logo.png
version: 0.1.0
appVersion: 0.1.0
keywords:
- 5GCN
- AUSF
sources:
- https://gitlab.eurecom.fr/oai/cn5g/oai-cn5g-ausf
maintainers:
- name: OPENAIRINTERFACE
email: contact@openairinterface.org
1. Get the application URL 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 "oai-ausf.fullname" . }})
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
echo http://$NODE_IP:$NODE_PORT
{{- 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 "oai-ausf.fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "oai-ausf.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
echo http://$SERVICE_IP:{{ .Values.service.port }}
{{- else if contains "ClusterIP" .Values.service.type }}
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "oai-ausf.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
{{- end }}
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "oai-ausf.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-ausf.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-ausf.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
Common labels
*/}}
{{- define "oai-ausf.labels" -}}
helm.sh/chart: {{ include "oai-ausf.chart" . }}
{{ include "oai-ausf.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end -}}
{{/*
Selector labels
*/}}
{{- define "oai-ausf.selectorLabels" -}}
app.kubernetes.io/name: {{ include "oai-ausf.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end -}}
{{/*
Create the name of the service account to use
*/}}
{{- define "oai-ausf.serviceAccountName" -}}
{{- if .Values.serviceAccount.create -}}
{{ default (include "oai-ausf.fullname" .) .Values.serviceAccount.name }}
{{- else -}}
{{ default "default" .Values.serviceAccount.name }}
{{- end -}}
{{- end -}}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Chart.Name }}-configmap
data:
{{- range $key, $val := .Values.config }}
{{ $key }}: {{ $val | quote }}
{{- end }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Chart.Name }}
labels:
{{- include "oai-ausf.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
{{- include "oai-ausf.selectorLabels" . | nindent 6 }}
strategy:
type: Recreate
template:
metadata:
labels:
{{- include "oai-ausf.selectorLabels" . | nindent 8 }}
{{- if .Values.multus.create }}
annotations:
k8s.v1.cni.cncf.io/networks: {{ .Chart.Name }}-{{ .Values.namespace }}-net1
{{- end }}
spec:
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
{{- if .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: tcpdump
image: "{{ .Values.tcpdumpimage.repository }}:{{ .Values.tcpdumpimage.version }}"
{{- 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
{{- else}}
command:
- /bin/sleep
- infinity
{{- end}}
{{- if .Values.persistence.sharedvolume}}
volumeMounts:
- mountPath: "/pcap"
name: cn5g-pv
{{- end}}
- name: ausf
image: "{{ .Values.nfimage.repository }}:{{ .Values.nfimage.version }}"
imagePullPolicy: {{ .Values.nfimage.pullPolicy }}
{{- 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.httpPort }}
name: http
{{- if .Values.start.ausf}}
{{- else}}
command:
- /bin/sleep
- infinity
{{- end}}
env:
- name: TZ
valueFrom:
configMapKeyRef:
name: {{ .Chart.Name }}-configmap
key: tz
- name: INSTANCE_ID
valueFrom:
configMapKeyRef:
name: {{ .Chart.Name }}-configmap
key: instanceId
- name: PID_DIR
valueFrom:
configMapKeyRef:
name: {{ .Chart.Name }}-configmap
key: pidDirectory
- name: AUSF_NAME
valueFrom:
configMapKeyRef:
name: {{ .Chart.Name }}-configmap
key: ausfName
- name: SBI_IF_NAME
valueFrom:
configMapKeyRef:
name: {{ .Chart.Name }}-configmap
key: sbiIfName
- name: SBI_PORT
valueFrom:
configMapKeyRef:
name: {{ .Chart.Name }}-configmap
key: sbiPort
- name: USE_FQDN_DNS
valueFrom:
configMapKeyRef:
name: {{ .Chart.Name }}-configmap
key: useFqdnDns
- name: UDM_IP_ADDRESS
valueFrom:
configMapKeyRef:
name: {{ .Chart.Name }}-configmap
key: udmIpAddress
- name: UDM_PORT
valueFrom:
configMapKeyRef:
name: {{ .Chart.Name }}-configmap
key: udmPort
- name: UDM_VERSION_NB
valueFrom:
configMapKeyRef:
name: {{ .Chart.Name }}-configmap
key: udmVersionNb
- name: UDM_FQDN
valueFrom:
configMapKeyRef:
name: {{ .Chart.Name }}-configmap
key: udmFqdn
{{- if .Values.start.ausf}}
{{- else}}
command:
- /bin/sleep
- infinity
{{- end}}
volumes:
{{- if .Values.persistence.sharedvolume}}
- name: cn5g-pv
persistenceVolumeClaim:
claimName: cn5g-pvc
{{- end }}
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
serviceAccountName: {{ .Values.serviceAccount.name }}
terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }}
{{- if .Values.nodeSelector}}
nodeSelector: {{- toYaml .Values.nodeSelector | nindent 4 }}
{{- end }}
{{- if .Values.nodeName}}
nodeName: {{ .Values.nodeName }}
{{- end }
---
apiVersion: "k8s.cni.cncf.io/v1"
kind: NetworkAttachmentDefinition
metadata:
name: {{ .Chart.Name }}-{{ .Values.namespace }}-net1
spec:
config: '{
"cniVersion": "0.3.0",
"type": "macvlan",
"master": "bond0",
"mode": "bridge",
"ipam": {
"type": "static",
"addresses": [
{
"address": {{- cat .Values.multus.n4IPadd "/" .Values.multus.n4Netmask | nospace | quote }}
}
]
}
}'
\ No newline at end of file
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: {{ .Chart.Name }}-{{ .Values.namespace }}-role
rules:
- apiGroups:
- security.openshift.io
resourceNames:
- anyuid
resources:
- securitycontextconstraints
verbs:
- use
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: {{ .Chart.Name }}-{{ .Values.namespace }}-binding
subjects:
- kind: ServiceAccount
name: {{ .Values.serviceAccount.name }}
namespace: {{ .Values.namespace }}
roleRef:
kind: Role
name: {{ .Chart.Name }}-{{ .Values.namespace }}-role
apiGroup: rbac.authorization.k8s.io
apiVersion: v1
kind: Service
metadata:
name: {{ .Chart.Name }}-svc
labels:
{{- include "oai-ausf.labels" . | nindent 4 }}
spec:
type: ClusterIP
ports:
- name: http
# Port accessible outside cluster
port: {{ .Values.service.httpPort }}
# Port to forward to inside the pod
targetPort: {{ .Values.service.httpPort }}
protocol: TCP
selector:
{{- include "oai-ausf.selectorLabels" . | nindent 4 }}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ .Values.serviceAccount.name }}
# Default values for oai-ausf.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
replicaCount: 1
namespace: "oai"
nfimage:
registry: local
repository: rdefosseoai/oai-ausf # image name either locally present or in a public/private repository
version: v1.1.0 # image tag
#pullPolicy: IfNotPresent or Never or Always
pullPolicy: Always
tcpdumpimage:
registry: local
repository: corfr/tcpdump
version: latest
#pullPolicy: IfNotPresent or Never or Always
pullPolicy: Always
imagePullSecrets: []
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-ausf-sa"
podSecurityContext:
runAsUser: 0
runAsGroup: 0
securityContext:
privileged: false
service:
type: ClusterIP
httpPort: 80
start:
ausf: true
tcpdump: false #start tcpdump collection to analyse but beware it will take a lot of space in the container/persistent volume
multus:
create: false
n4IPadd: "192.168.101.131"
n4Netmask: "26"
n4Gw: "192.168.101.128"
config:
tz: "Europe/Paris"
instanceId: "0"
pidDirectory: "/var/run"
ausfName: "OAI_AUSF"
sbiIfName: "eth0"
sbiPort: "80"
useFqdnDns: "yes"
udmIpAddress: "192.168.101.130"
udmPort: "80"
udmVersionNb: "v1"
udmFqdn: "oai-udm-svc"
persistence:
sharedvolume: false
size: 1Gi
resources:
define: false
limits:
cpu: 100m
memory: 128Mi
requests:
cpu: 100m
memory: 256Mi
terminationGracePeriodSeconds: 30
nodeSelector: {}
nodeName:
......@@ -79,7 +79,7 @@ config:
nrfApiVersion: "v1"
nrfFqdn: "oai-nrf-svc" # configure if NRF can be reached using Kubernetes service
upfIpv4Address: "127.0.0.1" # configure if NRF is not used
upfFqdn0: "oai-spgwu-svc" # configure if NRF is not used and useFqdnDns is true
upfFqdn0: "oai-spgwu-tiny-svc" # configure if NRF is not used and useFqdnDns is true
## currently only used by tcpdump container to store the tcpdump, this volume will be shared between all the network functions
persistence:
......
......@@ -92,12 +92,22 @@ spec:
valueFrom:
configMapKeyRef:
name: {{ .Chart.Name }}-configmap
key: mnc
key: mnc03
- name: MCC
valueFrom:
configMapKeyRef:
name: {{ .Chart.Name }}-configmap
key: mcc
- name: MNC
valueFrom:
configMapKeyRef:
name: {{ .Chart.Name }}-configmap
key: mnc
- name: TAC
valueFrom:
configMapKeyRef:
name: {{ .Chart.Name }}-configmap
key: tac
- name: REALM
valueFrom:
configMapKeyRef:
......
......@@ -52,8 +52,10 @@ multus:
config:
gwId: 1 # no need to configure
mnc03: "095"
mnc: 208 # should match with AMF and SMF
mcc: 95 # should match with AMF and SMF
tac: 40960
realm: "3gpp.org" # no need to configure
pidDirectory: "/var/run" # no need to configure
sgwS1uIf: "net1" # net1 if gNB is outside the cluster network and multus creation is true else eth0
......
apiVersion: v1
name: oai-udm
description: A Helm chart for UDM network function
type: application
icon: http://www.openairinterface.org/wp-content/uploads/2015/06/cropped-oai_final_logo.png
version: 0.1.0
appVersion: 0.1.0
keywords:
- 5GCN
- UDM
sources:
- https://gitlab.eurecom.fr/oai/cn5g/oai-cn5g-udm
maintainers:
- name: OPENAIRINTERFACE
email: contact@openairinterface.org
1. Get the application URL 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 "oai-udm.fullname" . }})
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
echo http://$NODE_IP:$NODE_PORT
{{- 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 "oai-udm.fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "oai-udm.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
echo http://$SERVICE_IP:{{ .Values.service.port }}
{{- else if contains "ClusterIP" .Values.service.type }}
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "oai-udm.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
{{- end }}
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "oai-udm.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-udm.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 -}}