5 Maintenance Procedures
This section provides details about the OSO maintenance procedures.
5.2 Managing 5G NFs
This section describes procedures to manage 5G NFs in CNE OSO.
5.2.1 Updating Alert Rules for an NF
This section describes the procedure to add or update the alerting rules for any Cloud Native Core (CNC) 5G Network Functions (NF) in OSO Prometheus GUI.
Prerequisites
- All NFs are required to create a separate
Alert-rules
. - For OSO Prometheus: A valid OSO release must be installed and an alert file describing all NF alert rules according to old format is required.
Add or Update Alert Rules
Perform the following steps to add alert rules in OSO Prometheus GUI:
- Take the backup of current configuration map of OSO
Prometheus.
$ kubectl get configmaps <OSO-prometheus-configmap-name> -o yaml -n <namespace> /tmp/tempPrometheusConfig.yaml
Where,<OSO-prometheus-configmap-name>
is the name of the OSO Prometheus configuration map.<namespace>
is the OSO namespace.
- Check and add the NF Alert file name inside the Prometheus configuration
map.
<nf-alertsname>
varies from NF to NF, and can be retrieved from each individual NF alert rules file.For example, in the following screenshot, "alertscndbtier" is thenf-alertsname
for cnDBTier.Figure 5-1 OSO Alert file
After retrieving thenf-alertsname
run the following steps:$ sed -i '/etc\/config\/<nf-alertsname>/d' /tmp/tempPrometheusConfig.yaml $ sed -i '/rule_files:/a\ \- /etc/config/<nf-alertsname>' /tmp/tempPrometheusConfig.yaml
- Update the configuration map with the updated
file.
$ kubectl -n <namespace> replace configmap <OSO-prometheus-configmap-name> -f /tmp/tempPrometheusConfig.yaml
- Patch the NF alert rules in OSO Prometheus configuration map by mentioning the
Alert-rule file
path.
$ kubectl patch configmap <OSO-prometheus-configmap-name> -n <namespace> --type merge --patch "$(cat ./NF_altertrules.yaml)"
5.3 Prometheus Vertical Scaling
This section describes the procedure for vertical scaling of Prometheus.
To scale Prometheus deployments, follow these steps:
- Get the list of deployments and identify the OSO Prometheus deployment with
the suffix
prom-svr
:# To list all the deployments in the OSO namespace $ kubectl -n <OSO_namespace> get deployments # To filter the deployment name by its suffix $ kubectl -n <OSO_namespace> get deployments | grep prom-svr
- Edit the OSO deployment using the following command:
Note:
This will open a vi editor with the deployment's yaml definition.$ kubectl -n <OSO_namespace> edit deployment <oso_deployment_name>-prom-svr
- Find the
resources
section for theprom-svr
container in the edit mode of deployment, and edit the amount of resources as per the requirements.name: prom-svr ports: ... # ports definitions readinessProbe: ... # readiness probe definition resources: limits: cpu: "2" memory: 4Gi requests: cpu: "2" memory: 4Gi
- Save and quit from the editor after making the required changes in the yaml file for the CPU and memory. In case of any errors while editing, the editor opens again and error message appears at the top of the yaml file as a comment.
Note:
If any of these objects have two containers each, you will find two resources sections. For more information about how to assign resources, see https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/.