elastic-agent

by Elastic Inc.

Helm chartv9.5.7App 9.5.7Elastic-2.0Verified publisherOfficial

Elastic-Agent Helm Chart

About this chart

elastic-agent

Elastic-Agent Helm Chart

This chart simplifies the deployment of Elastic Agent in Kubernetes and features a built-in Kubernetes policy.

Values

1 - Outputs

The outputs section specifies where to send data. You can specify multiple outputs to pair specific inputs with specific outputs.

KeyTypeDefaultDescription
outputsmap[string]OutputObject{ "default" : {} }The key of the map is the name of the output and the value is an object containing the fields below

1.1 - Output Object

The supported types of outputs are:

  • ESPlainAuthBasic: elasticsearch output with the connection details (url, username, password) specified inline the yaml
  • ESPlainAuthAPI: elasticsearch output with the connection details (url, api_key) specified inline the yaml
  • ESSecretAuthBasic: elasticsearch output with the connection details specified in a k8s secret
  • ESSecretAuthAPI: elasticsearch output with the connection details specified in a k8s secret
  • ESECKRef: elasticsearch output that references by name an Elasticsearch cluster managed by ECK operator
  • Logstash: logstash output with connection details (hosts, ssl, loadbalance, etc) specified inline in the yaml
KeyTypeDefaultDescription
outputs.{name}.typestring"ESPlainAuthBasic"type of the output [one of ESPlainAuthBasic, ESPlainAuthAPI, ESSecretAuthBasic, ESSecretAuthAPI, ESECKRef, Logstash]
outputs.{name}.urlstring""url of the output [required for types ESPlainAuthBasic and ESPlainAuthAPI]
outputs.{name}.usernamestring""the username to use to authenticate with the output [required for type ESPlainAuthBasic]
outputs.{name}.passwordstring""the password to use to authenticate with the output [required for type ESPlainAuthBasic]
outputs.{name}.api_keystring""the API key use to authenticate with the output [required for type ESPlainAuthAPI]
outputs.{name}.secretNamestring""the k8s secret to mount output connection details [required for types ESSecretAuthBasic and ESSecretAuthAPI]
outputs.{name}.namestring""name to reference an Elasticsearch cluster managed by ECK [required for type ESECKRef]

The following fields are specific to Logstash. output type:

