Skip to content

Commit

Permalink
Merge pull request #3 from lyz508/upgrade-free5gc-v341-rebase
Browse files Browse the repository at this point in the history
Upgrade free5gc v3.4.2
  • Loading branch information
ianchen0119 authored Jul 5, 2024
2 parents 35460c9 + 997c8e8 commit 5eb8e09
Show file tree
Hide file tree
Showing 60 changed files with 797 additions and 69 deletions.
2 changes: 2 additions & 0 deletions charts/free5gc/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ dependencies:
condition: deployAmf
- name: free5gc-ausf
condition: deployAusf
- name: free5gc-chf
condition: deployChf
- name: free5gc-n3iwf
condition: deployN3iwf
- name: free5gc-nrf
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ data:
pem: ./cert/amf.pem

nrfUri: {{ $.Values.global.sbi.scheme }}://{{ $.Values.global.nrf.service.name }}:{{ $.Values.global.nrf.service.port }}
nrfCertPem: cert/nrf.pem

{{- .configuration.configuration | nindent 6 }}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ spec:
name: {{ include "free5gc-amf.fullname" $ }}-volume
- mountPath: {{ .volume.tlsmount }}
name: {{ include "free5gc-amf.fullname" $ }}-empty-volume
- mountPath: {{ .volume.certmount }}
name: {{ include "free5gc-amf.fullname" $ }}-cert-pvc
resources:
{{- toYaml .resources | nindent 12 }}
dnsPolicy: ClusterFirst
Expand All @@ -103,4 +105,7 @@ spec:
name: {{ include "free5gc-amf.fullname" $ }}-configmap
- name: {{ include "free5gc-amf.fullname" $ }}-empty-volume
emptyDir: {}
- name: {{ include "free5gc-amf.fullname" $ }}-cert-pvc
persistentVolumeClaim:
claimName: cert-pvc
{{- end }}
14 changes: 10 additions & 4 deletions charts/free5gc/charts/free5gc-amf/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ global:

initcontainers:
curl:
registry: towards5gs
image: initcurl
tag: "1.0.0"
registry: curlimages
image: curl
tag: "8.7.1"
busybox:
image: busybox
tag: "1.32.0"
Expand All @@ -64,14 +64,15 @@ amf:
replicaCount: 1
image:
name: free5gc/amf
tag: v3.3.0
tag: v3.4.2
pullPolicy: Always
service:
type: ClusterIP
port: 80
volume:
mount: /free5gc/config/
tlsmount: /free5gc/config/TLS
certmount: /free5gc/cert
podAnnotations: {}
# additional annotations
imagePullSecrets: []
Expand Down Expand Up @@ -194,6 +195,11 @@ amf:
enable: true # true or false
expireTime: 6s # default is 6 seconds
maxRetryTimes: 4 # the max number of retransmission
# retransmission timer for NAS Configuration Update Command message
t3555:
enable: true # true or false
expireTime: 6s # default is 6 seconds
maxRetryTimes: 4 # the max number of retransmission
# retransmission timer for NAS Authentication Request/Security Mode Command message
t3560:
enable: true # true or false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ data:
pem: ./cert/ausf.pem
nrfUri: {{ $.Values.global.sbi.scheme }}://{{ $.Values.global.nrf.service.name }}:{{ $.Values.global.nrf.service.port }}
nrfCertPem: ./cert/nrf.pem # NRF Certificate
{{- .configuration.configuration | nindent 6 }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ spec:
name: {{ include "free5gc-ausf.fullname" $ }}-volume
- mountPath: {{ .volume.tlsmount }}
name: {{ include "free5gc-ausf.fullname" $ }}-empty-volume
- mountPath: {{ .volume.certmount }}
name: {{ include "free5gc-ausf.fullname" $ }}-cert-pvc
resources:
{{- toYaml .resources | nindent 12 }}
dnsPolicy: ClusterFirst
Expand All @@ -89,4 +91,7 @@ spec:
name: {{ include "free5gc-ausf.fullname" $ }}-configmap
- name: {{ include "free5gc-ausf.fullname" $ }}-empty-volume
emptyDir: {}
- name: {{ include "free5gc-ausf.fullname" $ }}-cert-pvc
persistentVolumeClaim:
claimName: cert-pvc
{{- end }}
9 changes: 5 additions & 4 deletions charts/free5gc/charts/free5gc-ausf/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ global:

initcontainers:
curl:
registry: towards5gs
image: initcurl
tag: "1.0.0"
registry: curlimages
image: curl
tag: "8.7.1"
busybox:
image: busybox
tag: "1.32.0"
Expand All @@ -42,14 +42,15 @@ ausf:
replicaCount: 1
image:
name: free5gc/ausf
tag: v3.3.0
tag: v3.4.2
pullPolicy: Always
service:
type: ClusterIP
port: 80
volume:
mount: /free5gc/config/
tlsmount: /free5gc/config/TLS
certmount: /free5gc/cert
podAnnotations: {}
# additional annotations
imagePullSecrets: []
Expand Down
23 changes: 23 additions & 0 deletions charts/free5gc/charts/free5gc-chf/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
12 changes: 12 additions & 0 deletions charts/free5gc/charts/free5gc-chf/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#
# Software Name : free5gc-helm
#
apiVersion: v2
name: free5gc-chf
description: A Helm chart to deploy the free5GC CHF
type: application
version: 0.1.0
appVersion: latest
maintainers:
- email: [email protected]
name: YANG-ZHE, LIN
27 changes: 27 additions & 0 deletions charts/free5gc/charts/free5gc-chf/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#
# Software Name : free5gc-helm
#
{{- with .Values.chf }}
1. Get the application URL by running these commands:
{{- if .ingress.enabled }}
{{- range $host := .ingress.hosts }}
{{- range .paths }}
http{{ if $.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }}
{{- end }}
{{- end }}
{{- else if contains "NodePort" .service.type }}
export NODE_PORT=$(kubectl get --namespace {{ $.Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ .service.name }})
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" .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 {{ .service.name }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ $.Release.Namespace }} {{ .service.name }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
echo http://$SERVICE_IP:{{ .service.port }}
{{- else if contains "ClusterIP" .service.type }}
export POD_NAME=$(kubectl get pods --namespace {{ $.Release.Namespace }} -l "app.kubernetes.io/name={{ include "free5gc-chf.name" $ }},app.kubernetes.io/instance={{ $.Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
export CONTAINER_PORT=$(kubectl get pod --namespace {{ $.Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
echo "Visit http://127.0.0.1:8080 to use your application"
kubectl --namespace {{ $.Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT
{{- end }}
{{- end }}
65 changes: 65 additions & 0 deletions charts/free5gc/charts/free5gc-chf/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#
# Software Name : free5gc-helm
#
{{/*
Expand the name of the chart.
*/}}
{{- define "free5gc-chf.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 "free5gc-chf.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 "free5gc-chf.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "free5gc-chf.labels" -}}
helm.sh/chart: {{ include "free5gc-chf.chart" . }}
{{ include "free5gc-chf.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "free5gc-chf.selectorLabels" -}}
app.kubernetes.io/name: {{ include "free5gc-chf.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
CHF Pod Annotations
*/}}
{{- define "free5gc-chf.chfAnnotations" -}}
{{- with .Values.chf }}
{{- if .podAnnotations }}
{{- toYaml .podAnnotations }}
{{- end }}
{{- end }}
{{- end }}
67 changes: 67 additions & 0 deletions charts/free5gc/charts/free5gc-chf/templates/chf-configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
#
# Software Name : free5gc-helm
#
{{- with .Values.chf }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "free5gc-chf.fullname" $ }}-configmap
labels:
app: {{ $.Values.global.projectName }}
data:
chfcfg.yaml: |
info:
version: 1.0.3
description: CHF initial local configuration
configuration:
chfName: CHF # the name of this CHF
sbi: # Service-based interface information
scheme: {{ $.Values.global.sbi.scheme }} # the protocol for sbi (http or https)
registerIPv4: {{ include "free5gc-chf.fullname" $ }}-service # IP used to register to NRF
bindingIPv4: 0.0.0.0 # IP used to bind the service
port: {{ .service.port }} # port used to bind the service
tls: # the local path of TLS key
pem: ./cert/chf.pem # CHF TLS Certificate
key: ./cert/chf.key # CHF TLS Private key
nrfUri: {{ $.Values.global.sbi.scheme }}://{{ $.Values.global.nrf.service.name }}:{{ $.Values.global.nrf.service.port }} # a valid URI of NRF
nrfCertPem: ./nrf-cert/nrf.pem # NRF Certificate
serviceNameList: # the SBI services provided by this CHF, refer to TS 32.291
{{- .configuration.serviceNameList | nindent 8 }}
mongodb: # the mongodb connected by this CHF
name: free5gc # name of the mongodb
url: mongodb://{{ $.Values.mongodb.service.name }}:{{ $.Values.mongodb.service.port }} # a valid URL of the mongodb
quotaValidityTime: 10000
volumeLimit: 50000
volumeLimitPDU: 10000
volumeThresholdRate: 0.8
cgf:
hostIPv4: {{ $.Values.global.webui.service.name }}
port: {{ $.Values.global.webui.service.port }}
listenPort: {{ $.Values.global.cgf.service.port }}
tls:
pem: ./cert/chf.pem
key: ./cert/chf.key
cdrFilePath: /tmp
abmfDiameter:
protocol: tcp
hostIPv4: 0.0.0.0
port: 3868
tls:
pem: ./cert/chf.pem
key: ./cert/chf.key
rfDiameter:
protocol: tcp
hostIPv4: 0.0.0.0
port: 3869
tls:
pem: ./cert/chf.pem # CHF TLS Certificate
key: ./cert/chf.key # CHF TLS Private key
logger: # log output setting
{{- toYaml .configuration.logger | nindent 6 }}
{{- end }}
Loading

0 comments on commit 5eb8e09

Please sign in to comment.