5 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/.