From ce6293ff672ac82e72eda9dc38bb7ff90f06cab7 Mon Sep 17 00:00:00 2001 From: "naman.gupta" Date: Fri, 1 Dec 2023 19:56:43 +0530 Subject: [PATCH] Adding configmap and services for e2mgr. Adding configmap and services for e2mgr.` Change-Id: Ied115e643ea0b522dcdf41fc554959d0c624e211 Signed-off-by: naman.gupta --- .../internal/controller/getConfigmap.go | 108 ++++++++++++++++++++- .../internal/controller/getIngress.go | 31 +++++- .../internal/controller/getServices.go | 86 +++++++++++++++- 3 files changed, 221 insertions(+), 4 deletions(-) diff --git a/depRicKubernetesOperator/internal/controller/getConfigmap.go b/depRicKubernetesOperator/internal/controller/getConfigmap.go index 1eedf0b..1a4f4ba 100644 --- a/depRicKubernetesOperator/internal/controller/getConfigmap.go +++ b/depRicKubernetesOperator/internal/controller/getConfigmap.go @@ -263,6 +263,112 @@ func GetConfigMap() []*corev1.ConfigMap { Kind: "ConfigMap", }, } + + configMap13 := &corev1.ConfigMap{ + Data: map[string]string{ + "rmr_verbose": "0\n" + + "", + "router.txt": "newrt|start\n" + + "rte|1080|service-ricplt-e2mgr-rmr.ricplt:3801\n" + + "rte|1090|service-ricplt-e2term-rmr.ricplt:38000\n" + + "rte|1100|service-ricplt-e2term-rmr.ricplt:38000\n" + + "rte|1101|service-ricplt-e2term-rmr.ricplt:38000\n" + + "rte|1200|service-ricplt-rsm-rmr.ricplt:4801\n" + + "rte|1210|service-ricplt-rsm-rmr.ricplt:4801\n" + + "rte|1220|service-ricplt-rsm-rmr.ricplt:4801\n" + + "rte|10020|service-ricplt-e2mgr-rmr.ricplt:3801\n" + + "rte|10060|service-ricplt-e2term-rmr.ricplt:38000\n" + + "rte|10061|service-ricplt-e2mgr-rmr.ricplt:3801\n" + + "rte|10062|service-ricplt-e2mgr-rmr.ricplt:3801\n" + + "rte|10070|service-ricplt-e2term-rmr.ricplt:38000\n" + + "rte|10071|service-ricplt-e2term-rmr.ricplt:38000\n" + + "rte|10080|service-ricplt-e2mgr-rmr.ricplt:3801\n" + + "rte|10360|service-ricplt-e2term-rmr.ricplt:38000\n" + + "rte|10361|service-ricplt-e2mgr-rmr.ricplt:3801\n" + + "rte|10362|service-ricplt-e2mgr-rmr.ricplt:3801\n" + + "rte|10370|service-ricplt-e2mgr-rmr.ricplt:3801\n" + + "rte|10371|service-ricplt-e2term-rmr.ricplt:38000\n" + + "rte|12010|service-ricplt-e2term-rmr.ricplt:38000\n" + + "rte|12020|service-ricplt-e2term-rmr.ricplt:38000\n" + + "rte|20001|service-ricplt-a1mediator-rmr.ricplt:4562\n" + + "newrt|end", + }, + ObjectMeta: metav1.ObjectMeta{ + Name: "configmap-ricplt-e2mgr-router-configmap", + Namespace: "ricplt", + }, + TypeMeta: metav1.TypeMeta{ + APIVersion: "v1", + Kind: "ConfigMap", + }, + } + + configMap14 := &corev1.ConfigMap{ + Data: map[string]string{ + "configuration.yaml": "logging:\n" + + " logLevel: \"info\" \n" + + "http:\n" + + " port: 3800\n" + + "rmr:\n" + + " port: 3801\n" + + " maxMsgSize: 65536\n" + + "\n" + + "routingManager:\n" + + " baseUrl: \"http://service-ricplt-rtmgr-http:3800/ric/v1/handles/\"\n" + + "notificationResponseBuffer: 100\n" + + "bigRedButtonTimeoutSec: 5 \n" + + "maxConnectionAttempts: 3 \n" + + "maxRnibConnectionAttempts: 3 \n" + + "rnibRetryIntervalMs: 10\n" + + "keepAliveResponseTimeoutMs: 360000\n" + + "keepAliveDelayMs: 120000\n" + + "\n" + + "globalRicId:\n" + + " ricId: \"AACCE\"\n" + + " mcc: \"310\"\n" + + " mnc: \"411\"\n" + + " \n" + + "rnibWriter:\n" + + " stateChangeMessageChannel: \"RAN_CONNECTION_STATUS_CHANGE\"\n" + + " ranManipulationMessageChannel: \"RAN_MANIPULATION\"", + }, + ObjectMeta: metav1.ObjectMeta{ + Name: "configmap-ricplt-e2mgr-configuration-configmap", + Namespace: "ricplt", + }, + TypeMeta: metav1.TypeMeta{ + APIVersion: "v1", + Kind: "ConfigMap", + }, + } + + configMap15 := &corev1.ConfigMap{ + Data: map[string]string{ + "logcfg": "loglevel: 3", + }, + ObjectMeta: metav1.ObjectMeta{ + Name: "configmap-ricplt-e2mgr-loglevel-configmap", + Namespace: "ricplt", + }, + TypeMeta: metav1.TypeMeta{ + APIVersion: "v1", + Kind: "ConfigMap", + }, + } + + configMap16 := &corev1.ConfigMap{ + Data: map[string]string{ + "RMR_RTG_SVC": "4561", + "RMR_SRC_ID": "service-ricplt-e2mgr-rmr.ricplt", + }, + ObjectMeta: metav1.ObjectMeta{ + Name: "configmap-ricplt-e2mgr-env", + }, + TypeMeta: metav1.TypeMeta{ + APIVersion: "v1", + Kind: "ConfigMap", + }, + } - return []*corev1.ConfigMap{configMap1, configMap2, configMap3, configMap4, configMap5, configMap6,configMap7, configMap8, configMap9} + return []*corev1.ConfigMap{configMap1, configMap2, configMap3, configMap4, configMap5, configMap6,configMap7, configMap8, configMap9, configMap10, configMap11, configMap12, configMap13, configMap14, configMap15, configMap16} } diff --git a/depRicKubernetesOperator/internal/controller/getIngress.go b/depRicKubernetesOperator/internal/controller/getIngress.go index 101a430..a4d224c 100644 --- a/depRicKubernetesOperator/internal/controller/getIngress.go +++ b/depRicKubernetesOperator/internal/controller/getIngress.go @@ -62,6 +62,33 @@ func GetIngress() []*unstructured.Unstructured { }, }, } - - return []*unstructured.Unstructured{ingress1, ingress2} + + ingress3 := &unstructured.Unstructured{ + Object: map[string]interface{}{ + "apiVersion": "networking.k8s.io/v1beta1", + "kind": "Ingress", + "metadata": map[string]interface{}{ + "name": "ingress-ricplt-e2mgr", + }, + "spec": map[string]interface{}{ + "rules": []interface{}{ + map[string]interface{}{ + "http": map[string]interface{}{ + "paths": []interface{}{ + map[string]interface{}{ + "backend": map[string]interface{}{ + "serviceName": "service-ricplt-e2mgr-http", + "servicePort": 3800, + }, + "path": "/e2mgr", + }, + }, + }, + }, + }, + }, + }, + } + + return []*unstructured.Unstructured{ingress1, ingress2,ingress3} } \ No newline at end of file diff --git a/depRicKubernetesOperator/internal/controller/getServices.go b/depRicKubernetesOperator/internal/controller/getServices.go index 8fc4004..915463d 100644 --- a/depRicKubernetesOperator/internal/controller/getServices.go +++ b/depRicKubernetesOperator/internal/controller/getServices.go @@ -255,5 +255,89 @@ func GetService() []*corev1.Service { }, } - return []*corev1.Service{service1, service2, service3, service4,service5,service6 } + + service8 := &corev1.Service{ + ObjectMeta: metav1.ObjectMeta{ + Labels: map[string]string{ + "app": "ricplt-e2mgr", + "chart": "e2mgr-3.0.0", + "heritage": "Helm", + "release": "release-name", + }, + Name: "service-ricplt-e2mgr-http", + Namespace: "ricplt", + }, + Spec: corev1.ServiceSpec{ + Ports: []corev1.ServicePort{ + + corev1.ServicePort{ + TargetPort: intstr.IntOrString{ + StrVal: "http", + Type: intstr.Type(1), + }, + Name: "http", + Port: 3800, + Protocol: corev1.Protocol("TCP"), + }, + }, + PublishNotReadyAddresses: false, + Selector: map[string]string{ + "app": "ricplt-e2mgr", + "release": "release-name", + }, + Type: corev1.ServiceType("ClusterIP"), + }, + TypeMeta: metav1.TypeMeta{ + Kind: "Service", + APIVersion: "v1", + }, + } + + service9 := &corev1.Service{ + TypeMeta: metav1.TypeMeta{ + APIVersion: "v1", + Kind: "Service", + }, + ObjectMeta: metav1.ObjectMeta{ + Labels: map[string]string{ + "app": "ricplt-e2mgr", + "chart": "e2mgr-3.0.0", + "heritage": "Helm", + "release": "release-name", + }, + Name: "service-ricplt-e2mgr-rmr", + Namespace: "ricplt", + }, + Spec: corev1.ServiceSpec{ + Selector: map[string]string{ + "app": "ricplt-e2mgr", + "release": "release-name", + }, + Type: corev1.ServiceType("ClusterIP"), + Ports: []corev1.ServicePort{ + + corev1.ServicePort{ + Protocol: corev1.Protocol("TCP"), + TargetPort: intstr.IntOrString{ + StrVal: "rmrroute", + Type: intstr.Type(1), + }, + Name: "rmrroute", + Port: 4561, + }, + corev1.ServicePort{ + Name: "rmrdata", + Port: 3801, + Protocol: corev1.Protocol("TCP"), + TargetPort: intstr.IntOrString{ + StrVal: "rmrdata", + Type: intstr.Type(1), + }, + }, + }, + PublishNotReadyAddresses: false, + }, + } + + return []*corev1.Service{service1, service2, service3, service4,service5,service6,service8,service9 } } -- 2.16.6