Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions api/v1/open5gs_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ type Open5GSFunction struct {
Service []Open5GSService `json:"service,omitempty" default:"{\"name\":\"\",\"port\":0,\"serviceType\":\"\"}"`
GTPUDev string `json:"gtpuDev,omitempty" default:"eth0"`
DeploymentAnnotations map[string]string `json:"deploymentAnnotations,omitempty"`
// Unprivileged runs the UPF without privileged:true/root (UPF only).
Unprivileged *bool `json:"unprivileged,omitempty" default:"false"`
Comment on lines +56 to +57
}

type Open5GSService struct {
Expand Down
5 changes: 5 additions & 0 deletions api/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

52 changes: 52 additions & 0 deletions charts/open5gs-operator/templates/open5gs-crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ spec:
type: boolean
serviceMonitor:
type: boolean
unprivileged:
description: Unprivileged runs the UPF without privileged:true/root
(UPF only).
type: boolean
Comment on lines +68 to +71
type: object
ausf:
properties:
Expand All @@ -91,6 +95,10 @@ spec:
type: boolean
serviceMonitor:
type: boolean
unprivileged:
description: Unprivileged runs the UPF without privileged:true/root
(UPF only).
type: boolean
type: object
bsf:
properties:
Expand All @@ -117,6 +125,10 @@ spec:
type: boolean
serviceMonitor:
type: boolean
unprivileged:
description: Unprivileged runs the UPF without privileged:true/root
(UPF only).
type: boolean
type: object
configuration:
properties:
Expand Down Expand Up @@ -165,6 +177,10 @@ spec:
type: boolean
serviceMonitor:
type: boolean
unprivileged:
description: Unprivileged runs the UPF without privileged:true/root
(UPF only).
type: boolean
type: object
mongoDBVersion:
type: string
Expand Down Expand Up @@ -193,6 +209,10 @@ spec:
type: boolean
serviceMonitor:
type: boolean
unprivileged:
description: Unprivileged runs the UPF without privileged:true/root
(UPF only).
type: boolean
type: object
nssf:
properties:
Expand All @@ -219,6 +239,10 @@ spec:
type: boolean
serviceMonitor:
type: boolean
unprivileged:
description: Unprivileged runs the UPF without privileged:true/root
(UPF only).
type: boolean
type: object
open5gsImage:
type: string
Expand Down Expand Up @@ -247,6 +271,10 @@ spec:
type: boolean
serviceMonitor:
type: boolean
unprivileged:
description: Unprivileged runs the UPF without privileged:true/root
(UPF only).
type: boolean
type: object
scp:
properties:
Expand All @@ -273,6 +301,10 @@ spec:
type: boolean
serviceMonitor:
type: boolean
unprivileged:
description: Unprivileged runs the UPF without privileged:true/root
(UPF only).
type: boolean
type: object
smf:
properties:
Expand All @@ -299,6 +331,10 @@ spec:
type: boolean
serviceMonitor:
type: boolean
unprivileged:
description: Unprivileged runs the UPF without privileged:true/root
(UPF only).
type: boolean
type: object
udm:
properties:
Expand All @@ -325,6 +361,10 @@ spec:
type: boolean
serviceMonitor:
type: boolean
unprivileged:
description: Unprivileged runs the UPF without privileged:true/root
(UPF only).
type: boolean
type: object
udr:
properties:
Expand All @@ -351,6 +391,10 @@ spec:
type: boolean
serviceMonitor:
type: boolean
unprivileged:
description: Unprivileged runs the UPF without privileged:true/root
(UPF only).
type: boolean
type: object
upf:
properties:
Expand All @@ -377,6 +421,10 @@ spec:
type: boolean
serviceMonitor:
type: boolean
unprivileged:
description: Unprivileged runs the UPF without privileged:true/root
(UPF only).
type: boolean
type: object
webui:
properties:
Expand All @@ -403,6 +451,10 @@ spec:
type: boolean
serviceMonitor:
type: boolean
unprivileged:
description: Unprivileged runs the UPF without privileged:true/root
(UPF only).
type: boolean
type: object
webuiImage:
type: string
Expand Down
52 changes: 52 additions & 0 deletions config/crd/bases/net.gradiant.org_open5gses.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ spec:
type: boolean
serviceMonitor:
type: boolean
unprivileged:
description: Unprivileged runs the UPF without privileged:true/root
(UPF only).
type: boolean
Comment on lines +67 to +70
type: object
ausf:
properties:
Expand All @@ -90,6 +94,10 @@ spec:
type: boolean
serviceMonitor:
type: boolean
unprivileged:
description: Unprivileged runs the UPF without privileged:true/root
(UPF only).
type: boolean
type: object
bsf:
properties:
Expand All @@ -116,6 +124,10 @@ spec:
type: boolean
serviceMonitor:
type: boolean
unprivileged:
description: Unprivileged runs the UPF without privileged:true/root
(UPF only).
type: boolean
type: object
configuration:
properties:
Expand Down Expand Up @@ -164,6 +176,10 @@ spec:
type: boolean
serviceMonitor:
type: boolean
unprivileged:
description: Unprivileged runs the UPF without privileged:true/root
(UPF only).
type: boolean
type: object
mongoDBVersion:
type: string
Expand Down Expand Up @@ -192,6 +208,10 @@ spec:
type: boolean
serviceMonitor:
type: boolean
unprivileged:
description: Unprivileged runs the UPF without privileged:true/root
(UPF only).
type: boolean
type: object
nssf:
properties:
Expand All @@ -218,6 +238,10 @@ spec:
type: boolean
serviceMonitor:
type: boolean
unprivileged:
description: Unprivileged runs the UPF without privileged:true/root
(UPF only).
type: boolean
type: object
open5gsImage:
type: string
Expand Down Expand Up @@ -246,6 +270,10 @@ spec:
type: boolean
serviceMonitor:
type: boolean
unprivileged:
description: Unprivileged runs the UPF without privileged:true/root
(UPF only).
type: boolean
type: object
scp:
properties:
Expand All @@ -272,6 +300,10 @@ spec:
type: boolean
serviceMonitor:
type: boolean
unprivileged:
description: Unprivileged runs the UPF without privileged:true/root
(UPF only).
type: boolean
type: object
smf:
properties:
Expand All @@ -298,6 +330,10 @@ spec:
type: boolean
serviceMonitor:
type: boolean
unprivileged:
description: Unprivileged runs the UPF without privileged:true/root
(UPF only).
type: boolean
type: object
udm:
properties:
Expand All @@ -324,6 +360,10 @@ spec:
type: boolean
serviceMonitor:
type: boolean
unprivileged:
description: Unprivileged runs the UPF without privileged:true/root
(UPF only).
type: boolean
type: object
udr:
properties:
Expand All @@ -350,6 +390,10 @@ spec:
type: boolean
serviceMonitor:
type: boolean
unprivileged:
description: Unprivileged runs the UPF without privileged:true/root
(UPF only).
type: boolean
type: object
upf:
properties:
Expand All @@ -376,6 +420,10 @@ spec:
type: boolean
serviceMonitor:
type: boolean
unprivileged:
description: Unprivileged runs the UPF without privileged:true/root
(UPF only).
type: boolean
type: object
webui:
properties:
Expand All @@ -402,6 +450,10 @@ spec:
type: boolean
serviceMonitor:
type: boolean
unprivileged:
description: Unprivileged runs the UPF without privileged:true/root
(UPF only).
type: boolean
type: object
webuiImage:
type: string
Expand Down
9 changes: 7 additions & 2 deletions internal/controller/open5gs_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -755,8 +755,9 @@ func (r *Open5GSReconciler) reconcileUDR(ctx context.Context, req ctrl.Request,
func (r *Open5GSReconciler) reconcileUPF(ctx context.Context, req ctrl.Request, open5gs *netv1.Open5GS, logger logr.Logger) error {
componentName := "UPF"
gtpuDev := open5gs.Spec.UPF.GTPUDev
unprivileged := open5gs.Spec.UPF.Unprivileged != nil && *open5gs.Spec.UPF.Unprivileged
configMap := CreateUPFConfigMap(req.Namespace, open5gs.Name, open5gs.Spec.Configuration, *open5gs.Spec.UPF.Metrics, gtpuDev)
entrypointConfigMap := CreateUPFEntrypointConfigMap(req.Namespace, open5gs.Name)
entrypointConfigMap := CreateUPFEntrypointConfigMap(req.Namespace, open5gs.Name, unprivileged)

envVars := []corev1.EnvVar{}
pfcpService := netv1.Open5GSService{Name: "pfcp"}
Expand Down Expand Up @@ -795,7 +796,7 @@ func (r *Open5GSReconciler) reconcileUPF(ctx context.Context, req ctrl.Request,
serviceAccount = CreateServiceAccount(req.Namespace, open5gs.Name, componentName)
serviceAccountName = serviceAccount.Name
}
deployment := CreateUPFDeployment(req.Namespace, open5gs.Name, open5gs.Spec.Open5GSImage, envVars, *open5gs.Spec.UPF.Metrics, serviceAccountName, open5gs.Spec.UPF.DeploymentAnnotations)
deployment := CreateUPFDeployment(req.Namespace, open5gs.Name, open5gs.Spec.Open5GSImage, envVars, *open5gs.Spec.UPF.Metrics, serviceAccountName, open5gs.Spec.UPF.DeploymentAnnotations, unprivileged)
return r.reconcileComponent(ctx, open5gs, componentName, logger, configMap, deployment, services, serviceMonitor, serviceAccount)
}

Expand Down Expand Up @@ -1271,6 +1272,10 @@ func setDefaultValues(open5gs *netv1.Open5GS) {
defaultUPFServiceMonitor := true
open5gs.Spec.UPF.ServiceMonitor = &defaultUPFServiceMonitor
}
if open5gs.Spec.UPF.Unprivileged == nil {
defaultUPFUnprivileged := false
open5gs.Spec.UPF.Unprivileged = &defaultUPFUnprivileged
}
if open5gs.Spec.WebUI.Enabled == nil {
defaultWebUIEnabled := false
open5gs.Spec.WebUI.Enabled = &defaultWebUIEnabled
Expand Down
Loading
Loading