rancher / rancher-docs

Rancher Documentation
https://ranchermanager.docs.rancher.com/
Apache License 2.0
59 stars 203 forks source link

Need to clarify what it means by configurable and how to do it #137

Open Tejeev opened 4 years ago

Tejeev commented 4 years ago

The following page needs to clarify what it means when it says the components are configurable and how to configure them. I think it would make sense to create a better page on "Answers", what they are, and how to configure them, then link this there with a reference to the values.yaml containing the components that are configurable.

https://rancher.com/docs/rancher/v2.x/en/cluster-admin/tools/monitoring/#resource-consumption-of-prometheus-pods

Here is what I was able to put together and test in case any of it comes in handy:

Editing Monitoring Via the API

The best way to add resource limits to the init containers is by adding "Answers" to the Monitoring configurations. These are a function of Helm charts exposed by Rancher. Helm calls them "Values" and they are documented here: https://helm.sh/docs/chart_template_guide/values_files/ It's important to explain that the editable options are in the chart's values.yaml file and are modified by entering their Variable and Value as an "Answer" as you would use --set​ in Helm. The specific configurations in the values.yaml noted to be configurable in this document live here: https://github.com/rancher/system-charts/blob/dev-v2.5/charts/rancher-monitoring/v0.0.7/values.yaml

For example, using the above resources, I was able to determine that in order to set the resource limits for the memory of the two init containers, we would want to set: ​grafana.resources.inits.limits.memory

I found the API call from running the browser dev tools while submitting a request and added the Answer to the Body and sent the following request which successfully updated Monitoring: Method:

POST

URL:

https://$IP/v3/clusters/c-n7v4r?action=editMonitoring

Headers:

Host: $IP
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:75.0) Gecko/20100101 Firefox/75.0
Accept: application/json
Accept-Language: en-GB,en;q=0.5
Accept-Encoding: gzip, deflate, br
content-type: application/json
x-api-action-links: actionLinks
x-api-no-challenge: true
x-api-csrf: 3003c4de8a
Content-Length: 848
Origin: https://$IP
DNT: 1
Connection: keep-alive
Referer: https://$IP/c/c-n7v4r/monitoring/cluster-setting
Cookie: CSRF=3003c4de8a; R_SESS=#REDACTED

Body:

{"answers":{"operator-init.enabled":"true","exporter-node.enabled":"true","exporter-node.ports.metrics.port":"9796","exporter-kubelets.https":"true","exporter-node.resources.limits.cpu":"200m","exporter-node.resources.limits.memory":"200Mi","operator.resources.limits.memory":"500Mi","prometheus.retention":"12h","grafana.persistence.enabled":"false","prometheus.persistence.enabled":"false","prometheus.persistence.storageClass":"default","grafana.persistence.storageClass":"default","grafana.persistence.size":"10Gi","prometheus.persistence.size":"50Gi","prometheus.resources.core.requests.cpu":"750m","prometheus.resources.core.limits.cpu":"1000m","prometheus.resources.core.requests.memory":"750Mi","prometheus.resources.core.limits.memory":"1000Mi","prometheus.persistent.useReleaseName":"true","grafana.resources.inits.limits.memory":"1000Mi"}}

Editing Via UI​

This configuration is exposed in the UI under Monitoring's advanced options as seen here: image ​​ Which will expose the 'Answers' section (here, I've configured it for 70Mi which is a more realistic configuration for an init container than 1000Mi) : image

github-actions[bot] commented 1 year ago

This repository uses an automated workflow to automatically label issues which have not had any activity (commit/comment/label) for 90 days. This helps us manage the community issues better. If the issue is still relevant, please add a comment to the issue so the workflow can remove the label and we know it is still valid. If it is no longer relevant (or possibly fixed in the latest release), the workflow will automatically close the issue in 30 days. Thank you for your contributions.