elastic-agent
by Elastic Inc.
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.
| Key | Type | Default | Description |
|---|---|---|---|
| outputs | map[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:elasticsearchoutput with the connection details (url, username, password) specified inline the yamlESPlainAuthAPI:elasticsearchoutput with the connection details (url, api_key) specified inline the yamlESSecretAuthBasic:elasticsearchoutput with the connection details specified in a k8s secretESSecretAuthAPI:elasticsearchoutput with the connection details specified in a k8s secretESECKRef:elasticsearchoutput that references by name an Elasticsearch cluster managed by ECK operatorLogstash:logstashoutput with connection details (hosts, ssl, loadbalance, etc) specified inline in the yaml
| Key | Type | Default | Description |
|---|---|---|---|
| outputs.{name}.type | string | "ESPlainAuthBasic" | type of the output [one of ESPlainAuthBasic, ESPlainAuthAPI, ESSecretAuthBasic, ESSecretAuthAPI, ESECKRef, Logstash] |
| outputs.{name}.url | string | "" | url of the output [required for types ESPlainAuthBasic and ESPlainAuthAPI] |
| outputs.{name}.username | string | "" | the username to use to authenticate with the output [required for type ESPlainAuthBasic] |
| outputs.{name}.password | string | "" | the password to use to authenticate with the output [required for type ESPlainAuthBasic] |
| outputs.{name}.api_key | string | "" | the API key use to authenticate with the output [required for type ESPlainAuthAPI] |
| outputs.{name}.secretName | string | "" | the k8s secret to mount output connection details [required for types ESSecretAuthBasic and ESSecretAuthAPI] |
| outputs.{name}.name | string | "" | name to reference an Elasticsearch cluster managed by ECK [required for type ESECKRef] |
The following fields are specific to Logstash. output type:
| Key | Type | Default | Example | Description |
|---|---|---|---|---|
| outputs.{name}.hosts | string array | "" | ["myhost:5044", "myhost2:5044"] | An array of Logstash hosts [required] |
| outputs.{name}.enabled | boolean | true | false | Enables or disables the output. If set to false, the output is disabled. |
| outputs.{name}.escape_html | boolean | false | true | Configures escaping of HTML in strings. Set to true to enable escaping. |
| outputs.{name}.proxy_url | string | "" | "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}.enabled | boolean | false | true | Determines 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}.loadbalance | boolean | false | true | Whether to loadbalance across the logstash hosts |
| outputs.{name}.ttl | string | "0" | "30s" | Time to live for a connection to Logstash after which the connection will be reestablished. |
| outputs.{name}.slow_start | boolean | false | true | If 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}.pipelining | integer | 2 | 5 | The 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=changemeESPlainAuthAPI:--set outputs.myOutput.url=https://elasticsearch:9200 --set outputs.myOutput.api_key=tokenESSecretAuthBasic:--set outputs.myOutput.type=ESSecretAuthBasic --set outputs.myOutput.secretName=k8s_secret_name(required keys in the k8s secret areurl,username,password)ESSecretAuthAPI:--set outputs.myOutput.type=ESSecretAuthAPI --set outputs.myOutput.secretName=k8s_secret_name(required keys in the k8s secret areurl,api_key)ESECKRef:--set outputs.myOutput.type=ESECKRef --set outputs.myOutput.name=eck_es_cluster_nameLogstash:--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:
| Key | Type | Default | Description |
|---|---|---|---|
| kubernetes.enabled | bool | true | enable Kubernetes integration. |
| kubernetes.onboardingID | string | "" | Specify the onboarding ID for a quick start flow. |
| kubernetes.output | string | "default" | name of the output used in kubernetes integration. Note that this output needs to be defined in outputs |
| kubernetes.namespace | string | "default" | kubernetes namespace |
| kubernetes.hints.enabled | bool | false | enable elastic-agent autodiscovery feature |
| kubernetes.state.enabled | bool | true | integration 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.enabled | bool | false | enable 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.resources | object | {"limits":{"memory":"800Mi"},"requests":{"cpu":"100m","memory":"400Mi"}} | resources of the elastic-agent sidecar if agentAsSidecar.enabled is set to true |
| kubernetes.state.host | string | "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.vars | object | {} | 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.enabled | bool | true | integration 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.vars | object | {} | 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.enabled | bool | true | enable apiserver input |
| kubernetes.apiserver.vars | object | {} | apiserver variables such as hosts, period, bearer_token_file, ssl.certificate_authorities. |
| kubernetes.proxy.enabled | bool | false | enable proxy input |
| kubernetes.proxy.vars | object | {} | proxy stream variables such as hosts, period. |
| kubernetes.scheduler.enabled | bool | false | enable scheduler input |
| kubernetes.scheduler.vars | object | {} | scheduler stream variables such as hosts, period, bearer_token_file, ssl.verification_mode, condition. |
| kubernetes.controller_manager.enabled | bool | false | enable controller_manager input |
| kubernetes.controller_manager.vars | object | {} | controller_manager stream variables such as hosts, period, bearer_token_file, ssl.verification_mode, condition. |
| kubernetes.containers.metrics.enabled | bool | true | enable containers metric stream (kubelet) ref |
| kubernetes.containers.metrics.vars | object | {} | containers metric stream vars |
| kubernetes.containers.state.enabled | bool | true | enable containers state stream (kube-state-metrics) ref |
| kubernetes.containers.state.vars | object | {} | containers state stream vars |
| kubernetes.containers.logs.enabled | bool | true | enable containers logs stream ref |
| kubernetes.containers.logs.rotated_logs | bool | false | BETA: enable rotated logs ingestion. WARNING: enabling it might cause date re-ingestion on existing deployments. ref |
| kubernetes.containers.logs.vars | object | {} | containers logs stream vars |
| kubernetes.containers.audit_logs.enabled | bool | false | enable containers audit logs stream ref |
| kubernetes.pods.metrics.enabled | bool | true | enable pods metric stream (kubelet) ref |
| kubernetes.pods.metrics.vars | object | {} | pod metric stream vars |
| kubernetes.pods.state.enabled | bool | true | enable pods state stream (kube-state-metrics) ref |
| kubernetes.pods.state.vars | object | {} | pods state stream vars |
| kubernetes.deployments.state.enabled | bool | true | enable deployments state stream (kube-state-metrics) ref |
| kubernetes.deployments.state.vars | object | {} | deployments state stream vars |
| kubernetes.statefulsets.state.enabled | bool | true | enable statefulsets state stream (kube-state-metrics) ref |
| kubernetes.statefulsets.state.vars | object | {} | statefulsets state stream vars |
| kubernetes.daemonsets.state.enabled | bool | true | enable daemonsets state stream (kube-state-metrics) ref |
| kubernetes.daemonsets.state.vars | object | {} | daemonsets state stream vars |
| kubernetes.replicasets.state.enabled | bool | true | enable 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.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartelastic-agent is pinned at v9.5.7 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- 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