KeyTypeDefaultExampleDescription
outputs.{name}.hostsstring array""["myhost:5044", "myhost2:5044"]An array of Logstash hosts [required]
outputs.{name}.enabledbooleantruefalseEnables or disables the output. If set to false, the output is disabled.
outputs.{name}.escape_htmlbooleanfalsetrueConfigures escaping of HTML in strings. Set to true to enable escaping.
outputs.{name}.proxy_urlstring"""socks5://username:password@socks5host:2233"The URL of the SOCKS5 proxy to use when connecting to the Logstash servers. The value must be a URL with a scheme of socks5://.
outputs.{name}.enabledbooleanfalsetrueDetermines whether Logstash hostnames are resolved locally when using a proxy. If false and a proxy is used, name resolution occurs on the proxy server.
outputs.{name}.loadbalancebooleanfalsetrueWhether to loadbalance across the logstash hosts
outputs.{name}.ttlstring"0""30s"Time to live for a connection to Logstash after which the connection will be reestablished.
outputs.{name}.slow_startbooleanfalsetrueIf true, only a subset of events in a batch of events is transferred per transaction. The number of events to be sent increases up to bulk_max_size if no error is encountered. On error, the number of events per transaction is reduced again.
outputs.{name}.pipelininginteger25The number of batches to send asynchronously to Logstash while waiting for an ACK from Logstash. The output becomes blocking after the specified number of batches are written. Specify 0 to turn off pipelining.

For Logstash extra fields can be specified inline the yaml following these guidelines:

For all outputs(except ESECKRef) these extra fields can be specified inline the yaml following these guidelines

  • "SSL/TLS Settings" NOTE ssl.certificate_authorities is defined as ssl.certificateAuthorities NOTE ssl.verification_mode is defined as ssl.verificationMode

The following variables can be specified using valueFrom syntax:

  • ssl.certificate
  • ssl.key
  • ssl.key_passphrase
  • ssl.certificateAuthorities

The valueFrom syntax allows you to set a variable two different ways:

variable_name:
    valueFromSecret:
        name: <secret name>
        key: <secret key>

or

variable_name:
    value: "text"

Examples of Helm chart arguments to define an output with name myOutput:

  • ESPlainAuthBasic: --set outputs.myOutput.url=https://elasticsearch:9200 --set outputs.myOutput.username=changeme --set outputs.myOutput.password=changeme
  • ESPlainAuthAPI: --set outputs.myOutput.url=https://elasticsearch:9200 --set outputs.myOutput.api_key=token
  • ESSecretAuthBasic: --set outputs.myOutput.type=ESSecretAuthBasic --set outputs.myOutput.secretName=k8s_secret_name (required keys in the k8s secret are url, username, password)
  • ESSecretAuthAPI: --set outputs.myOutput.type=ESSecretAuthAPI --set outputs.myOutput.secretName=k8s_secret_name (required keys in the k8s secret are url, api_key)
  • ESECKRef: --set outputs.myOutput.type=ESECKRef --set outputs.myOutput.name=eck_es_cluster_name
  • Logstash: --set outputs.myOutput.type=Logstash --set outputs.myOutput.hosts=["myHost:5044"] --set outputs.myOutput.ssl.enabled=true --set-file outputs.myOuput.ssl.certificateAuthorities[0].value=/path/to/ca.crt

2 - Kubernetes integration

The chart built-in kubernetes integration is used to collect logs and metrics from Kubernetes clusters. This integration is capable of fetching metrics from several components:

KeyTypeDefaultDescription
kubernetes.enabledbooltrueenable Kubernetes integration.
kubernetes.onboardingIDstring""Specify the onboarding ID for a quick start flow.
kubernetes.outputstring"default"name of the output used in kubernetes integration. Note that this output needs to be defined in outputs
kubernetes.namespacestring"default"kubernetes namespace
kubernetes.hints.enabledboolfalseenable elastic-agent autodiscovery feature
kubernetes.state.enabledbooltrueintegration global switch to enable state streams based on kube-state-metrics. Note that setting this to false results in overriding and disabling all the respective state streams
kubernetes.state.agentAsSidecar.enabledboolfalseenable ksm autosharding and deploy elastic-agent as a sidecar container. If kube-state-metrics.enabled is set to false this has no effect.
kubernetes.state.agentAsSidecar.resourcesobject{"limits":{"memory":"800Mi"},"requests":{"cpu":"100m","memory":"400Mi"}}resources of the elastic-agent sidecar if agentAsSidecar.enabled is set to true
kubernetes.state.hoststring"kube-state-metrics:8080"host of the kube-state-metrics service. This used only when kube-state-metrics.enabled is set to false.
kubernetes.state.varsobject{}state streams variables such as add_metadata, hosts, period, bearer_token_file. Please note that colliding vars also defined in respective state streams will not be overridden.
kubernetes.metrics.enabledbooltrueintegration global switch to enable metric streams based on kubelet. Note that setting this to false results in overriding and disabling all the respective metric streams
kubernetes.metrics.varsobject{}metric streams variables such as add_metadata, hosts, period, bearer_token_file, ssl.verification_mode. Please note that colliding vars also defined in respective metric streams will not be overridden.
kubernetes.apiserver.enabledbooltrueenable apiserver input
kubernetes.apiserver.varsobject{}apiserver variables such as hosts, period, bearer_token_file, ssl.certificate_authorities.
kubernetes.proxy.enabledboolfalseenable proxy input
kubernetes.proxy.varsobject{}proxy stream variables such as hosts, period.
kubernetes.scheduler.enabledboolfalseenable scheduler input
kubernetes.scheduler.varsobject{}scheduler stream variables such as hosts, period, bearer_token_file, ssl.verification_mode, condition.
kubernetes.controller_manager.enabledboolfalseenable controller_manager input
kubernetes.controller_manager.varsobject{}controller_manager stream variables such as hosts, period, bearer_token_file, ssl.verification_mode, condition.
kubernetes.containers.metrics.enabledbooltrueenable containers metric stream (kubelet) ref
kubernetes.containers.metrics.varsobject{}containers metric stream vars
kubernetes.containers.state.enabledbooltrueenable containers state stream (kube-state-metrics) ref
kubernetes.containers.state.varsobject{}containers state stream vars
kubernetes.containers.logs.enabledbooltrueenable containers logs stream ref
kubernetes.containers.logs.rotated_logsboolfalseBETA: enable rotated logs ingestion. WARNING: enabling it might cause date re-ingestion on existing deployments. ref
kubernetes.containers.logs.varsobject{}containers logs stream vars
kubernetes.containers.audit_logs.enabledboolfalseenable containers audit logs stream ref
kubernetes.pods.metrics.enabledbooltrueenable pods metric stream (kubelet) ref
kubernetes.pods.metrics.varsobject{}pod metric stream vars
kubernetes.pods.state.enabledbooltrueenable pods state stream (kube-state-metrics) ref
kubernetes.pods.state.varsobject{}pods state stream vars
kubernetes.deployments.state.enabledbooltrueenable deployments state stream (kube-state-metrics) ref
kubernetes.deployments.state.varsobject{}deployments state stream vars
kubernetes.statefulsets.state.enabledbooltrueenable statefulsets state stream (kube-state-metrics) ref
kubernetes.statefulsets.state.varsobject{}statefulsets state stream vars
kubernetes.daemonsets.state.enabledbooltrueenable daemonsets state stream (kube-state-metrics) ref
kubernetes.daemonsets.state.varsobject{}daemonsets state stream vars
kubernetes.replicasets.state.enabledbooltrueenable replicasets state stream (kube-state-metrics) [ref](https://www.elastic.co/docs/current/in

Deploy elastic-agent with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has elastic-agent 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 chartelastic-agent is pinned at v9.5.7 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