Skip to content

Commit

Permalink
Merge pull request #20 from Gradiant/feature-open5gs
Browse files Browse the repository at this point in the history
Feature open5gs
  • Loading branch information
cgiraldo authored Oct 8, 2021
2 parents 5db90ea + 258ed65 commit 75d76c8
Show file tree
Hide file tree
Showing 62 changed files with 353 additions and 17 deletions.
2 changes: 1 addition & 1 deletion charts/open5gs/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ maintainers:
- email: [email protected]
name: cgiraldo
name: open5gs
version: 0.3.3
version: 0.3.4
keywords:
- epc
- ngc
Expand Down
28 changes: 28 additions & 0 deletions charts/open5gs/resources/config/bsf.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
logger:
{{ toYaml .Values.amf.logger | indent 2 }}

{{- if .Values.amf.parameter }}
parameter:
{{ toYaml .Values.amf.parameter | indent 2 }}
{{- end }}

{{- if .Values.amf.max }}
max:
{{ toYaml .Values.amf.max | indent 2 }}
{{- end }}

{{- if .Values.amf.pool }}
pool:
{{ toYaml .Values.amf.pool | indent 2 }}
{{- end }}


bsf:
sbi:
dev: eth0
port: 7777

nrf:
sbi:
- name: "{{ include "common.names.fullname" . }}-nrf"
port: 7777
2 changes: 2 additions & 0 deletions charts/open5gs/resources/config/hss.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ parameter:
{{ toYaml .Values.hss.parameter | indent 2 }}
{{- end }}
hss:
{{- if .Values.mme.enabled }}
freeDiameter: hss.conf
{{- end }}
2 changes: 2 additions & 0 deletions charts/open5gs/resources/config/mme.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ sgwc:
gtpc:
- name: "{{ include "common.names.fullname" . }}-sgwc"

{{- if .Values.smf.enabled }}
smf:
gtpc:
- name: "{{ include "common.names.fullname" . }}-smf"
{{- end }}
8 changes: 4 additions & 4 deletions charts/open5gs/resources/config/nssf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ nssf:
dev: eth0
port: 7777
nsi:
- name: "{{ include "common.names.fullname" . }}-nrf"
{{- range .Values.nssf.nsi }}
- name: "{{ include "common.names.fullname" $ }}-nrf"
port: 7777
s_nssai:
sst: 1


{{- toYaml . | nindent 8 }}
{{- end }}
nrf:
sbi:
- name: "{{ include "common.names.fullname" . }}-nrf"
Expand Down
2 changes: 2 additions & 0 deletions charts/open5gs/resources/config/pcrf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@ parameter:
{{- end }}

pcrf:
{{- if .Values.smf.enabled }}
freeDiameter: pcrf.conf
{{- end }}
2 changes: 2 additions & 0 deletions charts/open5gs/resources/config/smf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ parameter:
{{- end }}

smf:
{{- if .Values.pcrf.enabled }}
freeDiameter: smf.conf
{{- end }}
sbi:
dev: eth0
port: 7777
Expand Down
2 changes: 2 additions & 0 deletions charts/open5gs/templates/amf-configmap.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.amf.enabled -}}
apiVersion: v1
kind: ConfigMap
metadata:
Expand All @@ -7,3 +8,4 @@ metadata:
data:
amf.yaml: |
{{ tpl (.Files.Get "resources/config/amf.yaml") . | indent 4 }}
{{- end }}
2 changes: 2 additions & 0 deletions charts/open5gs/templates/amf-statefulset.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.amf.enabled -}}
apiVersion: apps/v1
kind: StatefulSet
metadata:
Expand Down Expand Up @@ -48,3 +49,4 @@ spec:
- name: amf-config
configMap:
name: {{ include "common.names.fullname" . }}-amf
{{- end }}
30 changes: 30 additions & 0 deletions charts/open5gs/templates/amf-svc.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.amf.enabled -}}
apiVersion: v1
kind: Service
metadata:
Expand All @@ -16,3 +17,32 @@ spec:
publishNotReadyAddresses: true
selector: {{- include "common.labels.matchLabels" . | nindent 4 }}
app.kubernetes.io/component: amf
---
{{- if .Values.amf.externalService.enabled }}
apiVersion: v1
kind: Service
metadata:
name: {{ include "common.names.fullname" . }}-amf-ext
labels: {{- include "common.labels.standard" . | nindent 4 }}
app.kubernetes.io/component: amf
spec:
type: {{ .Values.amf.externalService.type }}
sessionAffinity: {{ default "None" .Values.amf.externalService.sessionAffinity }}
{{- if and .Values.amf.externalService.clusterIP (eq .Values.amf.externalService.type "ClusterIP") }}
clusterIP: {{ .Values.amf.externalService.clusterIP }}
{{- end }}
{{- if and .Values.amf.externalService.loadBalancerIP (eq .Values.amf.externalService.type "LoadBalancer") }}
loadBalancerIP: {{ .Values.amf.externalService.loadBalancerIP }}
{{- end }}
{{- if and (eq .Values.amf.externalService.type "LoadBalancer") .Values.amf.externalService.externalTrafficPolicy }}
externalTrafficPolicy: {{ .Values.amf.externalService.externalTrafficPolicy }}
{{- end }}
ports:
- name: ngap
port: 38412
protocol: SCTP
publishNotReadyAddresses: true
selector: {{- include "common.labels.matchLabels" . | nindent 4 }}
app.kubernetes.io/component: amf
{{- end }}
{{- end }}
2 changes: 2 additions & 0 deletions charts/open5gs/templates/ausf-configmap.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.ausf.enabled -}}
apiVersion: v1
kind: ConfigMap
metadata:
Expand All @@ -7,3 +8,4 @@ metadata:
data:
ausf.yaml: |
{{ tpl (.Files.Get "resources/config/ausf.yaml") . | indent 4 }}
{{- end }}
2 changes: 2 additions & 0 deletions charts/open5gs/templates/ausf-statefulset.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.ausf.enabled -}}
apiVersion: apps/v1
kind: StatefulSet
metadata:
Expand Down Expand Up @@ -45,3 +46,4 @@ spec:
- name: ausf-config
configMap:
name: {{ include "common.names.fullname" . }}-ausf
{{- end }}
2 changes: 2 additions & 0 deletions charts/open5gs/templates/ausf-svc.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.ausf.enabled -}}
apiVersion: v1
kind: Service
metadata:
Expand All @@ -13,3 +14,4 @@ spec:
publishNotReadyAddresses: true
selector: {{- include "common.labels.matchLabels" . | nindent 4 }}
app.kubernetes.io/component: ausf
{{- end }}
11 changes: 11 additions & 0 deletions charts/open5gs/templates/bsf-configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{{- if .Values.bsf.enabled -}}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "common.names.fullname" . }}-bsf
labels: {{- include "common.labels.standard" . | nindent 4 }}
app.kubernetes.io/component: bsf
data:
bsf.yaml: |
{{ tpl (.Files.Get "resources/config/bsf.yaml") . | indent 4 }}
{{- end }}
43 changes: 43 additions & 0 deletions charts/open5gs/templates/bsf-statefulset.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{{- if .Values.bsf.enabled -}}
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: {{ include "common.names.fullname" . }}-bsf
labels: {{- include "common.labels.standard" . | nindent 4 }}
app.kubernetes.io/component: bsf
spec:
replicas: 1
serviceName: {{ include "common.names.fullname" . }}-bsf
selector:
matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }}
app.kubernetes.io/component: bsf
template:
metadata:
labels: {{- include "common.labels.standard" . | nindent 8 }}
app.kubernetes.io/component: bsf
spec:
{{ include "open5gs.imagePullSecrets" . | indent 6 }}
initContainers:
- name: wait-nrf
image: busybox:1.28
command: ['sh', '-c', 'set -x; sleep 20;']
containers:
- name: bsf
image: {{ template "open5gs.image" . }}
imagePullPolicy: {{ .Values.image.pullPolicy | quote }}
command: ["open5gs-bsfd"]
ports:
- name: sbi
containerPort: 7777
protocol: TCP
resources:
{{ toYaml .Values.bsf.resources | indent 10 }}
volumeMounts:
- name: bsf-config
mountPath: /opt/open5gs/etc/open5gs/bsf.yaml
subPath: "bsf.yaml"
volumes:
- name: bsf-config
configMap:
name: {{ include "common.names.fullname" . }}-bsf
{{- end }}
17 changes: 17 additions & 0 deletions charts/open5gs/templates/bsf-svc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{{- if .Values.bsf.enabled -}}
apiVersion: v1
kind: Service
metadata:
name: {{ include "common.names.fullname" . }}-bsf
labels: {{- include "common.labels.standard" . | nindent 4 }}
app.kubernetes.io/component: bsf
spec:
ports:
- name: sbi
port: 7777
protocol: TCP

