Skip to content

Commit

Permalink
make charts
Browse files Browse the repository at this point in the history
  • Loading branch information
Arvind Iyengar committed May 9, 2022
1 parent 350fbd6 commit 740c86c
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 9 deletions.
Binary file modified assets/prometheus-federator/prometheus-federator-0.0.1.tgz
Binary file not shown.
Binary file not shown.
5 changes: 5 additions & 0 deletions charts/prometheus-federator/0.0.1/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ Once this setting is turned on, you can always create ServiceMonitors or PodMoni

> Note: If you don't want to allow users to be able to create ServiceMonitors and PodMonitors that aggregate into the Cluster Prometheus in Project namespaces, you can additionally set the namespaceSelectors on the chart to only target system namespaces (which must contain `cattle-monitoring-system` and `cattle-dashboards`, where resources are deployed into by default by rancher-monitoring; you will also need to monitor the `default` namespace to get apiserver metrics or create a custom ServiceMonitor to scrape apiserver metrics from the Service residing in the default namespace) to limit your Cluster Prometheus from picking up other Prometheus Operator CRs; in that case, it would be recommended to turn `.Values.prometheus.prometheusSpec.ignoreNamespaceSelectors=true` to allow you to define ServiceMonitors that can monitor non-system namespaces from within a system namespace.
In addition, if you modified the default `.Values.grafana.sidecar.*.searchNamespace` values on the Grafana Helm subchart for Monitoring V2, it is also recommended to remove the overrides or ensure that your defaults are scoped to only system namespaces for the following values:
- `.Values.grafana.sidecar.dashboards.searchNamespace` (default `cattle-dashboards`)
- `.Values.grafana.sidecar.datasources.searchNamespace` (default `null`, which means it uses the release namespace `cattle-monitoring-system`)
- `.Values.grafana.sidecar.notifiers.searchNamespace` (default `null`, which means it uses the release namespace `cattle-monitoring-system`)

### Increase the CPU / memory limits of the Cluster Prometheus

Depending on a cluster's setup, it's generally recommended to give a large amount of dedicated memory to the Cluster Prometheus to avoid restarts due to out-of-memory errors (OOMKilled), usually caused by churn created in the cluster that causes a large number of high cardinality metrics to be generated and ingested by Prometheus within one block of time; this is one of the reasons why the default Rancher Monitoring stack expects around 4GB of RAM to be able to operate in a normal-sized cluster. However, when introducing Project Monitoring Stacks that are all sending `/federate` requests to the same Cluster Prometheus and are reliant on the Cluster Prometheus being "up" to federate that system data on their namespaces, it's even more important that the Cluster Prometheus has an ample amount of CPU / memory assigned to it to prevent an outage that can cause data gaps across all Project Prometheis in the cluster.
Expand Down
2 changes: 1 addition & 1 deletion charts/prometheus-federator/0.0.1/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ helmProjectOperator:

image:
repository: rancher/prometheus-federator
tag: v0.0.1-rc1
tag: v0.0.1-rc2
pullPolicy: IfNotPresent

