Tanzu Community Edition

Documentation

Prometheus

A time series database for your metrics.

Supported Providers

The following table shows the providers this package can work with.

AWSAzurevSphereDocker

Components

  • A Prometheus server and corresponding alert manager

Configuration

Note: Ingress for Prometheus server is not available by default, and can be activated using the ingress.enabled configuration field.

If you choose to activate the Contour-based Ingress, Contour must also be installed on the target cluster. Additionally, enabling the Ingress requires either Cert Manager or your own user-provided TLS certificate (ingress.tlsCertificate.tls.crt and ingress.tlsCertificate.tls.key) to configure TLS settings for the Ingress. For ad-hoc Prometheus UI access without an Ingress, use kubectl port-forward.

The following configuration values can be set to customize the Prometheus/Alertmanager installation.

ParameterDescriptionTypeDefault
namespaceNamespace where Prometheus will be deployedstringprometheus
prometheus.deployment.replicasNumber of Prometheus replicasinteger1
prometheus.deployment.containers.argsPrometheus container argumentslist
prometheus.deployment.containers.resourcesPrometheus container resource requests and limitsmap{}
prometheus.deployment.podAnnotationsThe Prometheus deployments pod annotationsmap{}
prometheus.deployment.podLabelsThe Prometheus deployments pod labelsmap{}
prometheus.deployment.configMapReload.containers.argsConfigmap-reload container arguments.list
prometheus.deployment.configMapReload.containers.resourcesConfigmap-reload container resource requests and limitsmap{}
prometheus.service.typeType of service to expose Prometheus. Supported Values: ClusterIPstringClusterIP
prometheus.service.portPrometheus service portinteger80
prometheus.service.targetPortPrometheus service target portinteger9090
prometheus.service.labelsPrometheus service labelsmap{}
prometheus.service.annotationsPrometheus service annotationsmap{}
prometheus.pvc.annotationsStorage class annotationsmap{}
prometheus.pvc.storageClassNameStorage class to use for persistent volume claim. By default this is null and default provisioner is usedstringnull
prometheus.pvc.accessModeDefine access mode for persistent volume claim. Supported values: ReadWriteOnce, ReadOnlyMany, ReadWriteManystringReadWriteOnce
prometheus.pvc.storageDefine storage size for persistent volume claimstring150Gi
prometheus.config.prometheus_ymlThe global Prometheus configurationyaml fileprometheus.yaml
prometheus.config.alerting_rules_ymlThe Prometheus alerting rulesyaml filealerting_rules.yaml
prometheus.config.recording_rules_ymlThe prometheus recording rulesyaml filerecording_rules.yaml
prometheus.config.alerts_ymlAdditional Prometheus alerting rules can be configured here.yaml filealerts_yml.yaml
prometheus.config.rules_ymlAdditional Prometheus recording rules can be configured here.yaml filerules_yml.yaml
alertmanager.deployment.replicasNumber of alertmanager replicasinteger1
alertmanager.deployment.containers.resourcesAlertmanager container resource requests and limitsmap{}
alertmanager.deployment.podAnnotationsThe Alertmanager deployments pod annotationsmap{}
alertmanager.deployment.podLabelsThe Alertmanager deployments pod labelsmap{}
alertmanager.service.typeType of service to expose Alertmanager. Supported Values: ClusterIPstringClusterIP
alertmanager.service.portAlertmanager service portinteger80
alertmanager.service.targetPortAlertmanager service target portinteger9093
alertmanager.service.labelsAlertmanager service labelsmap{}
alertmanager.service.annotationsAlertmanager service annotationsmap{}
alertmanager.pvc.annotationsStorage class annotationsmap{}
alertmanager.pvc.storageClassNameStorage class to use for persistent volume claim. By default this is null and default provisioner is used.stringnull
alertmanager.pvc.accessModeDefine access mode for persistent volume claim. Supported values: ReadWriteOnce, ReadOnlyMany, ReadWriteManystringReadWriteOnce
alertmanager.pvc.storageDefine storage size for persistent volume claimstring2Gi
alertmanager.config.alertmanager_ymlThe global yaml configuration for alert manager.yaml filealertmanager_yml
kube_state_metrics.deployment.replicasNumber of kube-state-metrics replicasinteger1
kube_state_metrics.deployment.containers.resourceskube-state-metrics container resource requests and limitsmap{}
kube_state_metrics.deployment.podAnnotationsThe kube-state-metrics deployments pod annotationsmap{}
kube_state_metrics.deployment.podLabelsThe kube-state-metrics deployments pod labelsmap{}
kube_state_metrics.service.typeType of service to expose kube-state-metrics. Supported Values: ClusterIPstringClusterIP
kube_state_metrics.service.portkube-state-metrics service portinteger80
kube_state_metrics.service.targetPortkube-state-metrics service target portinteger8080
kube_state_metrics.service.telemetryPortkube-state-metrics service telemetry portinteger81
kube_state_metrics.service.telemetryTargetPortkube-state-metrics service target telemetry portinteger8081
kube_state_metrics.service.labelskube-state-metrics service labelsmap{}
kube_state_metrics.service.annotationskube-state-metrics service annotationsmap{}
node_exporter.daemonset.replicasNumber of node-exporter replicasinteger1
node_exporter.daemonset.containers.resourcesnode-exporter container resource requests and limitsmap{}
node_exporter.daemonset.hostNetworkHost networking requested for this podbooleanfalse
node_exporter.daemonset.podAnnotationsThe node-exporter deployments pod annotationsmap{}
node_exporter.daemonset.podLabelsThe node-exporter deployments pod labelsmap{}
node_exporter.service.typeType of service to expose node-exporter. Supported Values: ClusterIPstringClusterIP
node_exporter.service.portnode-exporter service portinteger9100
node_exporter.service.targetPortnode-exporter service target portinteger9100
node_exporter.service.labelsnode-exporter service labelsmap{}
node_exporter.service.annotationsnode-exporter service annotationsmap{}
pushgateway.deployment.replicasNumber of pushgateway replicasinteger1
pushgateway.deployment.containers.resourcespushgateway container resource requests and limitsmap{}
pushgateway.deployment.podAnnotationsThe pushgateway deployments pod annotationsmap{}
pushgateway.deployment.podLabelsThe pushgateway deployments pod labelsmap{}
pushgateway.service.typeType of service to expose pushgateway. Supported Values: ClusterIPstringClusterIP
pushgateway.service.portpushgateway service portinteger9091
pushgateway.service.targetPortpushgateway service target portinteger9091
pushgateway.service.labelspushgateway service labelsmap{}
pushgateway.service.annotationspushgateway service annotationsmap{}
cadvisor.daemonset.replicasNumber of cadvisor replicasinteger1
cadvisor.daemonset.containers.resourcescadvisor container resource requests and limitsmap{}
cadvisor.daemonset.podAnnotationsThe cadvisor deployments pod annotationsmap{}
cadvisor.daemonset.podLabelsThe cadvisor deployments pod labelsmap{}
ingress.enabledActivate/deactivate ingress for prometheus and alertmanagerbooleanfalse
ingress.virtual_host_fqdnHostname for accessing prometheus and alertmanagerstringprometheus.system.tanzu
ingress.prometheus_prefixPath prefix for prometheusstring/
ingress.alertmanager_prefixPath prefix for alertmanagerstring/alertmanager/
ingress.prometheusServicePortPrometheus service port to proxy traffic tointeger80
ingress.alertmanagerServicePortAlertmanager service port to proxy traffic tointeger80
ingress.tlsCertificate.tls.crtOptional cert for ingress if you want to use your own TLS cert. A self signed cert is generated by defaultstringGenerated cert
ingress.tlsCertificate.tls.keyOptional cert private key for ingress if you want to use your own TLS cert.stringGenerated cert key
ingress.tlsCertificate.ca.crtOptional CA certificatestringCA certificate

Config files

The various configuration files can be loaded from /etc/config/. For example, when loading rule_files:

rule_files:
- /etc/config/alerting_rules.yml
- /etc/config/recording_rules.yml
- /etc/config/alerts
- /etc/config/rules

Alert manager service

The alert manager can be targeted by the deployed prometheus through it’s service. For example:

targets:
- alertmanager.prometheus.svc:9093

alertmanager is the default service name and prometheus is the namespace of the alertmanager deployment.

Usage Example

The default prometheus.yml configuration will deploy a prometheus server that will scrape metrics from pods that emit metrics on an endpoint and has the following annotations:

prometheus.io/scrape: 'true'
prometheus.io/path: '/metrics'
prometheus.io/port: '8080'

Join us!

Our open community welcomes all users and contributors

Community