Skip to content

Commit

Permalink
Merge pull request #51 from Gradiant/ueransim-gnb-update
Browse files Browse the repository at this point in the history
split gnb - ues deployments in ueransim-gnb
  • Loading branch information
cgiraldo authored Jun 14, 2022
2 parents f350b51 + a3dc65f commit 8b36f80
Show file tree
Hide file tree
Showing 6 changed files with 101 additions and 77 deletions.
4 changes: 2 additions & 2 deletions charts/ueransim-gnb/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ dependencies:
tags:
- bitnami-common
version: 1.x.x
description: ueransim for 5G RAN simulation
description: ueransim gNodeB for 5G RAN simulation
engine: gotpl
home: https://github.com/aligungr/UERANSIM
icon: https://github.com/aligungr/UERANSIM/raw/master/.github/logo.png
Expand All @@ -24,4 +24,4 @@ maintainers:
name: ueransim-gnb
sources:
- https://github.com/aligungr/UERANSIM
version: 0.1.0
version: 0.2.0
4 changes: 2 additions & 2 deletions charts/ueransim-gnb/templates/NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ ueransim-gnb successfully installed!
Check gnodeb log with:

```
kubectl -n {{ .Release.Namespace }} logs svc/{{ include "common.names.fullname" . }} -c gnodeb
kubectl -n {{ .Release.Namespace }} logs deployment/{{ include "common.names.fullname" . }}
```

---
Expand All @@ -13,7 +13,7 @@ kubectl -n {{ .Release.Namespace }} logs svc/{{ include "common.names.fullname"
You have also deployed {{ .Values.ues.count }} ues. You can enter ues terminal with:

```
kubectl -n {{ .Release.Namespace }} exec -ti svc/{{ include "common.names.fullname" . }} -c ues -- /bin/bash
kubectl -n {{ .Release.Namespace }} exec -ti deployment/{{ include "common.names.fullname" . }}-ues -- /bin/bash
```
There is a tun interface for each ue.
You can bind your application to the interface to test ue connectivity.
Expand Down
4 changes: 2 additions & 2 deletions charts/ueransim-gnb/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
{{/*
Return the proper ueransim image name
*/}}
{{- define "ueransim-gnb.image" -}}
{{- define "ueransim.image" -}}
{{ include "common.images.image" (dict "imageRoot" .Values.image "global" .Values.global) }}
{{- end -}}

{{/*
Return the proper Docker Image Registry Secret Names
*/}}
{{- define "ueransim-gnb.imagePullSecrets" -}}
{{- define "ueransim.imagePullSecrets" -}}
{{- include "common.images.pullSecrets" (dict "images" (list .Values.image) "global" .Values.global) -}}
{{- end -}}
33 changes: 5 additions & 28 deletions charts/ueransim-gnb/templates/gnb-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ metadata:
name: {{ template "common.names.fullname" . }}
namespace: {{ .Release.Namespace | quote }}
labels: {{- include "common.labels.standard" . | nindent 4 }}
app.kubernetes.io/component: gnb
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
Expand All @@ -13,17 +14,19 @@ metadata:
spec:
selector:
matchLabels: {{ include "common.labels.matchLabels" . | nindent 6 }}
app.kubernetes.io/component: gnb
template:
metadata:
{{- if .Values.podAnnotations }}
annotations: {{- include "common.tplvalues.render" (dict "value" .Values.podAnnotations "context" $) | nindent 8 }}
{{- end }}
labels: {{- include "common.labels.standard" . | nindent 8 }}
app.kubernetes.io/component: gnb
{{- if .Values.podLabels }}
{{- include "common.tplvalues.render" (dict "value" .Values.podLabels "context" $) | nindent 8 }}
{{- end }}
spec:
{{- include "ueransim-gnb.imagePullSecrets" . | nindent 6 }}
{{- include "ueransim.imagePullSecrets" . | nindent 6 }}
{{- if .Values.affinity }}
affinity: {{- include "common.tplvalues.render" ( dict "value" .Values.affinity "context" $) | nindent 8 }}
{{- end }}
Expand All @@ -38,7 +41,7 @@ spec:
{{- end }}
containers:
- name: gnodeb
image: {{ template "ueransim-gnb.image" . }}
image: {{ template "ueransim.image" . }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
{{- if .Values.containerSecurityContext.enabled }}
securityContext: {{- omit .Values.containerSecurityContext "enabled" | toYaml | nindent 12 }}
Expand Down Expand Up @@ -66,39 +69,13 @@ spec:
value: {{ .Values.interfaces.n3.dev }}
- name: RADIO_IFACE
value: {{ .Values.interfaces.radio.dev }}

{{- if .Values.resources }}
resources: {{- toYaml .Values.resources | nindent 12 }}
{{- end }}
volumeMounts:
- name: config
mountPath: /etc/ueransim/gnb.yaml
subPath: "gnb.yaml"
{{- if .Values.ues.enabled }}
- name: ues
image: {{ template "ueransim-gnb.image" . }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
securityContext:
privileged: true
capabilities:
add: ["NET_ADMIN"]
args:
- ue
- -n
- {{ .Values.ues.count | quote }}
env:
- name: GNB_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
{{- if .Values.resources }}
resources: {{- toYaml .Values.resources | nindent 12 }}
{{- end }}
volumeMounts:
- name: config-ues
mountPath: /etc/ueransim/ue.yaml
subPath: "ue.yaml"
{{- end }}
volumes:
- name: config
configMap:
Expand Down
69 changes: 69 additions & 0 deletions charts/ueransim-gnb/templates/ues-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
{{- if .Values.ues.enabled }}
apiVersion: {{ include "common.capabilities.deployment.apiVersion" . }}
kind: Deployment
metadata:
name: {{ template "common.names.fullname" . }}-ues
namespace: {{ .Release.Namespace | quote }}
labels: {{- include "common.labels.standard" . | nindent 4 }}
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
app.kubernetes.io/component: ues
{{- if .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
spec:
selector:
matchLabels: {{ include "common.labels.matchLabels" . | nindent 6 }}
app.kubernetes.io/component: ues
template:
metadata:
{{- if .Values.ues.podAnnotations }}
annotations: {{- include "common.tplvalues.render" (dict "value" .Values.ues.podAnnotations "context" $) | nindent 8 }}
{{- end }}
labels: {{- include "common.labels.standard" . | nindent 8 }}
{{- if .Values.ues.podLabels }}
{{- include "common.tplvalues.render" (dict "value" .Values.ues.podLabels "context" $) | nindent 8 }}
{{- end }}
app.kubernetes.io/component: ues
spec:
{{- include "ueransim.imagePullSecrets" . | nindent 6 }}
{{- if .Values.ues.affinity }}
affinity: {{- include "common.tplvalues.render" ( dict "value" .Values.ues.affinity "context" $) | nindent 8 }}
{{- end }}
{{- if .Values.ues.nodeSelector }}
nodeSelector: {{- include "common.tplvalues.render" ( dict "value" .Values.ues.nodeSelector "context" $) | nindent 8 }}
{{- end }}
{{- if .Values.ues.tolerations }}
tolerations: {{- include "common.tplvalues.render" (dict "value" .Values.ues.tolerations "context" .) | nindent 8 }}
{{- end }}
{{- if .Values.ues.podSecurityContext.enabled }}
securityContext: {{- omit .Values.ues.podSecurityContext "enabled" | toYaml | nindent 8 }}
{{- end }}
containers:
- name: ues
image: {{ template "ueransim.image" . }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
securityContext:
privileged: true
capabilities:
add: ["NET_ADMIN"]
env:
- name: GNB_HOSTNAME
value: {{ template "common.names.fullname" . }}
args:
- ue
- -n
- {{ .Values.ues.count | quote }}
{{- if .Values.ues.resources }}
resources: {{- toYaml .Values.ues.resources | nindent 12 }}
{{- end }}
volumeMounts:
- name: config
mountPath: /etc/ueransim/ue.yaml
subPath: "ue.yaml"
volumes:
- name: config
configMap:
name: {{ include "common.names.fullname" . }}-ues
{{- end }}
64 changes: 21 additions & 43 deletions charts/ueransim-gnb/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,59 +78,37 @@ mnc: '70'
sst: 1
sd: "0xffffff"
tac: '0001'
ues:
enabled: true
count: 4
initialMSISDN: '0000000001'
key: 465B5CE8B199B49FAA5F0A2EE238A6BC
op: E8ED289DEBA952E4283B54E88E6183CA
opType: OPC
apn: internet

## resource requests and limits
## ref: http://kubernetes.io/docs/user-guide/compute-resources/
## resources.limits the resources limits for the containers
## resources.requests the requested resources for the containers
##
resources:
limits: {}
requests: {}
## Configure Pods Security Context
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod
## @param podsecuritycontext.enabled enabled pods' Security Context
## @param podsecuritycontext.fsgroup set pod's Security Context fsGroup
##
podSecurityContext:
enabled: false
# fsGroup: 1001
## Configure Container Security Context
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod
## @param containersecuritycontext.enabled enabled containers' Security Context
## @param containersecuritycontext.runasuser set containers' Security Context runAsUser
##
containerSecurityContext:
enabled: false
# runAsUser: 1001

## @param podlabels extra labels for pods
## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/
##
podLabels: {}
## @param podannotations annotations for pods
## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/
##
podAnnotations: {}

## @param .affinity affinity for pods assignment
## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
## NOTE: `podaffinitypreset`, and `nodeAffinityPreset` will be ignored when it's set
##
affinity: {}
## @param nodeselector node labels for pods assignment
## ref: https://kubernetes.io/docs/user-guide/node-selection/
##
nodeSelector: {}
## @param tolerations tolerations pods assignment
## ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
##
tolerations: []

ues:
enabled: false
count: 1
initialMSISDN: '0000000001'
key: 465B5CE8B199B49FAA5F0A2EE238A6BC
op: E8ED289DEBA952E4283B54E88E6183CA
opType: OPC
apn: internet
resources:
limits: {}
requests: {}
podSecurityContext:
enabled: false
containerSecurityContext:
enabled: false
podLabels: {}
podAnnotations: {}
affinity: {}
nodeSelector: {}
tolerations: []

0 comments on commit 8b36f80

Please sign in to comment.