metricbeat

by Elastic Inc.

Helm chartv8.5.1App 8.5.1Verified publisherOfficial

Official Elastic helm chart for Metricbeat

About this chart

Metricbeat Helm Chart

This Helm chart is a lightweight way to configure and run our official [Metricbeat Docker image][].

Warning When it comes to running the Elastic on Kubernetes infrastructure, we recommend [Elastic Cloud on Kubernetes][] (ECK) as the best way to run and manage the Elastic Stack.

ECK offers many operational benefits for both our basic-tier and our enterprise-tier customers, such as spinning up cluster nodes that were lost on failed infrastructure, seamless upgrades, rolling cluster changes, and much much more.

With the release of the Elastic Stack Helm charts for Elastic version 8.5.1, we are handing over the ongoing maintenance of our Elastic Stack Helm charts to the community and contributors. This repository will finally be archived after 6 months time. Elastic Stacks deployed on Kubernetes through Helm charts will still be fully supported under EOL limitations.

Since we want to provide an even better experience for our customers by running the Elastic Stack on Kubernetes, we will continue maintaining the Helm charts applicable to ECK Custom Resources. These charts can be found in the [ECK repository][eck-charts].

Helm charts will currently be maintained for ECK Enterprise-tier customers, however, we encourage the community to engage with the existing Helm charts for the Elastic Stack and continue supporting their ongoing maintenance.

See https://github.com/elastic/helm-charts/issues/1731 for more details.

  • Requirements
  • Installing
    • Install a released version using the Helm repository
    • Install development version using main branch
  • Upgrading
  • Usage notes
  • Configuration
  • FAQ
    • How to use Metricbeat with Elasticsearch with security (authentication and TLS) enabled?
    • How to install OSS version of Metricbeat?
    • How to use Kubelet read-only port instead of secure port?
    • Why is Metricbeat host.name field set to Kubernetes pod name?
    • How do I get multiple beats agents working with hostNetworking enabled?
  • Contributing

Requirements

See [supported configurations][] for more details.

Installing

Install a released version using the Helm repository

  • Add the Elastic Helm charts repo: helm repo add elastic https://helm.elastic.co

  • Add the Prometheus community Helm charts repo (required for kube-state-metrics chart dependency): helm repo add prometheus-community https://prometheus-community.github.io/helm-charts

  • Install it: helm install metricbeat elastic/metricbeat

Install development version using main branch

  • Clone the git repo: git clone [email protected]:elastic/helm-charts.git

  • Add the Prometheus community Helm charts repo (required for kube-state-metrics chart dependency): helm repo add prometheus-community https://prometheus-community.github.io/helm-charts

  • Install it: helm install metricbeat ./helm-charts/metricbeat --set imageTag=8.5.1

Upgrading

Please always check [CHANGELOG.md][] and [BREAKING_CHANGES.md][] before upgrading to a new chart version.

Usage notes

  • The default Metricbeat configuration file for this chart is configured to use an Elasticsearch endpoint. Without any additional changes, Metricbeat will send documents to the service URL that the Elasticsearch Helm chart sets up by default. The Elasticsearch credentials are also retrieved from elasticsearch-master-credentials Secret from Elasticsearch chart by default. You may either set the ELASTICSEARCH_HOSTS, ELASTICSEARCH_USER and ELASTICSEARCH_PASSWORD environment variables in extraEnvs to override this or modify the default metricbeatConfig to change this behavior.
  • This chart disables the [HostNetwork][] setting by default for compatibility reasons with the majority of kubernetes providers and scenarios. Some kubernetes providers may not allow enabling hostNetwork and deploying multiple Metricbeat pods on the same node isn't possible with hostNetwork However Metricbeat does recommend activating it. If your kubernetes provider is compatible with hostNetwork and you don't need to run multiple Metricbeat DaemonSets, you can activate it by setting hostNetworking: true in [values.yaml][].
  • This repo includes several [examples][] of configurations that can be used as a reference. They are also used in the automated testing of this chart.

Configuration

ParameterDescriptionDefault
clusterRoleRulesConfigurable [cluster role rules][] that Metricbeat uses to access Kubernetes resourcessee [values.yaml][]
daemonset.annotationsConfigurable [annotations][] for Metricbeat daemonset{}
daemonset.labelsConfigurable [labels][] applied to all Metricbeat DaemonSet pods{}
daemonset.affinityConfigurable [affinity][] for Metricbeat daemonset{}
daemonset.enabledIf true, enable daemonsettrue
daemonset.envFromTemplatable string of envFrom to be passed to the [environment from variables][] which will be appended to Metricbeat container for DaemonSet[]
daemonset.extraEnvsExtra [environment variables][] which will be appended to Metricbeat container for DaemonSetsee [values.yaml][]
daemonset.extraVolumeMountsTemplatable string of additional volumeMounts to be passed to the tpl function or DaemonSet[]
daemonset.extraVolumesTemplatable string of additional volumes to be passed to the tpl function or DaemonSet[]
daemonset.hostAliasesConfigurable [hostAliases][] for Metricbeat DaemonSet[]
daemonset.hostNetworkingEnable Metricbeat DaemonSet to use hostNetworkfalse
daemonset.metricbeatConfigAllows you to add any config files in /usr/share/metricbeat such as metricbeat.yml for Metricbeat DaemonSetsee [values.yaml][]
daemonset.nodeSelectorConfigurable [nodeSelector][] for Metricbeat DaemonSet{}
daemonset.resourcesAllows you to set the [resources][] for Metricbeat DaemonSetsee [values.yaml][]
daemonset.secretMountsAllows you easily mount a secret as a file inside the DaemonSet. Useful for mounting certificates and other secrets. See [values.yaml][] for an example[]
daemonset.securityContextConfigurable [securityContext][] for Metricbeat DaemonSet pod execution environmentsee [values.yaml][]
daemonset.tolerationsConfigurable [tolerations][] for Metricbeat DaemonSet[]
deployment.annotationsConfigurable [annotations][] for Metricbeat Deployment{}
deployment.labelsConfigurable [labels][] applied to all Metricbeat Deployment pods{}
deployment.affinityConfigurable [affinity][] for Metricbeat Deployment{}
deployment.enabledIf true, enable deploymenttrue
deployment.envFromTemplatable string of envFrom to be passed to the [environment from variables][] which will be appended to Metricbeat container for Deployment[]
deployment.extraEnvsExtra [environment variables][] which will be appended to Metricbeat container for Deploymentsee [values.yaml][]
deployment.extraVolumeMountsTemplatable string of additional volumeMounts to be passed to the tpl function or DaemonSet[]
deployment.extraVolumesTemplatable string of additional volumes to be passed to the tpl function or Deployment[]
deployment.hostAliasesConfigurable [hostAliases][] for Metricbeat Deployment[]
deployment.metricbeatConfigAllows you to add any config files in /usr/share/metricbeat such as metricbeat.yml for Metricbeat Deploymentsee [values.yaml][]
deployment.nodeSelectorConfigurable [nodeSelector][] for Metricbeat Deployment{}
deployment.resourcesAllows you to set the [resources][] for Metricbeat Deploymentsee [values.yaml][]
deployment.secretMountsAllows you easily mount a secret as a file inside the Deployment Useful for mounting certificates and other secrets. See [values.yaml][] for an example[]
deployment.securityContextConfigurable [securityContext][] for Metricbeat Deployment pod execution environmentsee [values.yaml][]
deployment.tolerationsConfigurable [tolerations][] for Metricbeat Deployment

Deploy metricbeat with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has metricbeat 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 chartmetricbeat is pinned at v8.5.1 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