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 oai/cn5g/oai-cn5g-fed!21
parents add693d7 60f5e89e
......@@ -59,6 +59,9 @@ def nrfTag = params.nrfTag
def amfTag = params.amfTag
def smfTag = params.smfTag
def spgwuTag = params.spgwuTag
def udrTag = params.udrTag
def udmTag = params.udmTag
def ausfTag = params.ausfTag
//-------------------------------------------------------------------------------
// Pipeline start
......@@ -155,12 +158,24 @@ pipeline {
spgwuTag = params.SPGWU_TAG
echo "Upstream Job passed SPGWU_TAG to use: ${spgwuTag}"
}
if (params.UDR_TAG != null) {
udrTag = params.UDR_TAG
echo "Upstream Job passed UDR_TAG to use: ${udrTag}"
}
if (params.UDM_TAG != null) {
udmTag = params.UDM_TAG
echo "Upstream Job passed UDM_TAG to use: ${udmTag}"
}
if (params.AUSF_TAG != null) {
ausfTag = params.AUSF_TAG
echo "Upstream Job passed AUSF_TAG to use: ${ausfTag}"
}
sh "git clean -x -d -f > /dev/null 2>&1"
sh "git fetch --prune > /dev/null 2>&1"
sh 'git checkout -f ' + upstreamTagToUse
sh 'mkdir -p archives DS-TEST-RESULTS'
}
imageTags = "mysql:5.7.30,oai-nrf:${nrfTag},oai-amf:${amfTag},oai-smf:${smfTag},oai-spgwu-tiny:${spgwuTag}"
imageTags = "mysql:5.7.30,oai-nrf:${nrfTag},oai-udr:${udrTag},oai-udm:${udmTag},oai-ausf:${ausfTag},oai-amf:${amfTag},oai-smf:${smfTag},oai-spgwu-tiny:${spgwuTag}"
}
}
}
......
This diff is collapsed.
......@@ -266,6 +266,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:
......@@ -281,6 +286,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:
......
......@@ -4,11 +4,11 @@
replicaCount: 1
namespace: "PROJECT"
namespace: "oaicicd-5gcn-tmp"
image:
registry: local
repository: image-registry.openshift-image-registry.svc:5000/PROJECT/oai-amf
repository: image-registry.openshift-image-registry.svc:5000/oaicicd-5gcn-tmp/oai-amf
version: "TAG"
# pullPolicy: IfNotPresent or Never or Always
pullPolicy: Always
......@@ -93,9 +93,11 @@ config:
ausfIpv4Addr: "127.0.0.1"
ausfPort: 80
ausfApiVersion: "v1"
ausfFqdn: "oai-ausf-svc"
nfRegistration: "yes"
smfSelection: "yes"
useFqdnDns: "yes"
externalAusf: "yes"
mySqlServer: "mysql"
mySqlUser: "root"
mySqlPass: "linux"
......
apiVersion: v1
name: oai-ausf
description: A Helm chart for AUSF 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
- AUSF
sources:
- https://gitlab.eurecom.fr/oai/cn5g/oai-cn5g-ausf
- 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-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: 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-ausf_`date +%Y-%m-%d_%H_%M-%S-%Z`.pcap
{{- else}}
command:
- /bin/sleep
- infinity
{{- end}}
volumeMounts:
- mountPath: "/pcap"
name: cn5g-pv
- name: ausf
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.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:
- 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-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: "oaicicd-5gcn-tmp"
image:
registry: local
repository: image-registry.openshift-image-registry.svc:5000/oaicicd-5gcn-tmp/oai-ausf
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-ausf-sa"
podSecurityContext:
runAsUser: 0
runAsGroup: 0
securityContext:
privileged: true
# capabilities:
# drop:
# - ALL
# readOnlyRootFilesystem: true
# runAsNonRoot: true
# runAsUser: 1000
service:
type: ClusterIP
httpPort: 80
start:
ausf: true
tcpdump: true
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:
# 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: {}
......@@ -4,11 +4,11 @@
replicaCount: 1
namespace: "PROJECT"
namespace: "oaicicd-5gcn-tmp"
image:
registry: local
repository: image-registry.openshift-image-registry.svc:5000/PROJECT/oai-nrf
repository: image-registry.openshift-image-registry.svc:5000/oaicicd-5gcn-tmp/oai-nrf
version: "TAG"
# pullPolicy: IfNotPresent or Never or Always
pullPolicy: Always
......
......@@ -4,11 +4,11 @@
replicaCount: 1
namespace: "PROJECT"
namespace: "oaicicd-5gcn-tmp"
image:
registry: local
repository: image-registry.openshift-image-registry.svc:5000/PROJECT/oai-smf
repository: image-registry.openshift-image-registry.svc:5000/oaicicd-5gcn-tmp/oai-smf
version: "TAG"
#pullPolicy: IfNotPresent or Never or Always
pullPolicy: Always
......
......@@ -4,11 +4,11 @@
replicaCount: 1
namespace: "PROJECT"
namespace: "oaicicd-5gcn-tmp"
image:
registry: local
repository: image-registry.openshift-image-registry.svc:5000/PROJECT/oai-spgwu-tiny
repository: image-registry.openshift-image-registry.svc:5000/oaicicd-5gcn-tmp/oai-spgwu-tiny
version: "TAG"
# pullPolicy: IfNotPresent or Never or Always
pullPolicy: Always
......
apiVersion: v1
name: oai-udm
description: A Helm chart for UDM 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
- UDM
sources:
- https://gitlab.eurecom.fr/oai/cn5g/oai-cn5g-udm
- 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-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 }}