prometheus

by Helm

Helm chartv7.3.4-thanos.4App 2.4.3

Prometheus is a monitoring system and time series database.

About this chart

Prometheus

Prometheus, a Cloud Native Computing Foundation 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.

TL;DR;

$ helm install stable/prometheus

Introduction

This chart bootstraps a Prometheus deployment on a Kubernetes cluster using the Helm package manager.

Prerequisites

  • Kubernetes 1.3+ with Beta APIs enabled

Installing the Chart

To install the chart with the release name my-release:

$ helm install --name my-release stable/prometheus

The command deploys Prometheus on the Kubernetes cluster in the default configuration. The configuration section lists the parameters that can be configured during installation.

Tip: List all releases using helm list

Uninstalling the Chart

To uninstall/delete the my-release deployment:

$ helm delete my-release

The command removes all the Kubernetes components associated with the chart and deletes the release.

Prometheus 2.x

Prometheus version 2.x has made changes to alertmanager, storage and recording rules. Check out the migration guide here

Users of this chart will need to update their alerting rules to the new format before they can upgrade.

Upgrading from previous chart versions.

As of version 5.0, this chart uses Prometheus 2.1. 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 for instructions on retaining your old data.

Example migration

Assuming you have an existing release of the prometheus chart, named prometheus-old. In order to update to prometheus 2.1 while keeping your old data do the following:

  1. Update the prometheus-old release. Disable scraping on every component besides the prometheus server, similar to the configuration below:

    alertmanager:
      enabled: false
    alertmanagerFiles:
      alertmanager.yml: ""
    kubeStateMetrics:
      enabled: false
    nodeExporter:
      enabled: false
    pushgateway:
      enabled: false
    server:
      extraArgs:
        storage.local.retention: 720h
    serverFiles:
      alerts: ""
      prometheus.yml: ""
      rules: ""
    
  2. 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.

       prometheus.yml:
         ...
         remote_read:
         - url: http://prometheus-old/api/v1/read
         ...
    

    Old data will be available when you query the new prometheus instance.

Configuration

The following table lists the configurable parameters of the Prometheus chart and their default values.

ParameterDescriptionDefault
alertmanager.enabledIf true, create alertmanagertrue
alertmanager.namealertmanager container namealertmanager
alertmanager.image.repositoryalertmanager container image repositoryprom/alertmanager
alertmanager.image.tagalertmanager container image tagv0.15.2
alertmanager.image.pullPolicyalertmanager container image pull policyIfNotPresent
alertmanager.prefixURLThe prefix slug at which the server can be accessed``
alertmanager.baseURLThe external url at which the server can be accessed/
alertmanager.extraArgsAdditional alertmanager container arguments{}
alertmanager.configMapOverrideNamePrometheus 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""
alertmanager.ingress.enabledIf true, alertmanager Ingress will be createdfalse
alertmanager.ingress.annotationsalertmanager Ingress annotations{}
alertmanager.ingress.extraLabelsalertmanager Ingress additional labels{}
alertmanager.ingress.hostsalertmanager Ingress hostnames[]
alertmanager.ingress.tlsalertmanager Ingress TLS configuration (YAML)[]
alertmanager.nodeSelectornode labels for alertmanager pod assignment{}
alertmanager.tolerationsnode taints to tolerate (requires Kubernetes >=1.6)[]
alertmanager.affinitypod affinity{}
alertmanager.schedulerNamealertmanager alternate scheduler namenil
alertmanager.persistentVolume.enabledIf true, alertmanager will create a Persistent Volume Claimtrue
alertmanager.persistentVolume.accessModesalertmanager data Persistent Volume access modes[ReadWriteOnce]
alertmanager.persistentVolume.annotationsAnnotations for alertmanager Persistent Volume Claim{}
alertmanager.persistentVolume.existingClaimalertmanager data Persistent Volume existing claim name""
alertmanager.persistentVolume.mountPathalertmanager data Persistent Volume mount root path/data
alertmanager.persistentVolume.sizealertmanager data Persistent Volume size2Gi
alertmanager.persistentVolume.storageClassalertmanager data Persistent Volume Storage Classunset
alertmanager.persistentVolume.subPathSubdirectory of alertmanager data Persistent Volume to mount""
alertmanager.podAnnotationsannotations to be added to alertmanager pods{}
alertmanager.replicaCountdesired number of alertmanager pods1
alertmanager.priorityClassNamealertmanager priorityClassNamenil
alertmanager.resourcesalertmanager pod resource requests & limits{}
alertmanager.securityContextCustom security context for Alert Manager containers{}
alertmanager.service.annotationsannotations for alertmanager service{}
alertmanager.service.clusterIPinternal alertmanager cluster service IP""
alertmanager.service.externalIPsalertmanager service external IP addresses[]
alertmanager.service.loadBalancerIPIP address to assign to load balancer (if supported)""
alertmanager.service.loadBalancerSourceRangeslist of IP CIDRs allowed access to load balancer (if supported)[]
alertmanager.service.servicePortalertmanager service port80
alertmanager.service.typetype of alertmanager service to createClusterIP
alertmanagerFiles.alertmanager.ymlPrometheus alertmanager configurationexample configuration
configmapReload.nameconfigmap-reload container nameconfigmap-reload
configmapReload.image.repositoryconfigmap-reload container image repositoryjimmidyson/configmap-reload
configmapReload.image.tagconfigmap-reload container image tagv0.2.2
configmapReload.image.pullPolicyconfigmap-reload container image pull policyIfNotPresent
configmapReload.extraArgsAdditional configmap-reload container arguments{}
configmapReload.extraVolumeDirsAdditional configmap-reload volume directories{}
configmapReload.extraConfigmapMountsAdditional configmap-reload configMap mounts[]
configmapReload.resourcesconfigmap-reload pod resource requests & limits{}
initChownData.enabledIf false, don't reset data ownership at startuptrue
initChownData.nameinit-chown-data container nameinit-chown-data
initChownData.image.repositoryinit-chown-data container image repositorybusybox
initChownData.image.taginit-chown-data container image taglatest
initChownData.image.pullPolicyinit-chown-data container image pull policyIfNotPresent
initChownData.resourcesinit-chown-data pod resource requests & limits{}
kubeStateMetrics.enabledIf true, create kube-state-metricstrue
kubeStateMetrics.namekube-state-metrics container namekube-state-metrics
kubeStateMetrics.image.repositorykube-state-metrics container image repositoryquay.io/coreos/kube-state-metrics
kubeStateMetrics.image.tagkube-state-metrics container image tagv1.4.0
kubeStateMetrics.image.pullPolicykube-state-metrics container image pull policyIfNotPresent
kubeStateMetrics.argskube-state-metrics container arguments{}
kubeStateMetrics.nodeSelectornode labels for kube-state-metrics pod assignment{}
kubeStateMetrics.podAnnotationsannotations to be added to kube-state-metrics pods{}
kubeStateMetrics.deploymentAnnotationsannotations to be added to kube-state-metrics deployment{}
kubeStateMetrics.tolerationsnode taints to tolerate (requires Kubernetes >=1.6)[]
kubeStateMetrics.replicaCountdesired number of kube-state-metrics pods1
kubeStateMetrics.priorityClassNamekube-state-metrics priorityClassNamenil
kubeStateMetrics.resourceskube-state-metrics resource requests and limits (YAML){}
kubeStateMetrics.securityContextCustom security context for kube-state-metrics containers{}
kubeStateMetrics.service.annotationsannotations for kube-state-metrics service{prometheus.io/scrape: "true"}
kubeStateMetrics.service.clusterIPinternal kube-state-metrics cluster service IPNone
kubeStateMetrics.service.externalIPskube-state-metrics service external IP addresses[]
kubeStateMetrics.service.loadBalancerIPIP address to assign to load balancer (if supported)""
kubeStateMetrics.service.loadBalancerSourceRangeslist of IP CIDRs allowed access to load balancer (if supported)[]
kubeStateMetrics.service.servicePortkube-state-metrics service port80
kubeStateMetrics.service.typetype of kube-state-metrics service to createClusterIP
nodeExporter.enabledIf true, create node-exportertrue
nodeExporter.namenode-exporter container namenode-exporter
nodeExporter.image.repositorynode-exporter container image repositoryprom/node-exporter
nodeExporter.image.tagnode-exporter container image tagv0.16.0
nodeExporter.image.pullPolicynode-exporter container image pull policyIfNotPresent
nodeExporter.extraArgsAdditional node-exporter container arguments{}
nodeExporter.extraHostPathMountsAdditional node-exporter hostPath mounts[]
nodeExporter.extraConfigmapMountsAdditional node-exporter configMap mounts[]
nodeExporter.hostNetworkIf true, node-exporter pods share the host network namespacetrue
nodeExporter.hostPIDIf true, node-exporter pods share the host PID namespacetrue
nodeExporter.nodeSelectornode labels for node-exporter pod assignment{}
nodeExporter.podAnnotationsannotations to be added to node-exporter pods{}
nodeExporter.pod.labelslabels to be added to node-exporter pods{}
nodeExporter.podSecurityPolicy.annotationsSpecify pod annotations in the pod security policy{}
nodeExporter.podSecurityPolicy.enabledSpecify if a Pod Security Policy for node-exporter must be createdfalse
nodeExporter.tolerationsnode taints to tolerate (requires Kubernetes >=1.6)[]
nodeExporter.priorityClassNamenode-exporter priorityClassNamenil
nodeExporter.resourcesnode-exporter resource requests and limits (YAML){}
nodeExporter.securityContextsecurityContext for containers in pod{}
nodeExporter.service.annotationsannotations for node-exporter service{prometheus.io/scrape: "true"}
nodeExporter.service.clusterIPinternal node-exporter cluster service IPNone
nodeExporter.service.externalIPsnode-exporter service external IP addresses[]
nodeExporter.service.loadBalancerIPIP address to assign to load balancer (if supported)""
nodeExporter.service.loadBalancerSourceRangeslist of IP CIDRs allowed access to load balancer (if supported)[]
nodeExporter.service.servicePortnode-exporter service port9100
nodeExporter.service.typetype of node-exporter service to createClusterIP
pushgateway.enabledIf true, create pushgatewaytrue
pushgateway.namepushgateway container namepushgateway
pushgateway.image.repositorypushgateway container image repositoryprom/pushgateway
pushgateway.image.tagpushgateway container image tagv0.5.2
pushgateway.image.pullPolicypushgateway container image pull policyIfNotPresent
pushgateway.extraArgsAdditional pushgateway container arguments{}
pushgateway.ingress.enabledIf true, pushgateway Ingress will be createdfalse
pushgateway.ingress.annotationspushgateway Ingress annotations{}
pushgateway.ingress.hostspushgateway Ingress hostnames[]
pushgateway.ingress.tlspushgateway Ingress TLS configuration (YAML)[]
pushgateway.nodeSelectornode labels for pushgateway pod assignment{}
pushgateway.podAnnotationsannotations to be added to pushgateway pods{}
pushgateway.tolerationsnode taints to tolerate (requires Kubernetes >=1.6)[]
pushgateway.replicaCountdesired number of pushgateway pods1
pushgateway.priorityClassNamepushgateway priorityClassNamenil
pushgateway.resourcespushgateway pod resource requests & limits{}
pushgateway.service.annotationsannotations for pushgateway service{}
pushgateway.service.clusterIPinternal pushgateway cluster service IP""
pushgateway.service.externalIPspushgateway service external IP addresses[]
pushgateway.service.loadBalancerIPIP address to assign to load

Deploy prometheus with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has prometheus on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartprometheus is pinned at v7.3.4-thanos.4 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply