Skip to content
Snippets Groups Projects
Commit 742c6175 authored by Mohammed Ismail's avatar Mohammed Ismail
Browse files

Merge branch 'hc-addition' into 'master'

CI: helm charts added for AUSF UDR UDM with its fqdn enabled

See merge request !21
parents add693d7 60f5e89e
No related branches found
No related tags found
1 merge request!21CI: helm charts added for AUSF UDR UDM with its fqdn enabled
Showing
with 773 additions and 1 deletion
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-udm.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
{{- include "oai-udm.selectorLabels" . | nindent 6 }}
strategy:
type: Recreate
template:
metadata:
labels:
{{- include "oai-udm.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: image-registry.openshift-image-registry.svc:5000/oai/tcpdump-internal:latest
{{- 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
{{- else}}
command:
- /bin/sleep
- infinity
{{- end}}
volumeMounts:
- mountPath: "/pcap"
name: cn5g-pv
- name: udm
image: "{{ .Values.image.repository }}:{{ .Values.image.version }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
ports:
- containerPort: {{ .Values.service.httpPort }}
name: http
{{- if .Values.start.udm}}
{{- else}}
command:
- /bin/sleep
- infinity
{{- end}}
env:
- name: TZ
valueFrom:
configMapKeyRef:
name: {{ .Chart.Name }}-configmap
key: tz
- name: INSTANCE
valueFrom:
configMapKeyRef:
name: {{ .Chart.Name }}-configmap
key: instance
- name: PID_DIRECTORY
valueFrom:
configMapKeyRef:
name: {{ .Chart.Name }}-configmap
key: pidDirectory
- name: UDM_NAME
valueFrom:
configMapKeyRef:
name: {{ .Chart.Name }}-configmap
key: udmName
- name: SBI_IF_NAME
valueFrom:
configMapKeyRef:
name: {{ .Chart.Name }}-configmap
key: sbiIfName
- name: SBI_PORT
valueFrom:
configMapKeyRef:
name: {{ .Chart.Name }}-configmap
key: sbiPort
- name: UDM_VERSION_NB
valueFrom:
configMapKeyRef:
name: {{ .Chart.Name }}-configmap
key: udmVersionNb
- name: USE_FQDN_DNS
valueFrom:
configMapKeyRef:
name: {{ .Chart.Name }}-configmap
key: useFqdnDns
- name: UDR_IP_ADDRESS
valueFrom:
configMapKeyRef:
name: {{ .Chart.Name }}-configmap
key: udrIpAddress
- name: UDR_PORT
valueFrom:
configMapKeyRef:
name: {{ .Chart.Name }}-configmap
key: udrPort
- name: UDR_VERSION_NB
valueFrom:
configMapKeyRef:
name: {{ .Chart.Name }}-configmap
key: udrVersionNb
- name: UDR_FQDN
valueFrom:
configMapKeyRef:
name: {{ .Chart.Name }}-configmap
key: udrFqdn
{{- if .Values.start.udm}}
{{- else}}
command:
- /bin/sleep
- infinity
{{- end}}
volumes:
- name: cn5g-pv
persistentVolumeClaim:
claimName: cn5g-pvc
{{- if .Values.nodeSelector }}
nodeSelector:
{{ toYaml .Values.nodeSelector | indent 8 }}
{{- end }}
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
serviceAccountName: {{ .Values.serviceAccount.name }}
terminationGracePeriodSeconds: 15
---
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:
- privileged
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-udm.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-udm.selectorLabels" . | nindent 4 }}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ .Values.serviceAccount.name }}
# Default values for oai-udm.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
replicaCount: 1
namespace: "oaicicd-5gcn-tmp"
image:
registry: local
repository: image-registry.openshift-image-registry.svc:5000/oaicicd-5gcn-tmp/oai-udm
version: "TAG"
#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-udm-sa"
podSecurityContext:
runAsUser: 0
runAsGroup: 0
securityContext:
privileged: true
# capabilities:
# drop:
# - ALL
# readOnlyRootFilesystem: true
# runAsNonRoot: true
# runAsUser: 1000
service:
type: ClusterIP
httpPort: 80
start:
udm: true
tcpdump: true
multus:
create: false
n4IPadd: "192.168.101.130"
n4Netmask: "26"
n4Gw: "192.168.101.128"
config:
tz: "Europe/Paris"
instance: "0"
pidDirectory: "/var/run"
udmName: "OAI_UDM"
sbiIfName: "eth0"
sbiPort: "80"
udmVersionNb: "v1"
useFqdnDns: "yes"
udrIpAddress: "192.168.101.129"
udrPort: "80"
udrVersionNb: "v1"
udrFqdn: "oai-udr-svc"
persistence:
# make it true for the first time when you want to create persistance volume
# and then false
enabled: false
resources:
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
# limits:
# cpu: 100m
# memory: 128Mi
#requests:
# cpu: 100m
# memory: 256Mi
nodeSelector:
env: dev
tolerations: []
affinity: {}
apiVersion: v1
name: oai-udr
description: A Helm chart for UDR 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: 0.1.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: 0.1.0
keywords:
- Core Network
- 5G
- UDR
sources:
- https://gitlab.eurecom.fr/oai/cn5g/oai-cn5g-udr
- https://gitlab.eurecom.fr/oai/cn5g/oai-cn5g-fed
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-udr.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-udr.fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "oai-udr.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-udr.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-udr.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-udr.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-udr.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
Common labels
*/}}
{{- define "oai-udr.labels" -}}
helm.sh/chart: {{ include "oai-udr.chart" . }}
{{ include "oai-udr.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end -}}
{{/*
Selector labels
*/}}
{{- define "oai-udr.selectorLabels" -}}
app.kubernetes.io/name: {{ include "oai-udr.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end -}}
{{/*
Create the name of the service account to use
*/}}
{{- define "oai-udr.serviceAccountName" -}}
{{- if .Values.serviceAccount.create -}}
{{ default (include "oai-udr.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-udr.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
{{- include "oai-udr.selectorLabels" . | nindent 6 }}
strategy:
type: Recreate
template:
metadata:
labels:
{{- include "oai-udr.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: image-registry.openshift-image-registry.svc:5000/oai/tcpdump-internal:latest
{{- 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
{{- else}}
command:
- /bin/sleep
- infinity
{{- end}}
volumeMounts:
- mountPath: "/pcap"
name: cn5g-pv
- name: udr
image: "{{ .Values.image.repository }}:{{ .Values.image.version }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
ports:
- containerPort: {{ .Values.service.http1Port }}
name: http1
- containerPort: {{ .Values.service.http2Port }}
name: http2
{{- if .Values.start.udr}}
{{- else}}
command:
- /bin/sleep
- infinity
{{- end}}
env:
- name: TZ
valueFrom:
configMapKeyRef:
name: {{ .Chart.Name }}-configmap
key: tz
- name: INSTANCE
valueFrom:
configMapKeyRef:
name: {{ .Chart.Name }}-configmap
key: instance
- name: PID_DIRECTORY
valueFrom:
configMapKeyRef:
name: {{ .Chart.Name }}-configmap
key: pidDirectory
- name: UDR_INTERFACE_NAME_FOR_NUDR
valueFrom:
configMapKeyRef:
name: {{ .Chart.Name }}-configmap
key: udrInterfaceNameForNudr
- name: UDR_INTERFACE_PORT_FOR_NUDR
valueFrom:
configMapKeyRef:
name: {{ .Chart.Name }}-configmap
key: udrInterfaceHttp1PortForNudr
- name: UDR_INTERFACE_HTTP2_PORT_FOR_NUDR
valueFrom:
configMapKeyRef:
name: {{ .Chart.Name }}-configmap
key: udrInterfaceHttp2PortForNudr
- name: UDR_API_VERSION
valueFrom:
configMapKeyRef:
name: {{ .Chart.Name }}-configmap
key: udrApiVersion
- name: MYSQL_IPV4_ADDRESS
valueFrom:
configMapKeyRef:
name: {{ .Chart.Name }}-configmap
key: mySqlServer
- name: MYSQL_USER
valueFrom:
configMapKeyRef:
name: {{ .Chart.Name }}-configmap
key: mySqlUser
- name: MYSQL_PASS
valueFrom:
configMapKeyRef:
name: {{ .Chart.Name }}-configmap
key: mySqlPass
- name: MYSQL_DB
valueFrom:
configMapKeyRef:
name: {{ .Chart.Name }}-configmap
key: mySqlDb
{{- if .Values.start.udr}}
{{- else}}
command:
- /bin/sleep
- infinity
{{- end}}
volumes:
- name: cn5g-pv
persistentVolumeClaim:
claimName: cn5g-pvc
{{- if .Values.nodeSelector }}
nodeSelector:
{{ toYaml .Values.nodeSelector | indent 8 }}
{{- end }}
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
serviceAccountName: {{ .Values.serviceAccount.name }}
terminationGracePeriodSeconds: 15
---
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:
- privileged
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-udr.labels" . | nindent 4 }}
spec:
type: ClusterIP
ports:
- name: http1
# Port accessible outside cluster
port: {{ .Values.service.http1Port }}
# Port to forward to inside the pod
targetPort: {{ .Values.service.http1Port }}
protocol: TCP
- name: http2
# Port accessible outside cluster
port: {{ .Values.service.http2Port }}
# Port to forward to inside the pod
targetPort: {{ .Values.service.http2Port }}
protocol: TCP
selector:
{{- include "oai-udr.selectorLabels" . | nindent 4 }}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ .Values.serviceAccount.name }}
# Default values for oai-udr.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
replicaCount: 1
namespace: "oaicicd-5gcn-tmp"
image:
registry: local
repository: image-registry.openshift-image-registry.svc:5000/oaicicd-5gcn-tmp/oai-udr
version: "TAG"
#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-udr-sa"
podSecurityContext:
runAsUser: 0
runAsGroup: 0
securityContext:
privileged: true
# capabilities:
# drop:
# - ALL
# readOnlyRootFilesystem: true
# runAsNonRoot: true
# runAsUser: 1000
service:
type: ClusterIP
http1Port: 80
http2Port: 8080
start:
udr: true
tcpdump: true
multus:
create: false
n4IPadd: "192.168.101.129"
n4Netmask: "26"
n4Gw: "192.168.101.128"
config:
tz: "Europe/Paris"
instance: "0"
pidDirectory: "/var/run"
udrInterfaceNameForNudr: "eth0"
udrInterfaceHttp1PortForNudr: "80"
udrInterfaceHttp2PortForNudr: "8080"
udrApiVersion: "v1"
mySqlServer: "mysql"
mySqlUser: "root"
mySqlPass: "linux"
mySqlDb: "oai_db"
persistence:
# make it true for the first time when you want to create persistance volume
# and then false
enabled: false
resources:
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
# limits:
# cpu: 100m
# memory: 128Mi
#requests:
# cpu: 100m
# memory: 256Mi
nodeSelector:
env: dev
tolerations: []
affinity: {}
......@@ -120,6 +120,9 @@ class HtmlReport():
self.file.write(' </tr>\n')
self.addImageRow('mysql')
self.addImageRow('oai-nrf')
self.addImageRow('oai-udr')
self.addImageRow('oai-udm')
self.addImageRow('oai-ausf')
self.addImageRow('oai-amf')
self.addImageRow('oai-smf')
self.addImageRow('oai-spgwu-tiny')
......
......@@ -158,6 +158,12 @@ class ClusterDeploy:
subprocess.run(f'sed -i -e "s#TAG#{imageTag}#g" ./ci-scripts/charts/{imageName}/values.yaml', shell=True)
if imageName == 'oai-nrf':
nameSufix = 'nrf'
if imageName == 'oai-udr':
nameSufix = 'udr'
if imageName == 'oai-udm':
nameSufix = 'udm'
if imageName == 'oai-ausf':
nameSufix = 'ausf'
elif imageName == 'oai-amf':
nameSufix = 'amf'
elif imageName == 'oai-smf':
......@@ -200,7 +206,7 @@ class ClusterDeploy:
subprocess.run(f'echo "{imageName}: POD KO" >> archives/5gcn_pods_summary.txt 2>&1', shell=True)
sys.exit(-1)
if passPods == 5:
if passPods == 8:
logging.debug(f'\u001B[1m 5GCN Deployment: OK \u001B[0m')
subprocess.run(f'echo "DEPLOYMENT: OK" > archives/deployment_status.log', shell=True)
else:
......@@ -275,6 +281,12 @@ class ClusterDeploy:
continue
if imageName == 'oai-nrf':
nameSufix = 'nrf'
if imageName == 'oai-udr':
nameSufix = 'udr'
if imageName == 'oai-udm':
nameSufix = 'udm'
if imageName == 'oai-ausf':
nameSufix = 'ausf'
elif imageName == 'oai-amf':
nameSufix = 'amf'
elif imageName == 'oai-smf':
......
#/*
# * 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: image.openshift.io/v1
kind: ImageStream
metadata:
name: oai-ausf
spec:
lookupPolicy:
local: true
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment