diff --git a/Makefile b/Makefile index a4f1077..7f3751d 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ # To re-generate a bundle for another specific version without changing the standard setup, you can: # - use the VERSION as arg of the bundle target (e.g make bundle VERSION=0.0.2) # - use environment variables to overwrite this value (e.g export VERSION=0.0.2) -VERSION ?= 1.0.4 +VERSION ?= 1.0.5 # CHANNELS define the bundle channels used in the bundle. # Add a new line here if you would like to change its default config. (E.g CHANNELS = "candidate,fast,stable") @@ -227,7 +227,7 @@ GOLANGCI_LINT = $(LOCALBIN)/golangci-lint-$(GOLANGCI_LINT_VERSION) ## Tool Versions KUSTOMIZE_VERSION ?= v5.3.0 -CONTROLLER_TOOLS_VERSION ?= v0.14.0 +CONTROLLER_TOOLS_VERSION ?= v0.16.5 ENVTEST_VERSION ?= release-0.17 GOLANGCI_LINT_VERSION ?= v1.57.2 diff --git a/README.md b/README.md index d814363..7c4a575 100644 --- a/README.md +++ b/README.md @@ -110,7 +110,7 @@ A complete demo with UERANSIM is available at [this link](https://gradiant.githu 5. By default, components use the `ClusterIP` service type. To change the service type, set the `serviceType` field to `LoadBalancer` or `NodePort` in the CR for the desired component. This option is currently available for the `amf-ngap`, `smf-pfcp`, `upf-pfcp`, and `upf-gtpu` services. 6. The `open5gsImage` field in the CR specifies the version of the Open5GS images. If not specified, the operator defaults to version `docker.io/gradiant/open5gs:2.7.5`. 7. The `webuiImage` field in the CR specifies the version of the Open5GS WebUI image. If not specified, the operator defaults to version `docker.io/gradiant/open5gs-webui:2.7.5`. -8. The `mongoDBVersion` field in the CR specifies the version of the MongoDB image. If not specified, the operator defaults to version `bitnami/mongodb:8.0.6-debian-12-r0`. +8. The `mongoDBVersion` field in the CR specifies the version of the MongoDB image. If not specified, the operator defaults to version `bitnami/mongodb:latest`. 9. Components with metric support can generate a `ServiceMonitor` CR to expose metrics to Prometheus. However, ensure that the `ServiceMonitor` CRD is installed in the cluster; otherwise, the operator will encounter an error and fail to create the resource. To create a ServiceMonitor, set the `serviceMonitor` field to `true` in the CR for the desired component. 10. **UPF Deployment Annotations:** The annotations for the UPF Deployment are managed exclusively through the `upf.deploymentAnnotations` field in the CR. Any annotation not present in this field will be automatically reconciled by the operator (added or removed as needed), so manual changes to annotations will not persist unless reflected in the CR. 11. **UPF GTP-U Interface:** The GTP-U network interface used by the UPF is set via the `upf.gtpuDev` field in the CR (e.g., `gtpuDev: "eth0"`). By default, the UPF uses the `eth0` interface. diff --git a/api/v1/open5gs_types.go b/api/v1/open5gs_types.go index d55a834..9ee73c1 100644 --- a/api/v1/open5gs_types.go +++ b/api/v1/open5gs_types.go @@ -27,7 +27,7 @@ type Open5GSSpec struct { WebUI Open5GSFunction `json:"webui,omitempty" default:"{\"enabled\":false,\"serviceAccount\":false,\"metrics\":false,\"serviceMonitor\":false}"` WebUIImage string `json:"webuiImage,omitempty" default:"docker.io/gradiant/open5gs-webui:2.7.5"` Open5GSImage string `json:"open5gsImage,omitempty" default:"docker.io/gradiant/open5gs:2.7.5"` - MongoDBVersion string `json:"mongoDBVersion,omitempty" default:"bitnami/mongodb:8.0.6-debian-12-r0"` + MongoDBVersion string `json:"mongoDBVersion,omitempty" default:"bitnami/mongodb:latest"` Configuration Open5GSConfiguration `json:"configuration,omitempty" default:"{\"mcc\":\"999\",\"mnc\":\"70\",\"region\":\"2\",\"set\":\"1\",\"tac\":\"0001\",\"slices\":[]}"` } diff --git a/charts/open5gs-operator/Chart.yaml b/charts/open5gs-operator/Chart.yaml index c97990e..079112a 100644 --- a/charts/open5gs-operator/Chart.yaml +++ b/charts/open5gs-operator/Chart.yaml @@ -2,5 +2,5 @@ apiVersion: v2 name: open5gs-operator description: A Helm chart for Kubernetes type: application -version: 1.0.4 -appVersion: "1.0.4" +version: 1.0.5 +appVersion: "1.0.5" diff --git a/charts/open5gs-operator/values.yaml b/charts/open5gs-operator/values.yaml index 49485b1..9d3205f 100644 --- a/charts/open5gs-operator/values.yaml +++ b/charts/open5gs-operator/values.yaml @@ -9,7 +9,7 @@ controllerManager: - ALL image: repository: gradiant/open5gs-operator - tag: 1.0.4 + tag: 1.0.5 resources: requests: cpu: 100m diff --git a/config/crd/bases/net.gradiant.org_open5gses.yaml b/config/crd/bases/net.gradiant.org_open5gses.yaml index c6edaad..678cc69 100644 --- a/config/crd/bases/net.gradiant.org_open5gses.yaml +++ b/config/crd/bases/net.gradiant.org_open5gses.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.14.0 + controller-gen.kubebuilder.io/version: v0.16.5 name: open5gses.net.gradiant.org spec: group: net.gradiant.org diff --git a/config/crd/bases/net.gradiant.org_open5gsusers.yaml b/config/crd/bases/net.gradiant.org_open5gsusers.yaml index 14409a1..90d39c8 100644 --- a/config/crd/bases/net.gradiant.org_open5gsusers.yaml +++ b/config/crd/bases/net.gradiant.org_open5gsusers.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.14.0 + controller-gen.kubebuilder.io/version: v0.16.5 name: open5gsusers.net.gradiant.org spec: group: net.gradiant.org diff --git a/config/manager/kustomization.yaml b/config/manager/kustomization.yaml index 1aa8145..d246d33 100644 --- a/config/manager/kustomization.yaml +++ b/config/manager/kustomization.yaml @@ -5,4 +5,4 @@ kind: Kustomization images: - name: controller newName: gradiant/open5gs-operator - newTag: 1.0.4 + newTag: 1.0.5 diff --git a/config/rbac/role.yaml b/config/rbac/role.yaml index 7f614d4..fc90a8f 100644 --- a/config/rbac/role.yaml +++ b/config/rbac/role.yaml @@ -4,58 +4,14 @@ kind: ClusterRole metadata: name: manager-role rules: -- apiGroups: - - apps - resources: - - deployments - verbs: - - create - - delete - - get - - list - - patch - - update - - watch - apiGroups: - "" resources: - configmaps - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - "" - resources: - persistentvolumeclaims - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - "" - resources: - persistentvolumes - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - "" - resources: - serviceaccounts + - services verbs: - create - delete @@ -65,9 +21,9 @@ rules: - update - watch - apiGroups: - - "" + - apps resources: - - services + - deployments verbs: - create - delete @@ -92,6 +48,9 @@ rules: - net.gradiant.org resources: - open5gses + - open5gsusers + - open5gsusers/finalizers + - open5gsusers/status verbs: - create - delete @@ -114,39 +73,3 @@ rules: - get - patch - update -- apiGroups: - - net.gradiant.org - resources: - - open5gsusers - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - net.gradiant.org - resources: - - open5gsusers/finalizers - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - net.gradiant.org - resources: - - open5gsusers/status - verbs: - - create - - delete - - get - - list - - patch - - update - - watch diff --git a/config/samples/net_v1_open5gs.yaml b/config/samples/net_v1_open5gs.yaml index 808a3a6..1d4575c 100644 --- a/config/samples/net_v1_open5gs.yaml +++ b/config/samples/net_v1_open5gs.yaml @@ -9,7 +9,7 @@ metadata: spec: open5gsImage: "docker.io/gradiant/open5gs:2.7.5" webuiImage: "docker.io/gradiant/open5gs-webui:2.7.5" - mongoDBVersion: "bitnami/mongodb:8.0.6-debian-12-r0" + mongoDBVersion: "bitnami/mongodb:latest" amf: enabled: true serviceAccount: true diff --git a/internal/controller/open5gs_controller.go b/internal/controller/open5gs_controller.go index 77330c8..102a4a1 100644 --- a/internal/controller/open5gs_controller.go +++ b/internal/controller/open5gs_controller.go @@ -819,7 +819,7 @@ func (r *Open5GSReconciler) reconcileWebUI(ctx context.Context, req ctrl.Request serviceAccount = CreateServiceAccount(req.Namespace, open5gs.Name, componentName) serviceAccountName = serviceAccount.Name } - deployment := CreateWebUIDeployment(req.Namespace, open5gs.Name, open5gs.Spec.WebUIImage, envVars, serviceAccountName) + deployment := CreateWebUIDeployment(req.Namespace, open5gs.Name, open5gs.Spec.WebUIImage, envVars, serviceAccountName, open5gs.Spec.MongoDBVersion) return r.reconcileComponent(ctx, open5gs, componentName, logger, configMap, deployment, services, serviceAccount) } @@ -1309,7 +1309,7 @@ func setDefaultValues(open5gs *netv1.Open5GS) { open5gs.Spec.WebUIImage = "docker.io/gradiant/open5gs-webui:2.7.5" } if open5gs.Spec.MongoDBVersion == "" { - open5gs.Spec.MongoDBVersion = "bitnami/mongodb:8.0.6-debian-12-r0" + open5gs.Spec.MongoDBVersion = "bitnami/mongodb:latest" } if open5gs.Spec.AMF.ServiceAccount == nil { defaultAMFServiceAccount := false diff --git a/internal/controller/open5gs_resources.go b/internal/controller/open5gs_resources.go index da77970..52e3ce0 100644 --- a/internal/controller/open5gs_resources.go +++ b/internal/controller/open5gs_resources.go @@ -832,14 +832,14 @@ if ( cursor.count() == 0 ) { } EOF -mongo $DB_URI /tmp/account.js +mongosh $DB_URI /tmp/account.js rm -f /tmp/account.js `, }, } } -func CreateWebUIDeployment(namespace, open5gsName, image string, envVars []corev1.EnvVar, serviceAccountName string) *appsv1.Deployment { +func CreateWebUIDeployment(namespace, open5gsName, image string, envVars []corev1.EnvVar, serviceAccountName string, mongoDBVersion string) *appsv1.Deployment { if serviceAccountName == "" { serviceAccountName = "default" } @@ -920,7 +920,7 @@ func CreateWebUIDeployment(namespace, open5gsName, image string, envVars []corev InitContainers: []corev1.Container{ { Name: "init", - Image: "bitnami/mongodb:4.4.1-debian-10-r39", + Image: mongoDBVersion, Command: []string{ "/bin/bash", "/add_admin.sh", diff --git a/test/suite_1/samples/net_v1_open5gs-test-1-1.yaml b/test/suite_1/samples/net_v1_open5gs-test-1-1.yaml index a76f98c..09ee4e9 100644 --- a/test/suite_1/samples/net_v1_open5gs-test-1-1.yaml +++ b/test/suite_1/samples/net_v1_open5gs-test-1-1.yaml @@ -9,7 +9,7 @@ metadata: spec: open5gsImage: "docker.io/gradiant/open5gs:2.7.5" webuiImage: "docker.io/gradiant/open5gs-webui:2.7.5" - mongoDBVersion: "bitnami/mongodb:8.0.6-debian-12-r0" + mongoDBVersion: "bitnami/mongodb:latest" amf: enabled: true serviceAccount: true diff --git a/test/suite_1/samples/net_v1_open5gs-test-1-2.yaml b/test/suite_1/samples/net_v1_open5gs-test-1-2.yaml index 536a2ca..d623c98 100644 --- a/test/suite_1/samples/net_v1_open5gs-test-1-2.yaml +++ b/test/suite_1/samples/net_v1_open5gs-test-1-2.yaml @@ -9,7 +9,7 @@ metadata: spec: open5gsImage: "docker.io/gradiant/open5gs:2.7.5" webuiImage: "docker.io/gradiant/open5gs-webui:2.7.5" - mongoDBVersion: "bitnami/mongodb:8.0.6-debian-12-r0" + mongoDBVersion: "bitnami/mongodb:latest" amf: enabled: true serviceAccount: true diff --git a/test/suite_1/samples/net_v1_open5gs-test-1-3.yaml b/test/suite_1/samples/net_v1_open5gs-test-1-3.yaml index ca86327..69bbbb3 100644 --- a/test/suite_1/samples/net_v1_open5gs-test-1-3.yaml +++ b/test/suite_1/samples/net_v1_open5gs-test-1-3.yaml @@ -9,7 +9,7 @@ metadata: spec: open5gsImage: "docker.io/gradiant/open5gs:2.7.5" webuiImage: "docker.io/gradiant/open5gs-webui:2.7.5" - mongoDBVersion: "bitnami/mongodb:8.0.6-debian-12-r0" + mongoDBVersion: "bitnami/mongodb:latest" amf: enabled: true serviceAccount: true diff --git a/test/suite_1/samples/net_v1_open5gs-test-1-4.yaml b/test/suite_1/samples/net_v1_open5gs-test-1-4.yaml index 2a00bb6..ede9965 100644 --- a/test/suite_1/samples/net_v1_open5gs-test-1-4.yaml +++ b/test/suite_1/samples/net_v1_open5gs-test-1-4.yaml @@ -9,7 +9,7 @@ metadata: spec: open5gsImage: "docker.io/gradiant/open5gs:2.7.5" webuiImage: "docker.io/gradiant/open5gs-webui:2.7.5" - mongoDBVersion: "bitnami/mongodb:8.0.6-debian-12-r0" + mongoDBVersion: "bitnami/mongodb:latest" amf: enabled: true serviceAccount: true diff --git a/test/suite_1/samples/net_v1_open5gs-test-1-5.yaml b/test/suite_1/samples/net_v1_open5gs-test-1-5.yaml index 1c4e440..496cadd 100644 --- a/test/suite_1/samples/net_v1_open5gs-test-1-5.yaml +++ b/test/suite_1/samples/net_v1_open5gs-test-1-5.yaml @@ -9,7 +9,7 @@ metadata: spec: open5gsImage: "docker.io/gradiant/open5gs:2.7.5" webuiImage: "docker.io/gradiant/open5gs-webui:2.7.5" - mongoDBVersion: "bitnami/mongodb:8.0.6-debian-12-r0" + mongoDBVersion: "bitnami/mongodb:latest" amf: enabled: true serviceAccount: true