- Fleet and Elastic Agent Guide: other versions:
- Fleet and Elastic Agent overview
- Beats and Elastic Agent capabilities
- Quick starts
- Migrate from Beats to Elastic Agent
- Deployment models
- Install Elastic Agents
- Install Fleet-managed Elastic Agents
- Install standalone Elastic Agents
- Install Elastic Agents in a containerized environment
- Run Elastic Agent in a container
- Run Elastic Agent on Kubernetes managed by Fleet
- Install Elastic Agent on Kubernetes using Helm
- Example: Install standalone Elastic Agent on Kubernetes using Helm
- Example: Install Fleet-managed Elastic Agent on Kubernetes using Helm
- Advanced Elastic Agent configuration managed by Fleet
- Configuring Kubernetes metadata enrichment on Elastic Agent
- Run Elastic Agent on GKE managed by Fleet
- Run Elastic Agent on Amazon EKS managed by Fleet
- Run Elastic Agent on Azure AKS managed by Fleet
- Run Elastic Agent Standalone on Kubernetes
- Scaling Elastic Agent on Kubernetes
- Using a custom ingest pipeline with the Kubernetes Integration
- Environment variables
- Run Elastic Agent as an OTel Collector
- Run Elastic Agent without administrative privileges
- Install Elastic Agent from an MSI package
- Installation layout
- Air-gapped environments
- Using a proxy server with Elastic Agent and Fleet
- Uninstall Elastic Agents from edge hosts
- Start and stop Elastic Agents on edge hosts
- Elastic Agent configuration encryption
- Secure connections
- Manage Elastic Agents in Fleet
- Configure standalone Elastic Agents
- Create a standalone Elastic Agent policy
- Structure of a config file
- Inputs
- Providers
- Outputs
- SSL/TLS
- Logging
- Feature flags
- Agent download
- Config file examples
- Grant standalone Elastic Agents access to Elasticsearch
- Example: Use standalone Elastic Agent with Elastic Cloud Serverless to monitor nginx
- Example: Use standalone Elastic Agent with Elasticsearch Service to monitor nginx
- Debug standalone Elastic Agents
- Kubernetes autodiscovery with Elastic Agent
- Monitoring
- Reference YAML
- Manage integrations
- Package signatures
- Add an integration to an Elastic Agent policy
- View integration policies
- Edit or delete an integration policy
- Install and uninstall integration assets
- View integration assets
- Set integration-level outputs
- Upgrade an integration
- Managed integrations content
- Best practices for integration assets
- Data streams
- Define processors
- Processor syntax
- add_cloud_metadata
- add_cloudfoundry_metadata
- add_docker_metadata
- add_fields
- add_host_metadata
- add_id
- add_kubernetes_metadata
- add_labels
- add_locale
- add_network_direction
- add_nomad_metadata
- add_observer_metadata
- add_process_metadata
- add_tags
- community_id
- convert
- copy_fields
- decode_base64_field
- decode_cef
- decode_csv_fields
- decode_duration
- decode_json_fields
- decode_xml
- decode_xml_wineventlog
- decompress_gzip_field
- detect_mime_type
- dissect
- dns
- drop_event
- drop_fields
- extract_array
- fingerprint
- include_fields
- move_fields
- parse_aws_vpc_flow_log
- rate_limit
- registered_domain
- rename
- replace
- script
- syslog
- timestamp
- translate_sid
- truncate_fields
- urldecode
- Command reference
- Troubleshoot
- Release notes
Advanced Elastic Agent configuration managed by Fleet
editAdvanced Elastic Agent configuration managed by Fleet
editFor basic Elastic Agent managed by Fleet scenarios follow the steps in Run Elastic Agent on Kubernetes managed by Fleet.
On managed Elastic Agent installations it can be useful to provide the ability to configure more advanced options, such as the configuration of providers during the startup. Refer to Providers for more details.
Following steps demonstrate above scenario:
Step 1: Download the Elastic Agent manifest
editIt is advisable to follow the steps of Install Fleet-managed Elastic Agents with Kubernetes Integration installed in your policy and download the Elastic Agent manifest from Kibana UI

- Notes
- Sample manifests can also be found here
Step 2: Create a new configmap
editCreate a new configmap.
apiVersion: v1 kind: ConfigMap metadata: name: agent-node-datastreams namespace: kube-system labels: k8s-app: elastic-agent data: agent.yml: |- providers.kubernetes_leaderelection.enabled: false fleet.enabled: true fleet.access_token: "<FLEET_ENROLLMENT_TOKEN>" ---
- Notes
-
-
In the above example the disablement of
kubernetes_leaderelection
provider is demonstrated. Same procedure can be followed for alternative scenarios.
-
In the above example the disablement of
Example of configmap to configure kubernetes metadata enrichment.
apiVersion: v1 kind: ConfigMap metadata: name: agent-node-datastreams namespace: kube-system labels: k8s-app: elastic-agent data: agent.yml: |- providers.kubernetes: add_resource_metadata: deployment: true cronjob: true fleet.enabled: true fleet.access_token: "<FLEET_ENROLLMENT_TOKEN>" ---
- Find more information about Enrollment Tokens.
Step 3: Configure Daemonset
editInside the downloaded manifest, update the Daemonset resource:
Update entrypoint.
containers: - name: elastic-agent image: docker.elastic.co/elastic-agent/elastic-agent: <ImageVersion> args: ["-c", "/etc/elastic-agent/agent.yml", "-e"]
- Notes
-
The <ImageVersion> is just a placeholder for the elastic-agent image version that you will download in your manifest: eg.
image: docker.elastic.co/elastic-agent/elastic-agent: 8.11.0
Important thing is to update your manifest with args details
Add extra Volume Mount.
volumeMounts: - name: datastreams mountPath: /etc/elastic-agent/agent.yml readOnly: true subPath: agent.yml
Add new Volume.
volumes: - name: datastreams configMap: defaultMode: 0640 name: agent-node-datastreams
Important Notes
edit-
By default the manifests for Elastic Agent managed by Fleet have
hostNetwork:true
. In order to support multiple installations of Elastic Agents in the same node you should sethostNetwork:false
. See this relevant example as described in Elastic Agent Manifests in order to support Kube-State-Metrics Sharding. -
The volume
/usr/share/elastic-agent/state
must remain mounted in elastic-agent-managed-kubernetes.yaml, otherwise custom config map provided above will be overwritten.
On this page