publishNotReadyAddresses: true
selector: {{- include "common.labels.matchLabels" . | nindent 4 }}
app.kubernetes.io/component: bsf
{{- end }}
2 changes: 2 additions & 0 deletions charts/open5gs/templates/hss-configmap.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.hss.enabled -}}
apiVersion: v1
kind: ConfigMap
metadata:
Expand All @@ -7,3 +8,4 @@ metadata:
data:
hss.yaml: |
{{ tpl (.Files.Get "resources/config/hss.yaml") . | indent 4 }}
{{- end }}
4 changes: 3 additions & 1 deletion charts/open5gs/templates/hss-diameter-configmap.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.hss.enabled -}}
apiVersion: v1
kind: ConfigMap
metadata:
Expand All @@ -6,4 +7,5 @@ metadata:
app.kubernetes.io/component: hss
data:
diameter-hss.conf: |-
{{ tpl (.Files.Get "resources/config/diameter-hss.conf") . | indent 4 }}
{{ tpl (.Files.Get "resources/config/diameter-hss.conf") . | indent 4 }}
{{- end }}
2 changes: 2 additions & 0 deletions charts/open5gs/templates/hss-statefulset.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.hss.enabled -}}
apiVersion: apps/v1
kind: StatefulSet
metadata:
Expand Down Expand Up @@ -82,3 +83,4 @@ spec:
#- name: init-certs
# configMap:
# name: {{ include "common.names.fullname" . }}-init-certs
{{- end }}
2 changes: 2 additions & 0 deletions charts/open5gs/templates/hss-svc.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.hss.enabled -}}
apiVersion: v1
kind: Service
metadata:
Expand All @@ -15,3 +16,4 @@ spec:
publishNotReadyAddresses: true
selector: {{- include "common.labels.matchLabels" . | nindent 4 }}
app.kubernetes.io/component: hss
{{- end }}
2 changes: 2 additions & 0 deletions charts/open5gs/templates/init-certs-configmap.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.hss.enabled -}}
apiVersion: v1
kind: ConfigMap
metadata:
Expand All @@ -6,3 +7,4 @@ metadata:
data:
init-certs.sh: |
{{ tpl (.Files.Get "resources/config/init-certs.sh") . | indent 4 }}
{{- end }}
2 changes: 2 additions & 0 deletions charts/open5gs/templates/mme-configmap.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.mme.enabled -}}
apiVersion: v1
kind: ConfigMap
metadata:
Expand All @@ -7,3 +8,4 @@ metadata:
data:
mme.yaml: |
{{ tpl (.Files.Get "resources/config/mme.yaml") . | indent 4 }}
{{- end }}
4 changes: 3 additions & 1 deletion charts/open5gs/templates/mme-diameter-configmap.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.mme.enabled -}}
apiVersion: v1
kind: ConfigMap
metadata:
Expand All @@ -6,4 +7,5 @@ metadata:
app.kubernetes.io/component: mme
data:
diameter-mme.conf: |-
{{ tpl (.Files.Get "resources/config/diameter-mme.conf") . | indent 4 }}
{{ tpl (.Files.Get "resources/config/diameter-mme.conf") . | indent 4 }}
{{- end }}
2 changes: 2 additions & 0 deletions charts/open5gs/templates/mme-statefulset.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.mme.enabled -}}
apiVersion: apps/v1
kind: StatefulSet
metadata:
Expand Down Expand Up @@ -51,3 +52,4 @@ spec:
- name: mme-diameter-config
configMap:
name: {{ include "common.names.fullname" . }}-mme-diameter
{{- end }}
2 changes: 2 additions & 0 deletions charts/open5gs/templates/mme-svc.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.mme.enabled -}}
apiVersion: v1
kind: Service
metadata:
Expand Down Expand Up @@ -46,4 +47,5 @@ spec:
publishNotReadyAddresses: true
selector: {{- include "common.labels.matchLabels" . | nindent 4 }}
app.kubernetes.io/component: mme
{{- end }}
{{- end }}
2 changes: 2 additions & 0 deletions charts/open5gs/templates/nrf-configmap.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.nrf.enabled -}}
apiVersion: v1
kind: ConfigMap
metadata:
Expand All @@ -7,3 +8,4 @@ metadata:
data:
nrf.yaml: |
{{ tpl (.Files.Get "resources/config/nrf.yaml") . | indent 4 }}
{{- end }}
3 changes: 2 additions & 1 deletion charts/open5gs/templates/nrf-statefulset.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.nrf.enabled -}}
apiVersion: apps/v1
kind: StatefulSet
metadata:
Expand Down Expand Up @@ -45,4 +46,4 @@ spec:
- name: nrf-config
configMap:
name: {{ include "common.names.fullname" . }}-nrf

{{- end }}
Loading

0 comments on commit 75d76c8

Please sign in to comment.