# Additional arguments to be passed into the Prometheus Federator image
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ metadata:
data:
values.json: |-
{
{{- if .Values.prometheus.prometheusSpec.externalUrl }}
{{- if not .Values.prometheus.enabled }}
"prometheusURL": "",
{{- else if .Values.prometheus.prometheusSpec.externalUrl }}
"prometheusURL": "{{ tpl .Values.prometheus.prometheusSpec.externalUrl . }}",
{{- else if and .Values.prometheus.ingress.enabled .Values.prometheus.ingress.hosts }}
"prometheusURL": "http://{{ tpl (index .Values.prometheus.ingress.hosts 0) . }}{{ .Values.prometheus.prometheusSpec.routePrefix }}",
Expand All @@ -25,15 +27,19 @@ data:
"prometheusURL": "http://{{ template "project-prometheus-stack.fullname" . }}-prometheus.{{ template "project-prometheus-stack.namespace" . }}:{{ .Values.prometheus.service.port }}",
{{- end }}

{{- if and .Values.grafana.ingress.enabled .Values.grafana.ingress.hosts }}
{{- if not .Values.grafana.enabled }}
"grafanaURL": "",
{{- else if and .Values.grafana.ingress.enabled .Values.grafana.ingress.hosts }}
"grafanaURL": "http://{{ tpl (index .Values.grafana.ingress.hosts 0) . }}{{ .Values.grafana.grafanaSpec.ingress.path }}",
{{- else if not (or (kindIs "invalid" .Values.global.cattle.url) (kindIs "invalid" .Values.global.cattle.clusterId)) }}
"grafanaURL": "{{ .Values.global.cattle.url }}/k8s/clusters/{{ .Values.global.cattle.clusterId }}/api/v1/namespaces/{{ template "project-prometheus-stack.namespace" . }}/services/http:{{ include "call-nested" (list . "grafana" "grafana.fullname") }}:{{ .Values.grafana.service.port }}/proxy",
{{- else }}
"grafanaURL": "http://{{ include "call-nested" (list . "grafana" "grafana.fullname") }}.{{ template "project-prometheus-stack.namespace" . }}:{{ .Values.grafana.service.port }}",
{{- end }}

{{- if .Values.alertmanager.alertmanagerSpec.externalUrl }}
{{- if not .Values.alertmanager.enabled }}
"alertmanagerURL": "",
{{- else if .Values.alertmanager.alertmanagerSpec.externalUrl }}
"alertmanagerURL": "{{ tpl .Values.alertmanager.alertmanagerSpec.externalUrl . }}",
{{- else if and .Values.alertmanager.ingress.enabled .Values.alertmanager.ingress.hosts }}
"alertmanagerURL": "http://{{ tpl (index .Values.alertmanager.ingress.hosts 0) . }}{{ .Values.alertmanager.alertmanagerSpec.routePrefix }}",
Expand All @@ -43,5 +49,9 @@ data:
"alertmanagerURL": "http://{{ template "project-prometheus-stack.fullname" . }}-alertmanager.{{ template "project-prometheus-stack.namespace" . }}:{{ .Values.alertmanager.service.port }}",
{{- end }}

"rancherDashboards": {{- $rancherDashboards | toPrettyJson | nindent 8 }}
{{- if and .Values.grafana.enabled .Values.grafana.defaultDashboardsEnabled }}
"rancherDashboards": {{- $rancherDashboards | toPrettyJson | nindent 8 }}
{{- else }}
"rancherDashboards": []
{{- end }}
}
8 changes: 4 additions & 4 deletions index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ entries:
catalog.cattle.io/release-name: prometheus-federator
apiVersion: v2
appVersion: 0.0.1
created: "2022-05-08T10:42:28.253577-07:00"
created: "2022-05-09T00:35:42.052056-07:00"
dependencies:
- condition: helmProjectOperator.enabled
name: helmProjectOperator
repository: file://./charts/helmProjectOperator
description: Prometheus Federator
digest: ce6f0e866a89bdb4a238046b82ae9940b78ff749f0c606aca160cd0b07b37b76
digest: 6e314d68544e3b00b343a2d6cfdeb46dfd15af895be641b19c8feac9440e5725
icon: https://raw.githubusercontent.com/rancher/prometheus-federator/main/assets/logos/prometheus-federator.svg
name: prometheus-federator
urls:
Expand All @@ -36,7 +36,7 @@ entries:
catalog.cattle.io/release-name: rancher-project-monitoring
apiVersion: v2
appVersion: 0.0.1
created: "2022-05-04T10:40:21.017058-07:00"
created: "2022-05-09T00:35:42.348443-07:00"
dependencies:
- condition: grafana.enabled
name: grafana
Expand All @@ -45,7 +45,7 @@ entries:
rules combined with documentation and scripts to provide easy to operate end-to-end
Kubernetes cluster monitoring with Prometheus. Depends on the existence of a
Cluster Prometheus deployed via Prometheus Operator
digest: dda5dce4aa2423b954a4929abb52bfda18ee2288e54fe9c65c034eb3d75cba31
digest: 219a8f7fbcabcd3f2f2d59f9aec468fcc114fe6caf7f0beed4e561b87bd7c0ea
home: https://github.com/prometheus-operator/kube-prometheus
icon: https://raw.githubusercontent.com/prometheus/prometheus.github.io/master/assets/prometheus_logo-cb55bb5c346.png
keywords:
Expand Down

0 comments on commit 740c86c

Please sign in to comment.