From: naman.gupta Date: Fri, 1 Dec 2023 14:38:07 +0000 (+0530) Subject: Adding Configmap for e2term X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=4bbb21149e88a52250390706de44600a4684022b;p=ric-plt%2Fric-dep.git Adding Configmap for e2term Adding Configmap for e2term Change-Id: I2084d99897dbf1934c0fe98342f45d66bc59ec49 Signed-off-by: naman.gupta --- diff --git a/depRicKubernetesOperator/internal/controller/getConfigmap.go b/depRicKubernetesOperator/internal/controller/getConfigmap.go index 1a4f4ba..af56cd3 100644 --- a/depRicKubernetesOperator/internal/controller/getConfigmap.go +++ b/depRicKubernetesOperator/internal/controller/getConfigmap.go @@ -369,6 +369,88 @@ func GetConfigMap() []*corev1.ConfigMap { Kind: "ConfigMap", }, } - - return []*corev1.ConfigMap{configMap1, configMap2, configMap3, configMap4, configMap5, configMap6,configMap7, configMap8, configMap9, configMap10, configMap11, configMap12, configMap13, configMap14, configMap15, configMap16} + + configMap17 := &corev1.ConfigMap{ + Data: map[string]string{ + "log-level": "log-level: 3", + }, + ObjectMeta: metav1.ObjectMeta{ + Name: "configmap-ricplt-e2term-loglevel-configmap", + Namespace: "ricplt", + }, + TypeMeta: metav1.TypeMeta{ + APIVersion: "v1", + Kind: "ConfigMap", + }, + } + + configMap18 := &corev1.ConfigMap{ + ObjectMeta: metav1.ObjectMeta{ + Name: "configmap-ricplt-e2term-router-configmap", + Namespace: "ricplt", + }, + TypeMeta: metav1.TypeMeta{ + APIVersion: "v1", + Kind: "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-alpha.ricplt:38000\n" + + "rte|1100|service-ricplt-e2mgr-rmr.ricplt:3801\n" + + "rte|10020|service-ricplt-e2mgr-rmr.ricplt:3801\n" + + "rte|10060|service-ricplt-e2term-rmr-alpha.ricplt:38000\n" + + "rte|10061|service-ricplt-e2mgr-rmr.ricplt:3801\n" + + "rte|10062|service-ricplt-e2mgr-rmr.ricplt:3801\n" + + "rte|10030|service-ricplt-e2mgr-rmr.ricplt:3801\n" + + "rte|10070|service-ricplt-e2mgr-rmr.ricplt:3801\n" + + "rte|10071|service-ricplt-e2mgr-rmr.ricplt:3801\n" + + "rte|10080|service-ricplt-e2mgr-rmr.ricplt:3801\n" + + "rte|10091|service-ricplt-rsm-rmr.ricplt:4801\n" + + "rte|10092|service-ricplt-rsm-rmr.ricplt:4801\n" + + "rte|10360|service-ricplt-e2term-rmr-alpha.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-alpha.ricplt:38000\n" + + "rte|12010|service-ricplt-e2term-rmr-alpha.ricplt:38000\n" + + "rte|12020|service-ricplt-e2term-rmr-alpha.ricplt:38000\n" + + "rte|20001|service-ricplt-a1mediator-rmr.ricplt:4562\n" + + "rte|12011|service-ricxapp-ueec-rmr.ricxapp:4560;service-admission-ctrl-xapp-rmr.ricxapp:4560\n" + + "rte|12050|service-ricxapp-ueec-rmr.ricxapp:4560;service-admission-ctrl-xapp-rmr.ricxapp:4560\n" + + "rte|12012|service-ricxapp-ueec-rmr.ricxapp:4560;service-admission-ctrl-xapp-rmr.ricxapp:4560\n" + + "rte|12021|service-ricxapp-ueec-rmr.ricxapp:4560;service-admission-ctrl-xapp-rmr.ricxapp:4560\n" + + "rte|12022|service-ricxapp-ueec-rmr.ricxapp:4560;service-admission-ctrl-xapp-rmr.ricxapp:4560\n" + + "rte|12041|service-ricxapp-ueec-rmr.ricxapp:4560;service-admission-ctrl-xapp-rmr.ricxapp:4560\n" + + "rte|12042|service-ricxapp-ueec-rmr.ricxapp:4560;service-admission-ctrl-xapp-rmr.ricxapp:4560\n" + + "rte|12050|service-ricxapp-ueec-rmr.ricxapp:4560;service-admission-ctrl-xapp-rmr.ricxapp:4560\n" + + "rte|20000|service-ricxapp-ueec-rmr.ricxapp:4560;service-admission-ctrl-xapp-rmr.ricxapp:4560\n" + + "newrt|end", + }, + } + + configMap19 := &corev1.ConfigMap{ + ObjectMeta: metav1.ObjectMeta{ + Name: "configmap-ricplt-e2term-env-alpha", + }, + TypeMeta: metav1.TypeMeta{ + APIVersion: "v1", + Kind: "ConfigMap", + }, + Data: map[string]string{ + "RMR_SEED_RT": "router.txt", + "RMR_SRC_ID": "service-ricplt-e2term-rmr-alpha.ricplt", + "RMR_VCTL_FILE": "/tmp/rmr_verbose", + "nano": "38000", + "print": "1", + "sctp": "36422", + "volume": "/data/outgoing/", + "RMR_RTG_SVC": "4561", + }, + } + + + return []*corev1.ConfigMap{configMap1, configMap2, configMap3, configMap4, configMap5, configMap6,configMap7, configMap8, configMap9, configMap10, configMap11, configMap12, configMap13, configMap14, configMap15, configMap16, configMap17, configMap18, configMap19} } diff --git a/depRicKubernetesOperator/internal/controller/getPersistentVolume.go b/depRicKubernetesOperator/internal/controller/getPersistentVolume.go index 8fbb043..ea39552 100644 --- a/depRicKubernetesOperator/internal/controller/getPersistentVolume.go +++ b/depRicKubernetesOperator/internal/controller/getPersistentVolume.go @@ -30,5 +30,30 @@ func GetPersistentVolume() []*unstructured.Unstructured { }, } - return []*unstructured.Unstructured{persistentVolume1} + persistentVolume2 := &unstructured.Unstructured{ + Object: map[string]interface{}{ + "apiVersion": "v1", + "kind": "PersistentVolume", + "metadata": map[string]interface{}{ + "name": "pv-ricplt-e2term-alpha", + "labels": map[string]interface{}{ + "type": "local", + }, + }, + "spec": map[string]interface{}{ + "accessModes": []interface{}{ + "ReadWriteOnce", + }, + "capacity": map[string]interface{}{ + "storage": "100Mi", + }, + "hostPath": map[string]interface{}{ + "path": "/mnt/pv-ricplt-e2term-alpha", + }, + "storageClassName": "local-storage", + }, + }, + } + + return []*unstructured.Unstructured{persistentVolume1, persistentVolume2} } diff --git a/depRicKubernetesOperator/internal/controller/getPersistentVolumeClaim.go b/depRicKubernetesOperator/internal/controller/getPersistentVolumeClaim.go index 9bab433..b4a7a2e 100644 --- a/depRicKubernetesOperator/internal/controller/getPersistentVolumeClaim.go +++ b/depRicKubernetesOperator/internal/controller/getPersistentVolumeClaim.go @@ -30,5 +30,27 @@ func GetPersistentVolumeClaim() []*corev1.PersistentVolumeClaim { Namespace: "ricplt", }, } - return []*corev1.PersistentVolumeClaim{persistentVolumeClaim1} + persistentVolumeClaim2 := &corev1.PersistentVolumeClaim{ + ObjectMeta: metav1.ObjectMeta{ + Name: "pvc-ricplt-e2term-alpha", + }, + Spec: corev1.PersistentVolumeClaimSpec{ + AccessModes: []corev1.PersistentVolumeAccessMode{ + + corev1.PersistentVolumeAccessMode("ReadWriteOnce"), + }, + Resources: corev1.ResourceRequirements{ + Requests: corev1.ResourceList{ + "storage": resource.MustParse("100Mi"), + }, + }, + StorageClassName: stringPtr("local-storage"), + }, + TypeMeta: metav1.TypeMeta{ + APIVersion: "v1", + Kind: "PersistentVolumeClaim", + }, + } + + return []*corev1.PersistentVolumeClaim{persistentVolumeClaim1, persistentVolumeClaim2} } diff --git a/depRicKubernetesOperator/internal/controller/getServices.go b/depRicKubernetesOperator/internal/controller/getServices.go index 915463d..05247ef 100644 --- a/depRicKubernetesOperator/internal/controller/getServices.go +++ b/depRicKubernetesOperator/internal/controller/getServices.go @@ -339,5 +339,130 @@ func GetService() []*corev1.Service { }, } - return []*corev1.Service{service1, service2, service3, service4,service5,service6,service8,service9 } + service10 := &corev1.Service{ + ObjectMeta: metav1.ObjectMeta{ + Annotations: map[string]string{ + "prometheus.io/path": "/metrics", + "prometheus.io/port": "8088", + "prometheus.io/scrape": "true", + }, + Labels: map[string]string{ + "heritage": "Helm", + "release": "release-name", + "app": "ricplt-e2term-alpha", + "chart": "e2term-3.0.0", + }, + Name: "service-ricplt-e2term-prometheus-alpha", + Namespace: "ricplt", + }, + Spec: corev1.ServiceSpec{ + Ports: []corev1.ServicePort{ + + corev1.ServicePort{ + Name: "prmts-alpha", + Port: 8088, + Protocol: corev1.Protocol("TCP"), + TargetPort: intstr.IntOrString{ + StrVal: "prmts-alpha", + Type: intstr.Type(1), + }, + }, + }, + PublishNotReadyAddresses: false, + Selector: map[string]string{ + "release": "release-name", + "app": "ricplt-e2term-alpha", + }, + Type: corev1.ServiceType("ClusterIP"), + }, + TypeMeta: metav1.TypeMeta{ + APIVersion: "v1", + Kind: "Service", + }, + } + + service11 := &corev1.Service{ + ObjectMeta: metav1.ObjectMeta{ + Labels: map[string]string{ + "chart": "e2term-3.0.0", + "heritage": "Helm", + "release": "release-name", + "app": "ricplt-e2term-alpha", + }, + Name: "service-ricplt-e2term-rmr-alpha", + Namespace: "ricplt", + }, + Spec: corev1.ServiceSpec{ + Ports: []corev1.ServicePort{ + + corev1.ServicePort{ + Name: "rmrroute-alpha", + Port: 4561, + Protocol: corev1.Protocol("TCP"), + TargetPort: intstr.IntOrString{ + StrVal: "rmrroute-alpha", + Type: intstr.Type(1), + }, + }, + corev1.ServicePort{ + TargetPort: intstr.IntOrString{ + StrVal: "rmrdata-alpha", + Type: intstr.Type(1), + }, + Name: "rmrdata-alpha", + Port: 38000, + Protocol: corev1.Protocol("TCP"), + }, + }, + PublishNotReadyAddresses: false, + Selector: map[string]string{ + "app": "ricplt-e2term-alpha", + "release": "release-name", + }, + Type: corev1.ServiceType("ClusterIP"), + }, + TypeMeta: metav1.TypeMeta{ + APIVersion: "v1", + Kind: "Service", + }, + } + + service12 := &corev1.Service{ + ObjectMeta: metav1.ObjectMeta{ + Namespace: "ricplt", + Labels: map[string]string{ + "app": "ricplt-e2term-alpha", + "chart": "e2term-3.0.0", + "heritage": "Helm", + "release": "release-name", + }, + Name: "service-ricplt-e2term-sctp-alpha", + }, + Spec: corev1.ServiceSpec{ + Ports: []corev1.ServicePort{ + + corev1.ServicePort{ + Name: "sctp-alpha", + NodePort: 32222, + Port: 36422, + Protocol: corev1.Protocol("SCTP"), + TargetPort: intstr.IntOrString{ + IntVal: 36422, + }, + }, + }, + PublishNotReadyAddresses: false, + Selector: map[string]string{ + "app": "ricplt-e2term-alpha", + "release": "release-name", + }, + Type: corev1.ServiceType("NodePort"), + }, + TypeMeta: metav1.TypeMeta{ + APIVersion: "v1", + Kind: "Service", + }, + } + + return []*corev1.Service{service1, service2, service3, service4,service5,service6,service8,service9,service10,service11,service12} }