-
Notifications
You must be signed in to change notification settings - Fork 179
Move the “Providers" docs out of the standalone Elastic Agent docs #3919
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 7 commits
ab09846
f3c495e
2487410
a1a3d0e
3e77779
93df482
afbfe8f
016e30e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,25 +1,68 @@ | ||
| --- | ||
| navigation_title: Providers | ||
| navigation_title: Agent providers | ||
| mapped_pages: | ||
| - https://www.elastic.co/guide/en/fleet/current/providers.html | ||
| applies_to: | ||
| stack: ga | ||
| products: | ||
| - id: fleet | ||
| - id: elastic-agent | ||
| --- | ||
|
|
||
| # Configure providers for standalone {{agent}}s [providers] | ||
| # {{agent}} providers [providers] | ||
|
|
||
| Providers supply key-value pairs for variable substitution and conditional logic. In other words, they define dynamic values {{agent}} can use when building configurations. | ||
|
|
||
| Providers supply the key-value pairs that are used for variable substitution and conditionals. Each provider’s keys are automatically prefixed with the name of the provider in the context of the {{agent}}. | ||
| Each provider’s keys are automatically grouped under the provider name within the {{agent}} context. For example, if the `foo` provider supplies `{"key1": "value1", "key2": "value2"}`, {{agent}} stores these key-value pairs as `{"foo": {"key1": "value1", "key2": "value2"}}`. | ||
| You can then reference the values using the `${foo.key1}` and `${foo.key2}` variables. | ||
|
|
||
| For example, a provider named `foo` provides `{"key1": "value1", "key2": "value2"}`, the key-value pairs are placed in `{"foo" : {"key1": "value1", "key2": "value2"}}`. To reference the keys, use `{{foo.key1}}` and `{{foo.key2}}`. | ||
| How you can configure and use {{agent}} providers depends on whether you're running a standalone or a {{fleet}}-managed {{agent}}. For more information, refer to: | ||
|
|
||
| * [Configure providers on standalone {{agent}}](#configure-providers-standalone-agent) | ||
| * [Using providers on {{fleet}}-managed {{agent}}](#using-providers-fleet-managed-agent) | ||
|
|
||
| ## Provider configuration [_provider_configuration] | ||
|
|
||
| The provider configuration is specified under the top-level `providers` key in the `elastic-agent.yml` configuration. All registered providers are enabled by default. If a provider cannot connect, no mappings are produced. | ||
| ## Provider types | ||
|
|
||
| The following example shows two providers (`local` and `local_dynamic`) that supply custom keys: | ||
| {{agent}} supports two types of providers: [context](#context-providers) and [dynamic](#dynamic-providers). | ||
|
|
||
|
|
||
| ### Context providers [context-providers] | ||
|
|
||
| Context providers supply the current context of the running {{agent}} such as agent information (ID, version), host information (hostname, IP addresses), and environment information (environment variables). | ||
|
|
||
| These providers supply only a single key-value mapping. They are generally static, although this is not required. If the key's value changes, the entire configuration is re-evaluated. | ||
vishaangelova marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| To ensure consistency and clarity across documentation and projects, context providers use the {{product.ecs}} naming conventions. | ||
|
|
||
| {{agent}} supports the following context providers: | ||
|
|
||
| * [Local provider](/reference/fleet/local-provider.md) - Provides custom keys to use as variables. | ||
| * [Agent provider](/reference/fleet/agent-provider.md) - Provides information about the {{agent}} such as ID, version, and build details. | ||
| * [Host provider](/reference/fleet/host-provider.md) - Provides information about the current host such as hostname, IP addresses, platform, and architecture. | ||
| * [Env provider](/reference/fleet/env-provider.md) - Provides access to environment variables as key-value pairs. | ||
| * [{{k8s}} Secrets provider](/reference/fleet/kubernetes_secrets-provider.md) - Provides access to the {{k8s}} Secrets API. | ||
| * [{{k8s}} LeaderElection provider](/reference/fleet/kubernetes_leaderelection-provider.md) - Enables leader election between {{agent}} instances running on {{k8s}} to ensure only one agent holds the leader lock. | ||
|
|
||
|
|
||
| ### Dynamic providers [dynamic-providers] | ||
|
|
||
| Dynamic providers supply an array of multiple key-value mappings. Each key-value mapping is combined with the previous context provider’s key and value mapping which provides a new unique mapping that is used to generate a configuration. | ||
|
||
|
|
||
| {{agent}} supports the following dynamic providers: | ||
|
|
||
| * [Local dynamic provider](/reference/fleet/local-dynamic-provider.md) - Defines multiple key-value pairs to generate multiple configurations. | ||
| * [Docker provider](/reference/fleet/docker-provider.md) - Provides Docker container metadata such as ID, name, image, and labels. | ||
| * [{{k8s}} provider](/reference/fleet/kubernetes-provider.md) - Provides metadata from {{k8s}} resources such as pods, nodes, and services. | ||
|
|
||
|
|
||
| ## Configure providers on standalone {{agent}} [configure-providers-standalone-agent] | ||
|
|
||
| On standalone {{agent}}, providers can be configured through the top-level `providers` key in the `elastic-agent.yml` configuration file. By default, all providers are enabled, but {{agent}} runs them only if they are referenced in the configuration file or in an {{agent}} policy. Disabled providers are not run even if they are referenced. If a provider cannot connect, no mappings are produced. | ||
|
|
||
| You can enable, disable, and configure provider settings as needed. All providers are prefixed without name collisions. In the configuration, the name of the provider is in the key. | ||
|
|
||
| The following example shows two providers (`local` and `local_dynamic`) that supply custom keys on a standalone {{agent}}: | ||
|
|
||
| ```yaml | ||
| providers: | ||
|
|
@@ -36,53 +79,22 @@ providers: | |
| item: key3 | ||
| ``` | ||
|
|
||
| Providers are enabled automatically if a provider is referenced in an {{agent}} policy. All providers are prefixed without name collisions. The name of the provider is in the key in the configuration. | ||
| If a provider is referenced in an {{agent}} policy, it is turned on automatically unless it's explicitly disabled in the `elastic-agent.yml` configuration file. | ||
|
|
||
|
|
||
| ### Disable providers [disable-providers-by-default] | ||
|
|
||
| On standalone {{agent}}, you can disable a specific provider, so it cannot be run even if it is referenced. For example, to disable the Docker provider on a standalone {{agent}}, set: | ||
|
|
||
| ```yaml | ||
| providers: | ||
| docker: | ||
| enabled: false | ||
| ``` | ||
|
|
||
| {{agent}} supports two broad types of providers: [context](#context-providers) and [dynamic](#dynamic-providers). | ||
|
|
||
| With this setting, {{agent}} will not run the Docker provider even if it's referenced in an {{agent}} policy. | ||
|
|
||
| ### Context providers [context-providers] | ||
|
|
||
| Context providers give the current context of the running {{agent}}, for example, agent information (ID, version), host information (hostname, IP addresses), and environment information (environment variables). | ||
|
|
||
| They can only provide a single key-value mapping. Think of them as singletons; an update of a key-value mapping results in a re-evaluation of the entire configuration. These providers are normally very static, but not required. A value can change which results in re-evaluation. | ||
|
|
||
| Context providers use the Elastic Common Schema (ECS) naming to ensure consistency and understanding throughout documentation and projects. | ||
|
|
||
| {{agent}} supports the following context providers: | ||
|
|
||
| * [Local](/reference/fleet/local-provider.md) | ||
| * [Agent Provider](/reference/fleet/agent-provider.md) | ||
| * [Host Provider](/reference/fleet/host-provider.md) | ||
| * [Env Provider](/reference/fleet/env-provider.md) | ||
| * [Kubernetes Secrets Provider](/reference/fleet/kubernetes_secrets-provider.md) | ||
| * [Kubernetes Leader Election Provider](/reference/fleet/kubernetes_leaderelection-provider.md) | ||
|
|
||
|
|
||
| ### Dynamic Providers [dynamic-providers] | ||
|
|
||
| Dynamic providers give an array of multiple key-value mappings. Each key-value mapping is combined with the previous context provider’s key and value mapping which provides a new unique mapping that is used to generate a configuration. | ||
|
|
||
| {{agent}} supports the following context providers: | ||
|
|
||
| * [Local Dynamic Provider](/reference/fleet/local-dynamic-provider.md) | ||
| * [Docker Provider](/reference/fleet/docker-provider.md) | ||
| * [Kubernetes Provider](/reference/fleet/kubernetes-provider.md) | ||
|
|
||
|
|
||
| ### Disabling Providers By Default [disable-providers-by-default] | ||
|
|
||
| All registered providers are disabled by default until they are referenced in a policy. | ||
|
|
||
| You can disable all providers even if they are referenced in a policy by setting `agent.providers.initial_default: false`. | ||
|
|
||
| The following configuration disables all providers from running except for the docker provider, if it becomes referenced in the policy: | ||
| You can also disable all providers by setting `agent.providers.initial_default: false`. The following configuration disables all providers with the exception of the Docker provider, which is run when it's referenced in the policy: | ||
|
|
||
| ```yaml | ||
| agent.providers.initial_default: false | ||
|
|
@@ -92,11 +104,8 @@ providers: | |
| ``` | ||
|
|
||
|
|
||
| ## Using providers on {{fleet}}-managed {{agent}} [using-providers-fleet-managed-agent] | ||
|
|
||
| On {{fleet}}-managed {{agent}}, you can use provider variables in integration policy settings (for example, `${host.name}`, `${env.foo}`, `${agent.id}`), but you cannot add a `providers` configuration block directly through the {{fleet}} UI. | ||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
| Some providers can be configured on {{k8s}} deployments using ConfigMaps. For more details, refer to [Advanced {{agent}} configuration managed by {{fleet}}](/reference/fleet/advanced-kubernetes-managed-by-fleet.md). | ||
Uh oh!
There was an error while loading. Please reload this page.