Add support for prometheus
[ric-plt/ric-dep.git] / helm / infrastructure / subcharts / prometheus / README.md
1 # Prometheus
2
3 [Prometheus](https://prometheus.io/), a [Cloud Native Computing Foundation](https://cncf.io/) project, is a systems and service monitoring system. It collects metrics from configured targets at given intervals, evaluates rule expressions, displays the results, and can trigger alerts if some condition is observed to be true.
4
5 ## TL;DR;
6
7 ```console
8 $ helm install stable/prometheus
9 ```
10
11 ## Introduction
12
13 This chart bootstraps a [Prometheus](https://prometheus.io/) deployment on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager.
14
15 ## Prerequisites
16
17 - Kubernetes 1.3+ with Beta APIs enabled
18
19 ## Installing the Chart
20
21 To install the chart with the release name `my-release`:
22
23 ```console
24 $ helm install --name my-release stable/prometheus
25 ```
26
27 The command deploys Prometheus on the Kubernetes cluster in the default configuration. The [configuration](#configuration) section lists the parameters that can be configured during installation.
28
29 > **Tip**: List all releases using `helm list`
30
31 ## Uninstalling the Chart
32
33 To uninstall/delete the `my-release` deployment:
34
35 ```console
36 $ helm delete my-release
37 ```
38
39 The command removes all the Kubernetes components associated with the chart and deletes the release.
40
41 ## Prometheus 2.x
42
43 Prometheus version 2.x has made changes to alertmanager, storage and recording rules. Check out the migration guide [here](https://prometheus.io/docs/prometheus/2.0/migration/)
44
45 Users of this chart will need to update their alerting rules to the new format before they can upgrade.
46
47 ## Upgrading from previous chart versions.
48
49 Version 9.0 adds a new option to enable or disable the Prometheus Server.
50 This supports the use case of running a Prometheus server in one k8s cluster and scraping exporters in another cluster while using the same chart for each deployment.
51 To install the server `server.enabled` must be set to `true`.
52
53 As of version 5.0, this chart uses Prometheus 2.x. This version of prometheus introduces a new data format and is not compatible with prometheus 1.x. It is recommended to install this as a new release, as updating existing releases will not work. See the [prometheus docs](https://prometheus.io/docs/prometheus/latest/migration/#storage) for instructions on retaining your old data.
54
55 ### Example migration
56
57 Assuming you have an existing release of the prometheus chart, named `prometheus-old`. In order to update to prometheus 2.x while keeping your old data do the following:
58
59 1. Update the `prometheus-old` release. Disable scraping on every component besides the prometheus server, similar to the configuration below:
60
61         ```
62         alertmanager:
63           enabled: false
64         alertmanagerFiles:
65           alertmanager.yml: ""
66         kubeStateMetrics:
67           enabled: false
68         nodeExporter:
69           enabled: false
70         pushgateway:
71           enabled: false
72         server:
73           extraArgs:
74             storage.local.retention: 720h
75         serverFiles:
76           alerts: ""
77           prometheus.yml: ""
78           rules: ""
79         ```
80
81 1. Deploy a new release of the chart with version 5.0+ using prometheus 2.x. In the values.yaml set the scrape config as usual, and also add the `prometheus-old` instance as a remote-read target.
82
83    ```
84           prometheus.yml:
85             ...
86             remote_read:
87             - url: http://prometheus-old/api/v1/read
88             ...
89    ```
90
91    Old data will be available when you query the new prometheus instance.
92
93 ## Scraping Pod Metrics via Annotations
94
95 This chart uses a default configuration that causes prometheus
96 to scrape a variety of kubernetes resource types, provided they have the correct annotations.
97 In this section we describe how to configure pods to be scraped;
98 for information on how other resource types can be scraped you can
99 do a `helm template` to get the kubernetes resource definitions,
100 and then reference the prometheus configuration in the ConfigMap against the prometheus documentation
101 for [relabel_config](https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config)
102 and [kubernetes_sd_config](https://prometheus.io/docs/prometheus/latest/configuration/configuration/#kubernetes_sd_config).
103
104 In order to get prometheus to scrape pods, you must add annotations to the the pods as below:
105
106 ```
107 metadata:
108   annotations:
109     prometheus.io/scrape: "true"
110     prometheus.io/path: /metrics
111     prometheus.io/port: "8080"
112 spec:
113 ...
114 ```
115
116 You should adjust `prometheus.io/path` based on the URL that your pod serves metrics from.
117 `prometheus.io/port` should be set to the port that your pod serves metrics from.
118 Note that the values for `prometheus.io/scrape` and `prometheus.io/port` must be
119 enclosed in double quotes.
120
121 ## Configuration
122
123 The following table lists the configurable parameters of the Prometheus chart and their default values.
124
125 Parameter | Description | Default
126 --------- | ----------- | -------
127 `alertmanager.enabled` | If true, create alertmanager | `true`
128 `alertmanager.name` | alertmanager container name | `alertmanager`
129 `alertmanager.image.repository` | alertmanager container image repository | `prom/alertmanager`
130 `alertmanager.image.tag` | alertmanager container image tag | `v0.20.0`
131 `alertmanager.image.pullPolicy` | alertmanager container image pull policy | `IfNotPresent`
132 `alertmanager.prefixURL` | The prefix slug at which the server can be accessed | ``
133 `alertmanager.baseURL` | The external url at which the server can be accessed | `"http://localhost:9093"`
134 `alertmanager.extraArgs` | Additional alertmanager container arguments | `{}`
135 `alertmanager.extraSecretMounts` | Additional alertmanager Secret mounts | `[]`
136 `alertmanager.configMapOverrideName` | Prometheus alertmanager ConfigMap override where full-name is `{{.Release.Name}}-{{.Values.alertmanager.configMapOverrideName}}` and setting this value will prevent the default alertmanager ConfigMap from being generated | `""`
137 `alertmanager.configFromSecret` | The name of a secret in the same kubernetes namespace which contains the Alertmanager config, setting this value will prevent the default alertmanager ConfigMap from being generated | `""`
138 `alertmanager.configFileName` | The configuration file name to be loaded to alertmanager. Must match the key within configuration loaded from ConfigMap/Secret. | `alertmanager.yml`
139 `alertmanager.ingress.enabled` | If true, alertmanager Ingress will be created | `false`
140 `alertmanager.ingress.annotations` | alertmanager Ingress annotations | `{}`
141 `alertmanager.ingress.extraLabels` | alertmanager Ingress additional labels | `{}`
142 `alertmanager.ingress.hosts` | alertmanager Ingress hostnames | `[]`
143 `alertmanager.ingress.extraPaths` | Ingress extra paths to prepend to every alertmanager host configuration. Useful when configuring [custom actions with AWS ALB Ingress Controller](https://kubernetes-sigs.github.io/aws-alb-ingress-controller/guide/ingress/annotation/#actions) | `[]`
144 `alertmanager.ingress.tls` | alertmanager Ingress TLS configuration (YAML) | `[]`
145 `alertmanager.nodeSelector` | node labels for alertmanager pod assignment | `{}`
146 `alertmanager.tolerations` | node taints to tolerate (requires Kubernetes >=1.6) | `[]`
147 `alertmanager.affinity` | pod affinity | `{}`
148 `alertmanager.podDisruptionBudget.enabled` | If true, create a PodDisruptionBudget | `false`
149 `alertmanager.podDisruptionBudget.maxUnavailable` | Maximum unavailable instances in PDB | `1`
150 `alertmanager.schedulerName` | alertmanager alternate scheduler name | `nil`
151 `alertmanager.persistentVolume.enabled` | If true, alertmanager will create a Persistent Volume Claim | `true`
152 `alertmanager.persistentVolume.accessModes` | alertmanager data Persistent Volume access modes | `[ReadWriteOnce]`
153 `alertmanager.persistentVolume.annotations` | Annotations for alertmanager Persistent Volume Claim | `{}`
154 `alertmanager.persistentVolume.existingClaim` | alertmanager data Persistent Volume existing claim name | `""`
155 `alertmanager.persistentVolume.mountPath` | alertmanager data Persistent Volume mount root path | `/data`
156 `alertmanager.persistentVolume.size` | alertmanager data Persistent Volume size | `2Gi`
157 `alertmanager.persistentVolume.storageClass` | alertmanager data Persistent Volume Storage Class | `unset`
158 `alertmanager.persistentVolume.volumeBindingMode` | alertmanager data Persistent Volume Binding Mode | `unset`
159 `alertmanager.persistentVolume.subPath` | Subdirectory of alertmanager data Persistent Volume to mount | `""`
160 `alertmanager.podAnnotations` | annotations to be added to alertmanager pods | `{}`
161 `alertmanager.podLabels` | labels to be added to Prometheus AlertManager pods | `{}`
162 `alertmanager.podSecurityPolicy.annotations` | Specify pod annotations in the pod security policy | `{}` |
163 `alertmanager.replicaCount` | desired number of alertmanager pods | `1`
164 `alertmanager.statefulSet.enabled` | If true, use a statefulset instead of a deployment for pod management | `false`
165 `alertmanager.statefulSet.podManagementPolicy` | podManagementPolicy of alertmanager pods | `OrderedReady`
166 `alertmanager.statefulSet.headless.annotations` | annotations for alertmanager headless service | `{}`
167 `alertmanager.statefulSet.headless.labels` | labels for alertmanager headless service | `{}`
168 `alertmanager.statefulSet.headless.enableMeshPeer` | If true, enable the mesh peer endpoint for the headless service | `false`
169 `alertmanager.statefulSet.headless.servicePort` | alertmanager headless service port | `80`
170 `alertmanager.priorityClassName` | alertmanager priorityClassName | `nil`
171 `alertmanager.resources` | alertmanager pod resource requests & limits | `{}`
172 `alertmanager.securityContext` | Custom [security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/) for Alert Manager containers | `{}`
173 `alertmanager.service.annotations` | annotations for alertmanager service | `{}`
174 `alertmanager.service.clusterIP` | internal alertmanager cluster service IP | `""`
175 `alertmanager.service.externalIPs` | alertmanager service external IP addresses | `[]`
176 `alertmanager.service.loadBalancerIP` | IP address to assign to load balancer (if supported) | `""`
177 `alertmanager.service.loadBalancerSourceRanges` | list of IP CIDRs allowed access to load balancer (if supported) | `[]`
178 `alertmanager.service.servicePort` | alertmanager service port | `80`
179 `alertmanager.service.sessionAffinity` | Session Affinity for alertmanager service, can be `None` or `ClientIP` | `None`
180 `alertmanager.service.type` | type of alertmanager service to create | `ClusterIP`
181 `alertmanager.strategy` | Deployment strategy | `{ "type": "RollingUpdate" }`
182 `alertmanagerFiles.alertmanager.yml` | Prometheus alertmanager configuration | example configuration
183 `configmapReload.prometheus.enabled` | If false, the configmap-reload container for Prometheus will not be deployed | `true`
184 `configmapReload.prometheus.name` | configmap-reload container name | `configmap-reload`
185 `configmapReload.prometheus.image.repository` | configmap-reload container image repository | `jimmidyson/configmap-reload`
186 `configmapReload.prometheus.image.tag` | configmap-reload container image tag | `v0.3.0`
187 `configmapReload.prometheus.image.pullPolicy` | configmap-reload container image pull policy | `IfNotPresent`
188 `configmapReload.prometheus.extraArgs` | Additional configmap-reload container arguments | `{}`
189 `configmapReload.prometheus.extraVolumeDirs` | Additional configmap-reload volume directories | `{}`
190 `configmapReload.prometheus.extraConfigmapMounts` | Additional configmap-reload configMap mounts | `[]`
191 `configmapReload.prometheus.resources` | configmap-reload pod resource requests & limits | `{}`
192 `configmapReload.alertmanager.enabled` | If false, the configmap-reload container for AlertManager will not be deployed | `true`
193 `configmapReload.alertmanager.name` | configmap-reload container name | `configmap-reload`
194 `configmapReload.alertmanager.image.repository` | configmap-reload container image repository | `jimmidyson/configmap-reload`
195 `configmapReload.alertmanager.image.tag` | configmap-reload container image tag | `v0.3.0`
196 `configmapReload.alertmanager.image.pullPolicy` | configmap-reload container image pull policy | `IfNotPresent`
197 `configmapReload.alertmanager.extraArgs` | Additional configmap-reload container arguments | `{}`
198 `configmapReload.alertmanager.extraVolumeDirs` | Additional configmap-reload volume directories | `{}`
199 `configmapReload.alertmanager.extraConfigmapMounts` | Additional configmap-reload configMap mounts | `[]`
200 `configmapReload.alertmanager.resources` | configmap-reload pod resource requests & limits | `{}`
201 `initChownData.enabled`  | If false, don't reset data ownership at startup | true
202 `initChownData.name` | init-chown-data container name | `init-chown-data`
203 `initChownData.image.repository` | init-chown-data container image repository | `busybox`
204 `initChownData.image.tag` | init-chown-data container image tag | `latest`
205 `initChownData.image.pullPolicy` | init-chown-data container image pull policy | `IfNotPresent`
206 `initChownData.resources` | init-chown-data pod resource requests & limits | `{}`
207 `kubeStateMetrics.enabled` | If true, create kube-state-metrics sub-chart, see the [kube-state-metrics chart for configuration options](https://github.com/helm/charts/tree/master/stable/kube-state-metrics) | `true`
208 `kube-state-metrics` | [kube-state-metrics configuration options](https://github.com/helm/charts/tree/master/stable/kube-state-metrics) | `Same as sub-chart's`
209 `nodeExporter.enabled` | If true, create node-exporter | `true`
210 `nodeExporter.name` | node-exporter container name | `node-exporter`
211 `nodeExporter.image.repository` | node-exporter container image repository| `prom/node-exporter`
212 `nodeExporter.image.tag` | node-exporter container image tag | `v0.18.1`
213 `nodeExporter.image.pullPolicy` | node-exporter container image pull policy | `IfNotPresent`
214 `nodeExporter.extraArgs` | Additional node-exporter container arguments | `{}`
215 `nodeExporter.extraInitContainers` | Init containers to launch alongside the node-exporter | `[]`
216 `nodeExporter.extraHostPathMounts` | Additional node-exporter hostPath mounts | `[]`
217 `nodeExporter.extraConfigmapMounts` | Additional node-exporter configMap mounts | `[]`
218 `nodeExporter.hostNetwork` | If true, node-exporter pods share the host network namespace | `true`
219 `nodeExporter.hostPID` | If true, node-exporter pods share the host PID namespace | `true`
220 `nodeExporter.nodeSelector` | node labels for node-exporter pod assignment | `{}`
221 `nodeExporter.podAnnotations` | annotations to be added to node-exporter pods | `{}`
222 `nodeExporter.pod.labels` | labels to be added to node-exporter pods | `{}`
223 `nodeExporter.podDisruptionBudget.enabled` | If true, create a PodDisruptionBudget | `false`
224 `nodeExporter.podDisruptionBudget.maxUnavailable` | Maximum unavailable instances in PDB | `1`
225 `nodeExporter.podSecurityPolicy.annotations` | Specify pod annotations in the pod security policy | `{}` |
226 `nodeExporter.podSecurityPolicy.enabled` | Specify if a Pod Security Policy for node-exporter must be created | `false`
227 `nodeExporter.tolerations` | node taints to tolerate (requires Kubernetes >=1.6) | `[]`
228 `nodeExporter.priorityClassName` | node-exporter priorityClassName | `nil`
229 `nodeExporter.resources` | node-exporter resource requests and limits (YAML) | `{}`
230 `nodeExporter.securityContext` | securityContext for containers in pod | `{}`
231 `nodeExporter.service.annotations` | annotations for node-exporter service | `{prometheus.io/scrape: "true"}`
232 `nodeExporter.service.clusterIP` | internal node-exporter cluster service IP | `None`
233 `nodeExporter.service.externalIPs` | node-exporter service external IP addresses | `[]`
234 `nodeExporter.service.hostPort` | node-exporter service host port | `9100`
235 `nodeExporter.service.loadBalancerIP` | IP address to assign to load balancer (if supported) | `""`
236 `nodeExporter.service.loadBalancerSourceRanges` | list of IP CIDRs allowed access to load balancer (if supported) | `[]`
237 `nodeExporter.service.servicePort` | node-exporter service port | `9100`
238 `nodeExporter.service.type` | type of node-exporter service to create | `ClusterIP`
239 `podSecurityPolicy.enabled` | If true, create & use pod security policies resources | `false`
240 `pushgateway.enabled` | If true, create pushgateway | `true`
241 `pushgateway.name` | pushgateway container name | `pushgateway`
242 `pushgateway.image.repository` | pushgateway container image repository | `prom/pushgateway`
243 `pushgateway.image.tag` | pushgateway container image tag | `v1.0.1`
244 `pushgateway.image.pullPolicy` | pushgateway container image pull policy | `IfNotPresent`
245 `pushgateway.extraArgs` | Additional pushgateway container arguments | `{}`
246 `pushgateway.extraInitContainers` | Init containers to launch alongside the pushgateway | `[]`
247 `pushgateway.ingress.enabled` | If true, pushgateway Ingress will be created | `false`
248 `pushgateway.ingress.annotations` | pushgateway Ingress annotations | `{}`
249 `pushgateway.ingress.hosts` | pushgateway Ingress hostnames | `[]`
250 `pushgateway.ingress.extraPaths` | Ingress extra paths to prepend to every pushgateway host configuration. Useful when configuring [custom actions with AWS ALB Ingress Controller](https://kubernetes-sigs.github.io/aws-alb-ingress-controller/guide/ingress/annotation/#actions) | `[]`
251 `pushgateway.ingress.tls` | pushgateway Ingress TLS configuration (YAML) | `[]`
252 `pushgateway.nodeSelector` | node labels for pushgateway pod assignment | `{}`
253 `pushgateway.podAnnotations` | annotations to be added to pushgateway pods | `{}`
254 `pushgateway.podSecurityPolicy.annotations` | Specify pod annotations in the pod security policy | `{}` |
255 `pushgateway.tolerations` | node taints to tolerate (requires Kubernetes >=1.6) | `[]`
256 `pushgateway.replicaCount` | desired number of pushgateway pods | `1`
257 `pushgateway.podDisruptionBudget.enabled` | If true, create a PodDisruptionBudget | `false`
258 `pushgateway.podDisruptionBudget.maxUnavailable` | Maximum unavailable instances in PDB | `1`
259 `pushgateway.schedulerName` | pushgateway alternate scheduler name | `nil`
260 `pushgateway.persistentVolume.enabled` | If true, Prometheus pushgateway will create a Persistent Volume Claim | `false`
261 `pushgateway.persistentVolume.accessModes` | Prometheus pushgateway data Persistent Volume access modes | `[ReadWriteOnce]`
262 `pushgateway.persistentVolume.annotations` | Prometheus pushgateway data Persistent Volume annotations | `{}`
263 `pushgateway.persistentVolume.existingClaim` | Prometheus pushgateway data Persistent Volume existing claim name | `""`
264 `pushgateway.persistentVolume.mountPath` | Prometheus pushgateway data Persistent Volume mount root path | `/data`
265 `pushgateway.persistentVolume.size` | Prometheus pushgateway data Persistent Volume size | `2Gi`
266 `pushgateway.persistentVolume.storageClass` | Prometheus pushgateway data Persistent Volume Storage Class |  `unset`
267 `pushgateway.persistentVolume.volumeBindingMode` | Prometheus pushgateway data Persistent Volume Binding Mode |  `unset`
268 `pushgateway.persistentVolume.subPath` | Subdirectory of Prometheus server data Persistent Volume to mount | `""`
269 `pushgateway.priorityClassName` | pushgateway priorityClassName | `nil`
270 `pushgateway.resources` | pushgateway pod resource requests & limits | `{}`
271 `pushgateway.service.annotations` | annotations for pushgateway service | `{}`
272 `pushgateway.service.clusterIP` | internal pushgateway cluster service IP | `""`
273 `pushgateway.service.externalIPs` | pushgateway service external IP addresses | `[]`
274 `pushgateway.service.loadBalancerIP` | IP address to assign to load balancer (if supported) | `""`
275 `pushgateway.service.loadBalancerSourceRanges` | list of IP CIDRs allowed access to load balancer (if supported) | `[]`
276 `pushgateway.service.servicePort` | pushgateway service port | `9091`
277 `pushgateway.service.type` | type of pushgateway service to create | `ClusterIP`
278 `pushgateway.strategy` | Deployment strategy | `{ "type": "RollingUpdate" }`
279 `rbac.create` | If true, create & use RBAC resources | `true`
280 `server.enabled` | If false, Prometheus server will not be created | `true`
281 `server.name` | Prometheus server container name | `server`
282 `server.image.repository` | Prometheus server container image repository | `prom/prometheus`
283 `server.image.tag` | Prometheus server container image tag | `v2.18.1`
284 `server.image.pullPolicy` | Prometheus server container image pull policy | `IfNotPresent`
285 `server.configPath` |  Path to a prometheus server config file on the container FS  | `/etc/config/prometheus.yml`
286 `server.global.scrape_interval` | How frequently to scrape targets by default | `1m`
287 `server.global.scrape_timeout` | How long until a scrape request times out | `10s`
288 `server.global.evaluation_interval` | How frequently to evaluate rules | `1m`
289 `server.remoteWrite` | The remote write feature of Prometheus allow transparently sending samples. | `[]`
290 `server.remoteRead` | The remote read feature of Prometheus allow transparently receiving samples. | `[]`
291 `server.extraArgs` | Additional Prometheus server container arguments | `{}`
292 `server.extraFlags` | Additional Prometheus server container flags | `["web.enable-lifecycle"]`
293 `server.extraInitContainers` | Init containers to launch alongside the server | `[]`
294 `server.prefixURL` | The prefix slug at which the server can be accessed | ``
295 `server.baseURL` | The external url at which the server can be accessed | ``
296 `server.env` | Prometheus server environment variables | `[]`
297 `server.extraHostPathMounts` | Additional Prometheus server hostPath mounts | `[]`
298 `server.extraConfigmapMounts` | Additional Prometheus server configMap mounts | `[]`
299 `server.extraSecretMounts` | Additional Prometheus server Secret mounts | `[]`
300 `server.extraVolumeMounts` | Additional Prometheus server Volume mounts | `[]`
301 `server.extraVolumes` | Additional Prometheus server Volumes | `[]`
302 `server.configMapOverrideName` | Prometheus server ConfigMap override where full-name is `{{.Release.Name}}-{{.Values.server.configMapOverrideName}}` and setting this value will prevent the default server ConfigMap from being generated | `""`
303 `server.ingress.enabled` | If true, Prometheus server Ingress will be created | `false`
304 `server.ingress.annotations` | Prometheus server Ingress annotations | `[]`
305 `server.ingress.extraLabels` | Prometheus server Ingress additional labels | `{}`
306 `server.ingress.hosts` | Prometheus server Ingress hostnames | `[]`
307 `server.ingress.extraPaths` | Ingress extra paths to prepend to every Prometheus server host configuration. Useful when configuring [custom actions with AWS ALB Ingress Controller](https://kubernetes-sigs.github.io/aws-alb-ingress-controller/guide/ingress/annotation/#actions) | `[]`
308 `server.ingress.tls` | Prometheus server Ingress TLS configuration (YAML) | `[]`
309 `server.nodeSelector` | node labels for Prometheus server pod assignment | `{}`
310 `server.tolerations` | node taints to tolerate (requires Kubernetes >=1.6) | `[]`
311 `server.affinity` | pod affinity | `{}`
312 `server.podDisruptionBudget.enabled` | If true, create a PodDisruptionBudget | `false`
313 `server.podDisruptionBudget.maxUnavailable` | Maximum unavailable instances in PDB | `1`
314 `server.priorityClassName` | Prometheus server priorityClassName | `nil`
315 `server.schedulerName` | Prometheus server alternate scheduler name | `nil`
316 `server.persistentVolume.enabled` | If true, Prometheus server will create a Persistent Volume Claim | `true`
317 `server.persistentVolume.accessModes` | Prometheus server data Persistent Volume access modes | `[ReadWriteOnce]`
318 `server.persistentVolume.annotations` | Prometheus server data Persistent Volume annotations | `{}`
319 `server.persistentVolume.existingClaim` | Prometheus server data Persistent Volume existing claim name | `""`
320 `server.persistentVolume.mountPath` | Prometheus server data Persistent Volume mount root path | `/data`
321 `server.persistentVolume.size` | Prometheus server data Persistent Volume size | `8Gi`
322 `server.persistentVolume.storageClass` | Prometheus server data Persistent Volume Storage Class |  `unset`
323 `server.persistentVolume.volumeBindingMode` | Prometheus server data Persistent Volume Binding Mode | `unset`
324 `server.persistentVolume.subPath` | Subdirectory of Prometheus server data Persistent Volume to mount | `""`
325 `server.emptyDir.sizeLimit` | emptyDir sizeLimit if a Persistent Volume is not used | `""`
326 `server.podAnnotations` | annotations to be added to Prometheus server pods | `{}`
327 `server.podLabels` | labels to be added to Prometheus server pods | `{}`
328 `server.alertmanagers` | Prometheus AlertManager configuration for the Prometheus server | `{}`
329 `server.deploymentAnnotations` | annotations to be added to Prometheus server deployment | `{}`
330 `server.podSecurityPolicy.annotations` | Specify pod annotations in the pod security policy | `{}` |
331 `server.replicaCount` | desired number of Prometheus server pods | `1`
332 `server.statefulSet.enabled` | If true, use a statefulset instead of a deployment for pod management | `false`
333 `server.statefulSet.annotations` | annotations to be added to Prometheus server stateful set | `{}`
334 `server.statefulSet.labels` | labels to be added to Prometheus server stateful set | `{}`
335 `server.statefulSet.podManagementPolicy` | podManagementPolicy of server pods | `OrderedReady`
336 `server.statefulSet.headless.annotations` | annotations for Prometheus server headless service | `{}`
337 `server.statefulSet.headless.labels` | labels for Prometheus server headless service | `{}`
338 `server.statefulSet.headless.servicePort` | Prometheus server headless service port | `80`
339 `server.resources` | Prometheus server resource requests and limits | `{}`
340 `server.verticalAutoscaler.enabled` | If true a VPA object will be created for the controller (either StatefulSet or Deployemnt, based on above configs) | `false`
341 `server.securityContext` | Custom [security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/) for server containers | `{}`
342 `server.service.annotations` | annotations for Prometheus server service | `{}`
343 `server.service.clusterIP` | internal Prometheus server cluster service IP | `""`
344 `server.service.externalIPs` | Prometheus server service external IP addresses | `[]`
345 `server.service.loadBalancerIP` | IP address to assign to load balancer (if supported) | `""`
346 `server.service.loadBalancerSourceRanges` | list of IP CIDRs allowed access to load balancer (if supported) | `[]`
347 `server.service.nodePort` | Port to be used as the service NodePort (ignored if `server.service.type` is not `NodePort`) | `0`
348 `server.service.servicePort` | Prometheus server service port | `80`
349 `server.service.sessionAffinity` | Session Affinity for server service, can be `None` or `ClientIP` | `None`
350 `server.service.type` | type of Prometheus server service to create | `ClusterIP`
351 `server.service.gRPC.enabled` | If true, open a second port on the service for gRPC | `false`
352 `server.service.gRPC.servicePort` | Prometheus service gRPC port, (ignored if `server.service.gRPC.enabled` is not `true`) | `10901`
353 `server.service.gRPC.nodePort` | Port to be used as gRPC nodePort in the prometheus service | `0`
354 `server.service.statefulsetReplica.enabled` | If true, send the traffic from the service to only one replica of the replicaset | `false`
355 `server.service.statefulsetReplica.replica` | Which replica to send the traffice to | `0`
356 `server.hostAliases` | /etc/hosts-entries in container(s) | []
357 `server.sidecarContainers` | array of snippets with your sidecar containers for prometheus server | `""`
358 `server.strategy` | Deployment strategy | `{ "type": "RollingUpdate" }`
359 `serviceAccounts.alertmanager.create` | If true, create the alertmanager service account | `true`
360 `serviceAccounts.alertmanager.name` | name of the alertmanager service account to use or create | `{{ prometheus.alertmanager.fullname }}`
361 `serviceAccounts.alertmanager.annotations` | annotations for the alertmanager service account | `{}`
362 `serviceAccounts.nodeExporter.create` | If true, create the nodeExporter service account | `true`
363 `serviceAccounts.nodeExporter.name` | name of the nodeExporter service account to use or create | `{{ prometheus.nodeExporter.fullname }}`
364 `serviceAccounts.nodeExporter.annotations` | annotations for the nodeExporter service account | `{}`
365 `serviceAccounts.pushgateway.create` | If true, create the pushgateway service account | `true`
366 `serviceAccounts.pushgateway.name` | name of the pushgateway service account to use or create | `{{ prometheus.pushgateway.fullname }}`
367 `serviceAccounts.pushgateway.annotations` | annotations for the pushgateway service account | `{}`
368 `serviceAccounts.server.create` | If true, create the server service account | `true`
369 `serviceAccounts.server.name` | name of the server service account to use or create | `{{ prometheus.server.fullname }}`
370 `serviceAccounts.server.annotations` | annotations for the server service account | `{}`
371 `server.terminationGracePeriodSeconds` | Prometheus server Pod termination grace period | `300`
372 `server.retention` | (optional) Prometheus data retention | `"15d"`
373 `serverFiles.alerts` | (Deprecated) Prometheus server alerts configuration | `{}`
374 `serverFiles.rules` | (Deprecated) Prometheus server rules configuration | `{}`
375 `serverFiles.alerting_rules.yml` | Prometheus server alerts configuration | `{}`
376 `serverFiles.recording_rules.yml` | Prometheus server rules configuration | `{}`
377 `serverFiles.prometheus.yml` | Prometheus server scrape configuration | example configuration
378 `extraScrapeConfigs` | Prometheus server additional scrape configuration | ""
379 `alertRelabelConfigs` | Prometheus server [alert relabeling configs](https://prometheus.io/docs/prometheus/latest/configuration/configuration/#alert_relabel_configs) for H/A prometheus | ""
380 `networkPolicy.enabled` | Enable NetworkPolicy | `false`
381 `forceNamespace` | Force resources to be namespaced | `null` |
382
383 Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example,
384
385 ```console
386 $ helm install stable/prometheus --name my-release \
387     --set server.terminationGracePeriodSeconds=360
388 ```
389
390 Alternatively, a YAML file that specifies the values for the above parameters can be provided while installing the chart. For example,
391
392 ```console
393 $ helm install stable/prometheus --name my-release -f values.yaml
394 ```
395
396 > **Tip**: You can use the default [values.yaml](values.yaml)
397
398 Note that you have multiple yaml files. This is particularly useful when you have alerts belonging to multiple services in the cluster. For example,
399
400 ```yaml
401 # values.yaml
402 # ...
403
404 # service1-alert.yaml
405 serverFiles:
406   alerts:
407     service1:
408       - alert: anAlert
409       # ...
410
411 # service2-alert.yaml
412 serverFiles:
413   alerts:
414     service2:
415       - alert: anAlert
416       # ...
417 ```
418
419 ```console
420 $ helm install stable/prometheus --name my-release -f values.yaml -f service1-alert.yaml -f service2-alert.yaml
421 ```
422
423 ### RBAC Configuration
424 Roles and RoleBindings resources will be created automatically for `server` service.
425
426 To manually setup RBAC you need to set the parameter `rbac.create=false` and specify the service account to be used for each service by setting the parameters: `serviceAccounts.{{ component }}.create` to `false` and `serviceAccounts.{{ component }}.name` to the name of a pre-existing service account.
427
428 > **Tip**: You can refer to the default `*-clusterrole.yaml` and `*-clusterrolebinding.yaml` files in [templates](templates/) to customize your own.
429
430 ### ConfigMap Files
431 AlertManager is configured through [alertmanager.yml](https://prometheus.io/docs/alerting/configuration/). This file (and any others listed in `alertmanagerFiles`) will be mounted into the `alertmanager` pod.
432
433 Prometheus is configured through [prometheus.yml](https://prometheus.io/docs/operating/configuration/). This file (and any others listed in `serverFiles`) will be mounted into the `server` pod.
434
435 ### Ingress TLS
436 If your cluster allows automatic creation/retrieval of TLS certificates (e.g. [kube-lego](https://github.com/jetstack/kube-lego)), please refer to the documentation for that mechanism.
437
438 To manually configure TLS, first create/retrieve a key & certificate pair for the address(es) you wish to protect. Then create a TLS secret in the namespace:
439
440 ```console
441 kubectl create secret tls prometheus-server-tls --cert=path/to/tls.cert --key=path/to/tls.key
442 ```
443
444 Include the secret's name, along with the desired hostnames, in the alertmanager/server Ingress TLS section of your custom `values.yaml` file:
445
446 ```yaml
447 server:
448   ingress:
449     ## If true, Prometheus server Ingress will be created
450     ##
451     enabled: true
452
453     ## Prometheus server Ingress hostnames
454     ## Must be provided if Ingress is enabled
455     ##
456     hosts:
457       - prometheus.domain.com
458
459     ## Prometheus server Ingress TLS configuration
460     ## Secrets must be manually created in the namespace
461     ##
462     tls:
463       - secretName: prometheus-server-tls
464         hosts:
465           - prometheus.domain.com
466 ```
467
468 ### NetworkPolicy
469
470 Enabling Network Policy for Prometheus will secure connections to Alert Manager
471 and Kube State Metrics by only accepting connections from Prometheus Server.
472 All inbound connections to Prometheus Server are still allowed.
473
474 To enable network policy for Prometheus, install a networking plugin that
475 implements the Kubernetes NetworkPolicy spec, and set `networkPolicy.enabled` to true.
476
477 If NetworkPolicy is enabled for Prometheus' scrape targets, you may also need
478 to manually create a networkpolicy which allows it.