bitnamicharts/prometheus
Bitnami Helm chart for Prometheus
100K+
Prometheus is an open source monitoring and alerting system. It enables sysadmins to monitor their infrastructures by collecting metrics from configured targets at given intervals.
Trademarks: This software listing is packaged by Bitnami. The respective trademarks mentioned in the offering are owned by the respective companies, and use of them does not imply any affiliation or endorsement.
helm install my-release oci://registry-1.docker.io/bitnamicharts/prometheus
Looking to use Prometheus in production? Try VMware Tanzu Application Catalog, the commercial edition of the Bitnami catalog.
Bitnami charts for Helm are carefully engineered, actively maintained and are the quickest and easiest way to deploy containers on a Kubernetes cluster that are ready to handle production workloads.
This chart bootstraps a Prometheus Deployment in a Kubernetes cluster using the Helm package manager.
Bitnami charts can be used with Kubeapps for deployment and management of Helm Charts in clusters.
To install the chart with the release name my-release
:
helm install my-release oci://REGISTRY_NAME/REPOSITORY_NAME/prometheus
Note: You need to substitute the placeholders
REGISTRY_NAME
andREPOSITORY_NAME
with a reference to your Helm chart registry and repository. For example, in the case of Bitnami, you need to useREGISTRY_NAME=registry-1.docker.io
andREPOSITORY_NAME=bitnamicharts
.
The command deploys Prometheus on the Kubernetes cluster in the default configuration. The Parameters section lists the parameters that can be configured during installation.
Tip: List all releases using
helm list
Bitnami charts allow setting resource requests and limits for all containers inside the chart deployment. These are inside the resources
value (check parameter table). Setting requests is essential for production workloads and these should be adapted to your specific use case.
To make this process easier, the chart contains the resourcesPreset
values, which automatically sets the resources
section according to different presets. Check these presets in the bitnami/common chart. However, in production workloads using resourcesPreset
is discouraged as it may not fully adapt to your specific needs. Find more information on container resource management in the official Kubernetes documentation.
It is strongly recommended to use immutable tags in a production environment. This ensures your deployment does not change automatically if the same tag is updated with a different image.
Bitnami will release a new chart updating its containers if a new version of the main container, significant changes, or critical vulnerabilities exist.
There are cases where you may want to deploy extra objects, such a ConfigMap containing your app's configuration or some extra deployment with a micro service used by your app. For covering this case, the chart allows adding the full specification of other objects using the extraDeploy
parameter.
To back up and restore Helm chart deployments on Kubernetes, you need to back up the persistent volumes from the source deployment and attach them to a new deployment using Velero, a Kubernetes backup/restore tool. Find the instructions for using Velero in this guide.
This chart allows you to set your custom affinity using the XXX.affinity
parameter(s). Find more information about Pod's affinity in the kubernetes documentation.
As an alternative, you can use of the preset configurations for pod affinity, pod anti-affinity, and node affinity available at the bitnami/common chart. To do so, set the XXX.podAffinityPreset
, XXX.podAntiAffinityPreset
, or XXX.nodeAffinityPreset
parameters.
You can integrate Prometheus & Alertmanager with Thanos using this chart and the Bitnami Thanos chart following the steps below:
Note: in this example we will use MinIO® (subchart) as the Objstore. Every component will be deployed in the "monitoring" namespace.
objstoreConfig: |-
type: s3
config:
bucket: thanos
endpoint: {{ include "thanos.minio.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local:9000
access_key: minio
secret_key: minio123
insecure: true
query:
dnsDiscovery:
sidecarsService: prometheus-thanos
sidecarsNamespace: monitoring
bucketweb:
enabled: true
compactor:
enabled: true
storegateway:
enabled: true
ruler:
enabled: true
alertmanagers:
- http://prometheus-alertmanager.monitoring.svc.cluster.local:9093
config: |-
groups:
- name: "metamonitoring"
rules:
- alert: "PrometheusDown"
expr: absent(up{prometheus="monitoring/prometheus"})
metrics:
enabled: true
serviceMonitor:
enabled: true
minio:
enabled: true
auth:
rootPassword: minio123
rootUser: minio
monitoringBuckets: thanos
accessKey:
password: minio
secretKey:
password: minio123
For Helm 3:
kubectl create namespace monitoring
helm install prometheus \
--set prometheus.thanos.create=true \
--namespace monitoring \
oci://REGISTRY_NAME/REPOSITORY_NAME/prometheus
helm install thanos \
--values values.yaml \
--namespace monitoring \
oci://REGISTRY_NAME/REPOSITORY_NAME/thanos
Note: You need to substitute the placeholders
REGISTRY_NAME
andREPOSITORY_NAME
with a reference to your Helm chart registry and repository. For example, in the case of Bitnami, you need to useREGISTRY_NAME=registry-1.docker.io
andREPOSITORY_NAME=bitnamicharts
.
That's all! Now you have Thanos fully integrated with Prometheus and Alertmanager.
You can integrate Prometheus with Grafana Mimir using this chart and the Bitnami Grafana Mimir chart adding a remoteWrite
entry:
server:
remoteWrite:
- url: http://grafana-mimir-gateway.svc.cluster.local/api/v1/push
headers:
X-Scope-OrgID: demo
For Helm 3:
kubectl create namespace monitoring
helm install prometheus \
--values values.yaml \
--namespace monitoring \
oci://REGISTRY_NAME/REPOSITORY_NAME/prometheus
helm install grafana-mimir \
oci://REGISTRY_NAME/REPOSITORY_NAME/grafana-mimir
Note: You need to substitute the placeholders
REGISTRY_NAME
andREPOSITORY_NAME
with a reference to your Helm chart registry and repository. For example, in the case of Bitnami, you need to useREGISTRY_NAME=registry-1.docker.io
andREPOSITORY_NAME=bitnamicharts
.
That's all! Now you have Prometheus integrated with Grafana Mimir.
You can integrate Prometheus with Grafana Dashboard using this chart and the Bitnami Grafana chart just adding the prometheus datasources:
datasources:
secretDefinition:
apiVersion: 1
datasources:
- name: Prometheus
type: prometheus
access: proxy
orgId: 1
url: http://prometheus.monitoring.svc.cluster.local
version: 1
editable: true
isDefault: true
- name: Alertmanager
uid: alertmanager
type: alertmanager
access: proxy
orgId: 1
url: http://prometheus-alertmanager.monitoring.svc.cluster.local:9093
version: 1
editable: true
For Helm 3:
kubectl create namespace monitoring
helm install prometheus \
--namespace monitoring \
oci://REGISTRY_NAME/REPOSITORY_NAME/prometheus
helm install grafana \
--values values.yaml \
--namespace monitoring \
oci://REGISTRY_NAME/REPOSITORY_NAME/grafana
Note: You need to substitute the placeholders
REGISTRY_NAME
andREPOSITORY_NAME
with a reference to your Helm chart registry and repository. For example, in the case of Bitnami, you need to useREGISTRY_NAME=registry-1.docker.io
andREPOSITORY_NAME=bitnamicharts
.
By default this helm chart will monitor its own targets: prometheus and alertmanager. Additional ones can be added setting a list with the scrape_configs in the value server.extraScrapeConfigs
. Here there is a simple example for wordpress (deployed in the default namespace):
server:
extraScrapeConfigs:
- job_name: wordpress
kubernetes_sd_configs:
- role: endpoints
namespaces:
names:
- default
metrics_path: /metrics
relabel_configs:
- source_labels:
- job
target_label: __tmp_wordpress_job_name
- action: keep
source_labels:
- __meta_kubernetes_service_label_app_kubernetes_io_instance
- __meta_kubernetes_service_labelpresent_app_kubernetes_io_instance
regex: (wordpress);true
- action: keep
source_labels:
- __meta_kubernetes_service_label_app_kubernetes_io_name
- __meta_kubernetes_service_labelpresent_app_kubernetes_io_name
regex: (wordpress);true
- action: keep
source_labels:
- __meta_kubernetes_endpoint_port_name
regex: metrics
- source_labels:
- __meta_kubernetes_endpoint_address_target_kind
- __meta_kubernetes_endpoint_address_target_name
separator: ;
regex: Node;(.*)
replacement: ${1}
target_label: node
- source_labels:
- __meta_kubernetes_endpoint_address_target_kind
- __meta_kubernetes_endpoint_address_target_name
separator: ;
regex: Pod;(.*)
replacement: ${1}
target_label: pod
- source_labels:
- __meta_kubernetes_namespace
target_label: namespace
- source_labels:
- __meta_kubernetes_service_name
target_label: service
- source_labels:
- __meta_kubernetes_pod_name
target_label: pod
- source_labels:
- __meta_kubernetes_pod_container_name
target_label: container
- action: drop
source_labels:
- __meta_kubernetes_pod_phase
regex: (Failed|Succeeded)
- source_labels:
- __meta_kubernetes_service_name
target_label: job
replacement: ${1}
- target_label: endpoint
replacement: metrics
- source_labels:
- __address__
target_label: __tmp_hash
modulus: 1
action: hashmod
- source_labels:
- __tmp_hash
regex: 0
action: keep
Name | Description | Value |
---|---|---|
global.imageRegistry | Global Docker image registry | "" |
global.imagePullSecrets | Global Docker registry secret names as an array | [] |
global.defaultStorageClass | Global default StorageClass for Persistent Volume(s) | "" |
global.storageClass | DEPRECATED: use global.defaultStorageClass instead | "" |
global.security.allowInsecureImages | Allows skipping image verification | false |
global.compatibility.openshift.adaptSecurityContext | Adapt the securityContext sections of the deployment to make them compatible with Openshift restricted-v2 SCC: remove runAsUser, runAsGroup and fsGroup and let the platform use their allowed default IDs. Possible values: auto (apply if the detected running cluster is Openshift), force (perform the adaptation always), disabled (do not perform adaptation) | auto |
Name | Description | Value |
---|---|---|
kubeVersion | Override Kubernetes version | "" |
nameOverride | String to partially override common.names.name | "" |
fullnameOverride | String to fully override common.names.fullname | "" |
namespaceOverride | String to fully override common.names.namespace | "" |
commonLabels | Labels to add to all deployed objects | {} |
commonAnnotations | Annotations to add to all deployed objects | {} |
clusterDomain | Kubernetes cluster domain name | cluster.local |
extraDeploy | Array of extra objects to deploy with the release | [] |
diagnosticMode.enabled | Enable diagnostic mode (all probes will be disabled and the command will be overridden) | false |
diagnosticMode.command | Command to override all containers in the deployment | ["sleep"] |
diagnosticMode.args | Args to override all containers in the deployment | ["infinity"] |
ingress.apiVersion | Force Ingress API version (automatically detected if not set) | "" |
Name | Description | Value |
---|---|---|
alertmanager.enabled | Alertmanager enabled | true |
alertmanager.image.registry | Alertmanager image registry | REGISTRY_NAME |
alertmanager.image.repository | Alertmanager image repository | REPOSITORY_NAME/alertmanager |
alertmanager.image.digest | Alertmanager image digest in the way sha256:aa.... Please note this parameter, if set, will override the tag image tag (immutable tags are recommended) | "" |
alertmanager.image.pullPolicy | Alertmanager image pull policy | IfNotPresent |
alertmanager.image.pullSecrets | Alertmanager image pull secrets | [] |
alertmanager.configuration | Alertmanager configuration. This content will be stored in the the alertmanager.yaml file and the content can be a template. | "" |
alertmanager.replicaCount | Number of Alertmanager replicas to deploy | 1 |
alertmanager.containerPorts.http | Alertmanager HTTP container port | 9093 |
alertmanager.containerPorts.cluster | Alertmanager Cluster HA port | 9094 |
alertmanager.livenessProbe.enabled | Enable livenessProbe on Alertmanager containers | true |
alertmanager.livenessProbe.initialDelaySeconds | Initial delay seconds for livenessProbe | 5 |
alertmanager.livenessProbe.periodSeconds | Period seconds for livenessProbe | 20 |
alertmanager.livenessProbe.timeoutSeconds | Timeout seconds for livenessProbe | 3 |
alertmanager.livenessProbe.failureThreshold | Failure threshold for livenessProbe | 3 |
alertmanager.livenessProbe.successThreshold | Success threshold for livenessProbe | 1 |
alertmanager.readinessProbe.enabled | Enable readinessProbe on Alertmanager containers | true |
alertmanager.readinessProbe.initialDelaySeconds | Initial delay seconds for readinessProbe | 5 |
Note: the README for this chart is longer than the DockerHub length limit of 25000, so it has been trimmed. The full README can be found at https://github.com/bitnami/charts/blob/main/bitnami/prometheus/README.md