X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=depRicKubernetesOperator%2Finternal%2Fcontroller%2FgetConfigmap.go;h=af56cd313dcb7860ce2c34fa3209f415eded13fa;hb=6ab3aec83c11229354656c0fff7d047e833fa936;hp=05f1bbc81e646f3f7591d1998389e063dd5b1189;hpb=7a2312581b59aed5a22c2cfc2405aba68536acb4;p=ric-plt%2Fric-dep.git diff --git a/depRicKubernetesOperator/internal/controller/getConfigmap.go b/depRicKubernetesOperator/internal/controller/getConfigmap.go index 05f1bbc..af56cd3 100644 --- a/depRicKubernetesOperator/internal/controller/getConfigmap.go +++ b/depRicKubernetesOperator/internal/controller/getConfigmap.go @@ -50,5 +50,407 @@ func GetConfigMap() []*corev1.ConfigMap { }, } - return []*corev1.ConfigMap{configMap1, configMap2} + configMap3 := &corev1.ConfigMap{ + Data: map[string]string{ + "ALARM_MGR_SERVICE_NAME": "service-ricplt-alarmmanager-rmr.ricplt", + "ALARM_MGR_SERVICE_PORT": "4560", + }, + ObjectMeta: metav1.ObjectMeta{ + Namespace: "ricplt", + Name: "configmap-ricplt-alarmmanager-appconfig", + }, + TypeMeta: metav1.TypeMeta{ + APIVersion: "v1", + Kind: "ConfigMap", + }, + } + + configMap4 := &corev1.ConfigMap{ + ObjectMeta: metav1.ObjectMeta{ + Name: "alarm-appconfig", + Namespace: "ricxapp", + }, + TypeMeta: metav1.TypeMeta{ + Kind: "ConfigMap", + APIVersion: "v1", + }, + Data: map[string]string{ + "ALARM_MGR_SERVICE_NAME": "service-ricplt-alarmmanager-rmr.ricplt", + "ALARM_MGR_SERVICE_PORT": "4560", + }, + } + + configMap5 := &corev1.ConfigMap{ + Data: map[string]string{ + "alarmmanagercfg": "{ \n" + + " \"local\": {\n" + + " \"host\": \":8080\"\n" + + " },\n" + + " \"logger\": {\n" + + " \"level\": 4\n" + + " },\n" + + " \"db\": {\n" + + " \"namespaces\": [\"sdl\", \"rnib\"]\n" + + " },\n" + + " \"rmr\": {\n" + + " \"protPort\": \"tcp:4560\",\n" + + " \"maxSize\": 1024,\n" + + " \"numWorkers\": 1\n" + + " },\n" + + " \"controls\": {\n" + + " \"promAlertManager\": {\n" + + " \"address\": \"cpro-alertmanager:80\",\n" + + " \"baseUrl\": \"api/v2\",\n" + + " \"schemes\": \"http\",\n" + + " \"alertInterval\": 30000\n" + + " },\n" + + " \"maxActiveAlarms\": 5000,\n" + + " \"maxAlarmHistory\": 20000,\n" + + " \"alarmInfoPvFile\": \"/mnt/pv-ricplt-alarmmanager/alarminfo.json\"\n" + + " }\n" + + "}", + }, + ObjectMeta: metav1.ObjectMeta{ + Name: "configmap-ricplt-alarmmanager-alarmmanagercfg", + Namespace: "ricplt", + }, + TypeMeta: metav1.TypeMeta{ + APIVersion: "v1", + Kind: "ConfigMap", + }, + } + + configMap6 := &corev1.ConfigMap{ + Data: map[string]string{ + "RMR_SEED_RT": "/cfg/uta_rtg.rt", + "RMR_SRC_ID": "service-ricplt-alarmmanager-rmr.ricplt", + "RMR_RTG_SVC": "service-ricplt-rtmgr-rmr:4561", + }, + ObjectMeta: metav1.ObjectMeta{ + Name: "configmap-ricplt-alarmmanager-env", + Namespace: "ricplt", + }, + TypeMeta: metav1.TypeMeta{ + APIVersion: "v1", + Kind: "ConfigMap", + }, + } + + configMap7 := &corev1.ConfigMap{ + Data: map[string]string{ + "appmgr.yaml": "\"local\":\n" + + " # Port on which the xapp-manager REST services are provided\n" + + " \"host\": \":8080\"\n" + + "\"helm\":\n" + + " # Remote helm repo URL. UPDATE this as required.\n" + + " \"repo\": \"\\\"http://service-ricplt-xapp-onboarder-http:8080\\\"\"\n" + + "\n" + + " # Repo name referred within the xapp-manager\n" + + " \"repo-name\": \"helm-repo\"\n" + + "\n" + + " # Tiller service details in the cluster. UPDATE this as required.\n" + + " \"tiller-service\": service-tiller-ricxapp\n" + + " \"tiller-namespace\": ricinfra\n" + + " \"tiller-port\": \"44134\"\n" + + " # helm username and password files\n" + + " \"helm-username-file\": \"/opt/ric/secret/helm_repo_username\"\n" + + " \"helm-password-file\": \"/opt/ric/secret/helm_repo_password\"\n" + + " \"retry\": 1\n" + + "\"xapp\":\n" + + " #Namespace to install xAPPs\n" + + " \"namespace\": \"ricxapp\"\n" + + " \"tarDir\": \"/tmp\"\n" + + " \"schema\": \"descriptors/schema.json\"\n" + + " \"config\": \"config/config-file.json\"\n" + + " \"tmpConfig\": \"/tmp/config-file.json\"\n" + + "", + }, + ObjectMeta: metav1.ObjectMeta{ + Name: "configmap-ricplt-appmgr-appconfig", + }, + TypeMeta: metav1.TypeMeta{ + APIVersion: "v1", + Kind: "ConfigMap", + }, + } + + configMap8 := &corev1.ConfigMap{ + Data: map[string]string{ + "appmgr-tiller-secret-copier.sh": "#!/bin/sh\n" + + "if [ -x /svcacct-to-kubeconfig.sh ] ; then\n" + + " /svcacct-to-kubeconfig.sh\n" + + "fi\n" + + "\n" + + "if [ ! -z \"${HELM_TLS_CA_CERT}\" ]; then\n" + + " kubectl -n ${SECRET_NAMESPACE} get secret -o yaml ${SECRET_NAME} | \\\n" + + " grep 'ca.crt:' | \\\n" + + " awk '{print $2}' | \\\n" + + " base64 -d > ${HELM_TLS_CA_CERT}\n" + + "fi\n" + + "\n" + + "if [ ! -z \"${HELM_TLS_CERT}\" ]; then\n" + + " kubectl -n ${SECRET_NAMESPACE} get secret -o yaml ${SECRET_NAME} | \\\n" + + " grep 'tls.crt:' | \\\n" + + " awk '{print $2}' | \\\n" + + " base64 -d > ${HELM_TLS_CERT}\n" + + "fi\n" + + "\n" + + "if [ ! -z \"${HELM_TLS_KEY}\" ]; then\n" + + " kubectl -n ${SECRET_NAMESPACE} get secret -o yaml ${SECRET_NAME} | \\\n" + + " grep 'tls.key:' | \\\n" + + " awk '{print $2}' | \\\n" + + " base64 -d > ${HELM_TLS_KEY}\n" + + "fi\n" + + "", + "svcacct-to-kubeconfig.sh": "#!/bin/sh\n" + + "\n" + + "# generate a kubconfig (at ${KUBECONFIG} file from the automatically-mounted\n" + + "# service account token.\n" + + "# ENVIRONMENT:\n" + + "# SVCACCT_NAME: the name of the service account user. default \"default\"\n" + + "# CLUSTER_NAME: the name of the kubernetes cluster. default \"kubernetes\"\n" + + "# KUBECONFIG: where the generated file will be deposited.\n" + + "SVCACCT_TOKEN=`cat /var/run/secrets/kubernetes.io/serviceaccount/token`\n" + + "CLUSTER_CA=`base64 /var/run/secrets/kubernetes.io/serviceaccount/ca.crt|tr -d '\\n'`\n" + + "\n" + + "cat >${KUBECONFIG} <<__EOF__\n" + + "ApiVersion: v1\n" + + "kind: Config\n" + + "users:\n" + + "- name: ${SVCACCT_NAME:-default}\n" + + " user:\n" + + " token: ${SVCACCT_TOKEN}\n" + + "clusters:\n" + + "- cluster:\n" + + " certificate-authority-data: ${CLUSTER_CA}\n" + + " server: ${K8S_API_HOST:-https://kubernetes.default.svc.cluster.local/}\n" + + " name: ${CLUSTER_NAME:-kubernetes}\n" + + "contexts:\n" + + "- context:\n" + + " cluster: ${CLUSTER_NAME:-kubernetes}\n" + + " user: ${SVCACCT_NAME:-default}\n" + + " name: svcs-acct-context\n" + + "current-context: svcs-acct-context\n" + + "__EOF__\n" + + "", + }, + ObjectMeta: metav1.ObjectMeta{ + Name: "configmap-ricplt-appmgr-bin", + }, + TypeMeta: metav1.TypeMeta{ + Kind: "ConfigMap", + APIVersion: "v1", + }, + } + + configMap9 := &corev1.ConfigMap{ + Data: map[string]string{ + "RMR_RTG_SVC": "4561", + "HELM_TLS_CA_CERT": "/opt/ric/secret/tiller-ca.cert", + "HELM_TLS_CERT": "/opt/ric/secret/helm-client.cert", + "HELM_TLS_HOSTNAME": "service-tiller-ricxapp", + "HELM_TLS_VERIFY": "true", + "NAME": "xappmgr", + "HELM_HOST": "service-tiller-ricxapp.ricinfra:44134", + "HELM_TLS_ENABLED": "true", + "HELM_TLS_KEY": "/opt/ric/secret/helm-client.key", + }, + ObjectMeta: metav1.ObjectMeta{ + Name: "configmap-ricplt-appmgr-env", + }, + TypeMeta: metav1.TypeMeta{ + APIVersion: "v1", + 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", + }, + } + + 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} }