From 59db5d8b0f7323805c495bfe9d0a591af8724252 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edu=20Gonz=C3=A1lez=20de=20la=20Herr=C3=A1n?= <25320357+eedugon@users.noreply.github.com> Date: Tue, 6 May 2025 12:13:25 +0200 Subject: [PATCH 01/14] Fleet managed agent installation through helm updated --- ...ple-kubernetes-fleet-managed-agent-helm.md | 132 ++++++++++++------ reference/fleet/toc.yml | 5 +- 2 files changed, 94 insertions(+), 43 deletions(-) diff --git a/reference/fleet/example-kubernetes-fleet-managed-agent-helm.md b/reference/fleet/example-kubernetes-fleet-managed-agent-helm.md index 28ed264d9..3dfcd5888 100644 --- a/reference/fleet/example-kubernetes-fleet-managed-agent-helm.md +++ b/reference/fleet/example-kubernetes-fleet-managed-agent-helm.md @@ -5,31 +5,71 @@ mapped_pages: # Example: Install Fleet-managed Elastic Agent on Kubernetes using Helm [example-kubernetes-fleet-managed-agent-helm] -::::{warning} -This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. -:::: +This example demonstrates how to install a {{fleet}}-managed {{agent}} on a {{k8s}} system using a Helm chart, collect {{k8s}} metrics and logs using the [Kubernetes Integration](integration-docs://reference/kubernetes/index.md), and send the data to an {{es}} cluster in {{ecloud}} for visualization in {{kib}}. +For an overview of the {{agent}} Helm chart and its benefits, refer to [Install {{agent}} on Kubernetes using Helm](/reference/fleet/install-on-kubernetes-using-helm.md). -This example demonstrates how to install {{fleet}}-managed {{agent}} on a {{k8s}} system using a Helm chart, gather {{k8s}} metrics and send them to an {{es}} cluster in {{ecloud}}, and then view visualizations of those metrics in {{kib}}. +::::{note} +This guide deploys a single set of {{agent}} DaemonSet pods to collect all metrics, which works well for small to medium-sized {{k8s}} clusters. -For an overview of the {{agent}} Helm chart and its benefits, refer to [Install {{agent}} on Kubernetes using Helm](/reference/fleet/install-on-kubernetes-using-helm.md). +For larger clusters, or when kube-state-metrics (KSM) metrics collection becomes a performance bottleneck, we recommend a more scalable architecture: move the KSM metric collection to a separate set of agents deployed as sidecars alongside KSM, with autosharding enabled. + +This can be easily implemented with the Helm chart. For details, refer to the [KSM autosharding example](https://github.com/elastic/elastic-agent/tree/main/deploy/helm/elastic-agent/examples/fleet-managed-ksm-sharding). +:::: This guide takes you through these steps: +* [Set up Helm repository](#preparations) * [Install {{agent}}](#agent-fleet-managed-helm-example-install-agent) * [Install the Kubernetes integration](#agent-fleet-managed-helm-example-install-integration) * [Tidy up](#agent-fleet-managed-helm-example-tidy-up) - ## Prerequisites [agent-fleet-managed-helm-example-prereqs] To get started, you need: * A local install of the [Helm](https://helm.sh/) {{k8s}} package manager. -* An [{{ecloud}}](https://cloud.elastic.co/registration?page=docs&placement=docs-body) hosted {{es}} cluster on version 8.16 or higher. +* An [{{ecloud}}](https://cloud.elastic.co/registration?page=docs&placement=docs-body) hosted {{es}} cluster on version 8.18 or higher, with an [Integrations Server](/deploy-manage/deploy/elastic-cloud/ec-customize-deployment-components.md#ec_integrations_server.md) component included. * An active {{k8s}} cluster. -* A local clone of the [elastic/elastic-agent](https://github.com/elastic/elastic-agent/tree/8.16) GitHub repository. Make sure to use the `8.16` branch to ensure that {{agent}} has full compatibility with the Helm chart. +## Installation overview + +The default installation shown in this example deploys the following components to monitor your Kubernetes cluster: + +* {{agent}}, deployed as a `DaemonSet`, connected to {{fleet}}, and configured to collect: + * Host level metrics and logs through the [System Integration](integration-docs://reference/system/index.md). + * Kubernetes node and cluster-level metrics and logs through the [Kubernetes Integration](integration-docs://reference/kubernetes/index.md). For cluster-level metrics collection, one of the agents will act as a [leader](./kubernetes_leaderelection-provider.md). +* A default installation of `kube-state-metrics` (KSM), configured as a dependency of the chart. KSM is required by the Kubernetes integration to collect cluster-level metrics. + +By default, all resources are installed in the namespace defined by your current `kubectl` context. You can override this by specifying a different namespace using the `--namespace` option during installation. + +% we will uncomment the next line when the use cases are documented in the landing page :) +% For other architectures and use cases, refer to [Advanced use cases](./install-on-kubernetes-using-helm.md#advanced-use-cases). + +## Preparations [preparations] + +Before installing, add the Elastic Helm repository and verify the available versions of the `elastic-agent` chart. If the repository is already configured, run `helm repo update` to ensure you have the latest package information. + +1. Set up Helm repository: + + ```sh + helm repo add elastic https://helm.elastic.co/ + helm repo update + ``` + +2. Verify chart versions: + + ```sh + helm search repo elastic-agent --versions + ``` + + The previous command returns something similar to: + + ```sh + NAME CHART VERSION APP VERSION DESCRIPTION + elastic/elastic-agent 9.0.0 9.0.0 Elastic-Agent Helm Chart + elastic/elastic-agent 8.18.0 8.18.0 Elastic-Agent Helm Chart + ``` ## Install {{agent}} [agent-fleet-managed-helm-example-install-agent] @@ -38,45 +78,49 @@ To get started, you need: 3. In the **Add agent** UI, specify a policy name and select **Create policy**. Leave the **Collect system logs and metrics** option selected. 4. Scroll down in the **Add agent** flyout to the **Install Elastic Agent on your host** section. 5. Select the **Linux TAR** tab and copy the values for `url` and `enrollment-token`. You’ll use these when you run the `helm install` command. -6. Open a terminal shell and change into a directory in your local clone of the `elastic-agent` repo. -7. Copy this command. +6. Open a terminal shell on your local system where the Helm tool is installed and you have access to the {{k8s}} cluster. +7. Copy and prepare the command to install the chart: ```sh - helm install demo ./deploy/helm/elastic-agent \ + helm install demo elastic/elastic-agent \ --set agent.fleet.enabled=true \ - --set agent.fleet.url= \ - --set agent.fleet.token= \ + --set agent.fleet.url= \ # Substitute Fleet-URL with the URL that you copied earlier + --set agent.fleet.token= \ # Substitute Fleet-token with the enrollment token that you copied earlier. --set agent.fleet.preset=perNode ``` Note that the command has these properties: - * `helm install` runs the Helm CLI install tool. - * `demo` gives a name to the installed chart. You can choose any name. - * `./deploy/helm/elastic-agent` is a local path to the Helm chart to install (in time it’s planned to have a public URL for the chart). - * `--set agent.fleet.enabled=true` enables {{fleet}}-managed {{agent}}. The CLI parameter overrides the default `false` value for `agent.fleet.enabled` in the {{agent}} [values.yaml](https://github.com/elastic/elastic-agent/blob/main/deploy/helm/elastic-agent/values.yaml) file. - * `--set agent.fleet.url=` sets the address where {{agent}} will connect to {{fleet}} in your {{ecloud}} deployment, over port 443 (again, overriding the value set by default in the {{agent}} [values.yaml](https://github.com/elastic/elastic-agent/blob/main/deploy/helm/elastic-agent/values.yaml) file). - * `--set agent.fleet.token=` sets the enrollment token that {{agent}} uses to authenticate with {{fleet}}. - * `--set agent.fleet.preset=perNode` enables {{k8s}} metrics on `per node` basis. You can alternatively set cluster wide metrics (`clusterWide`) or kube-state-metrics (`ksmSharded`). - - ::::{tip} - For a full list of all available YAML settings and descriptions, refer to the [{{agent}} Helm Chart Readme](https://github.com/elastic/elastic-agent/tree/main/deploy/helm/elastic-agent). - :::: - -8. Update the command to replace: - - 1. `` with the URL that you copied earlier. - 2. `` with the enrollment token that you copied earlier. - - After your updates, the command should look something like this: + * `helm install`: Runs the Helm CLI install tool. Use `helm upgrade` to modify or update an existing release. + * `demo`: The name for this specific installation of the chart, known as the **release name**. You can choose any name you like. + * `elastic/elastic-agent`: The name of the chart to install, using the format `/`. + * `--set agent.fleet.enabled=true`: Enables {{fleet}}-managed {{agent}}, which is disabled (`false`) by default. + * `--set agent.fleet.url=`: Specifies the address where {{agent}} connects to {{fleet}} Server in your {{ecloud}} deployment. + * `--set agent.fleet.token=`: Sets the enrollment token that {{agent}} uses to authenticate with {{fleet}} Server. + * `--set agent.fleet.preset=perNode`: Runs the agent as a `DaemonSet`, to collect node-level metrics and logs. Refer to [](install-on-kubernetes-using-helm.md) for more details and use cases for this parameter. + + ::::{tip} + For a full list of all available values settings and descriptions, refer to the [{{agent}} Helm Chart Readme](https://github.com/elastic/elastic-agent/tree/main/deploy/helm/elastic-agent) and default [values.yaml](https://github.com/elastic/elastic-agent/blob/main/deploy/helm/elastic-agent/values.yaml). + + The following options could be useful for special use cases: + * `--namespace `: Allows to install all resources in a specific namespace. + * `--version `: Installs a specific version of the Helm chart and {{agent}}. Refer to [Preparations](#preparations) to check available versions. + * `--set agent.version=`: Installs a specific version of {{agent}}. By default, the chart installs the agent version that matches its own. + * `--set-file agent.fleet.ca.value=/local-path/to/fleet-ca.crt`: Provides the CA certificate used by the {{fleet}} Server. This is typically needed when the server uses a certificate signed by a private CA. Not required for {{fleet}} Servers running on {{ecloud}}. + * `--set agent.fleet.insecure=true`: Use this option to skip the {{fleet}} certificate verification if your {{fleet}} Server uses a self-signed certificate, such as when installed in quickstart mode. Not required for {{fleet}} Servers running on {{ecloud}}. Note that this option is not recommended for production environments. + * `--set kube-state-metrics.enabled=false`: In case you already have KSM installed in your cluster, and you don't want to install a second instance. + * `--set kube-state-metrics.fullnameOverride=ksm`: If you want to deploy KSM with a different release name (it defaults to `kube-state-metrics`). This can be useful if you have already a default installation of KSM and you want a second one. + :::: + +8. After your updates, the command should be similar to: - ```sh - helm install demo ./deploy/helm/elastic-agent \ - --set agent.fleet.enabled=true \ - --set agent.fleet.url=https://256575858845283fxxxxxxxd5265d2b4.fleet.us-central1.gcp.foundit.no:443 \ - --set agent.fleet.token=eSVvFDUvSUNPFldFdhhZNFwvS5xxxxxxxxxxxxFEWB1eFF1YedUQ1NWFXwr== \ - --set agent.fleet.preset=perNode - ``` + ```sh + helm install demo elastic/elastic-agent \ + --set agent.fleet.enabled=true \ + --set agent.fleet.url=https://256575858845283fxxxxxxxd5265d2b4.fleet.us-central1.gcp.foundit.no:443 \ + --set agent.fleet.token=eSVvFDUvSUNPFldFdhhZNFwvS5xxxxxxxxxxxxFEWB1eFF1YedUQ1NWFXwr== \ + --set agent.fleet.preset=perNode + ``` 9. Run the command. @@ -112,8 +156,6 @@ To get started, you need: :screenshot: ::: - - ## Install the Kubernetes integration [agent-fleet-managed-helm-example-install-integration] Now that you’ve {{agent}} and data is flowing, you can set up the {{k8s}} integration. @@ -123,7 +165,13 @@ Now that you’ve {{agent}} and data is flowing, you can set up the {{k8s}} inte 3. On the {{k8s}} integration page, click **Add Kubernetes** to add the integration to your {{agent}} policy. 4. Scroll to the bottom of **Add Kubernetes integration** page. Under **Where to add this integration?** select the **Existing hosts** tab. On the **Agent policies** menu, select the agent policy that you created previously in the [Install {{agent}}](#agent-fleet-managed-helm-example-install-agent) steps. - You can leave all of the other integration settings at their default values. + You can leave all of the other integration settings at their default values. For details about the available inputs and data sets, refer to the [Kubernetes Integration](integration-docs://reference/kubernetes/index.md) documentation. + + ::::{important} + All inputs under the **Collect Kubernetes metrics from kube-state-metrics** section default to `kube-state-metrics:8080` as the destination host. This works if you deployed KSM (kube-state-metrics) alongside {{agent}} during the chart installation, which is the default behavior, as both components are installed in the same namespace. + + If your KSM instance runs in a different namespace than {{agent}}, or if it uses a different service name, update the `host` setting in each data set of the integration to point to the KSM service. + :::: 5. Click **Save and continue**. When prompted, select to **Add Elastic Agent later** since you’ve already added it using Helm. 6. On the {{k8s}} integration page, open the **Assets** tab and select the **[Metrics Kubernetes] Pods** dashboard. @@ -154,3 +202,5 @@ release "demo" uninstalled ``` As a reminder, for full details about using the {{agent}} Helm chart refer to the [{{agent}} Helm Chart Readme](https://github.com/elastic/elastic-agent/tree/main/deploy/helm/elastic-agent). + +Refer also to the [examples](https://github.com/elastic/elastic-agent/tree/main/deploy/helm/elastic-agent/examples) section of the GitHub repository for advanced use cases, such as integrating {{agent}}s with [KSM autosharding](https://github.com/elastic/elastic-agent/tree/main/deploy/helm/elastic-agent/examples/fleet-managed-ksm-sharding), or configuring [mutual TLS authentication](https://github.com/elastic/elastic-agent/tree/main/deploy/helm/elastic-agent/examples/fleet-managed-certificates) between {{agent}}s and the {{fleet}} Server. \ No newline at end of file diff --git a/reference/fleet/toc.yml b/reference/fleet/toc.yml index 60a0dbe24..bb32917ce 100644 --- a/reference/fleet/toc.yml +++ b/reference/fleet/toc.yml @@ -27,8 +27,9 @@ toc: - file: elastic-agent-container.md - file: running-on-kubernetes-managed-by-fleet.md - file: install-on-kubernetes-using-helm.md - - file: example-kubernetes-standalone-agent-helm.md - - file: example-kubernetes-fleet-managed-agent-helm.md + children: + - file: example-kubernetes-standalone-agent-helm.md + - file: example-kubernetes-fleet-managed-agent-helm.md - file: advanced-kubernetes-managed-by-fleet.md - file: configuring-kubernetes-metadata.md - file: running-on-gke-managed-by-fleet.md From e5bdacd0a2b1de3fb0c930f5359276953b105de2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edu=20Gonz=C3=A1lez=20de=20la=20Herr=C3=A1n?= <25320357+eedugon@users.noreply.github.com> Date: Tue, 6 May 2025 12:15:09 +0200 Subject: [PATCH 02/14] removed tech preview text from helm based install docs --- reference/fleet/example-kubernetes-standalone-agent-helm.md | 5 ----- reference/fleet/install-on-kubernetes-using-helm.md | 5 ----- 2 files changed, 10 deletions(-) diff --git a/reference/fleet/example-kubernetes-standalone-agent-helm.md b/reference/fleet/example-kubernetes-standalone-agent-helm.md index b6d9f153e..8aeb3c8f6 100644 --- a/reference/fleet/example-kubernetes-standalone-agent-helm.md +++ b/reference/fleet/example-kubernetes-standalone-agent-helm.md @@ -5,11 +5,6 @@ mapped_pages: # Example: Install standalone Elastic Agent on Kubernetes using Helm [example-kubernetes-standalone-agent-helm] -::::{warning} -This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. -:::: - - This example demonstrates how to install standalone {{agent}} on a Kubernetes system using a Helm chart, gather Kubernetes metrics and send them to an {{es}} cluster in {{ecloud}}, and then view visualizations of those metrics in {{kib}}. For an overview of the {{agent}} Helm chart and its benefits, refer to [Install {{agent}} on Kubernetes using Helm](/reference/fleet/install-on-kubernetes-using-helm.md). diff --git a/reference/fleet/install-on-kubernetes-using-helm.md b/reference/fleet/install-on-kubernetes-using-helm.md index 111558bb3..23f23b96a 100644 --- a/reference/fleet/install-on-kubernetes-using-helm.md +++ b/reference/fleet/install-on-kubernetes-using-helm.md @@ -5,11 +5,6 @@ mapped_pages: # Install Elastic Agent on Kubernetes using Helm [install-on-kubernetes-using-helm] -::::{warning} -This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. -:::: - - Starting with {{stack}} version 8.16, a Helm chart is available for installing {{agent}} in a Kubernetes environment. A Helm-based install offers several advantages, including simplified deployment, availability in marketplaces, streamlined ugrades, as well as quick rollbacks whenever they’re needed. Features of the Helm-based {{agent}} install include: From 7d2719c21872d972fab325f0288b17d03137b73a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edu=20Gonz=C3=A1lez=20de=20la=20Herr=C3=A1n?= <25320357+eedugon@users.noreply.github.com> Date: Tue, 6 May 2025 12:22:04 +0200 Subject: [PATCH 03/14] fixing link --- reference/fleet/example-kubernetes-fleet-managed-agent-helm.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/fleet/example-kubernetes-fleet-managed-agent-helm.md b/reference/fleet/example-kubernetes-fleet-managed-agent-helm.md index 3dfcd5888..4a023733f 100644 --- a/reference/fleet/example-kubernetes-fleet-managed-agent-helm.md +++ b/reference/fleet/example-kubernetes-fleet-managed-agent-helm.md @@ -29,7 +29,7 @@ This guide takes you through these steps: To get started, you need: * A local install of the [Helm](https://helm.sh/) {{k8s}} package manager. -* An [{{ecloud}}](https://cloud.elastic.co/registration?page=docs&placement=docs-body) hosted {{es}} cluster on version 8.18 or higher, with an [Integrations Server](/deploy-manage/deploy/elastic-cloud/ec-customize-deployment-components.md#ec_integrations_server.md) component included. +* An [{{ecloud}}](https://cloud.elastic.co/registration?page=docs&placement=docs-body) hosted {{es}} cluster on version 8.18 or higher, with an [Integrations Server](/deploy-manage/deploy/elastic-cloud/ec-customize-deployment-components.md#ec_integrations_server) component included. * An active {{k8s}} cluster. ## Installation overview From e206814be381bb4be9ff1ffead4bb6027b038e47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edu=20Gonz=C3=A1lez=20de=20la=20Herr=C3=A1n?= <25320357+eedugon@users.noreply.github.com> Date: Wed, 7 May 2025 09:34:28 +0200 Subject: [PATCH 04/14] Apply suggestions from code review Co-authored-by: shainaraskas <58563081+shainaraskas@users.noreply.github.com> --- .../fleet/example-kubernetes-fleet-managed-agent-helm.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/reference/fleet/example-kubernetes-fleet-managed-agent-helm.md b/reference/fleet/example-kubernetes-fleet-managed-agent-helm.md index 4a023733f..d333f4001 100644 --- a/reference/fleet/example-kubernetes-fleet-managed-agent-helm.md +++ b/reference/fleet/example-kubernetes-fleet-managed-agent-helm.md @@ -19,7 +19,7 @@ This can be easily implemented with the Helm chart. For details, refer to the [K This guide takes you through these steps: -* [Set up Helm repository](#preparations) +* [Add the Elastic Helm repository](#preparations) * [Install {{agent}}](#agent-fleet-managed-helm-example-install-agent) * [Install the Kubernetes integration](#agent-fleet-managed-helm-example-install-integration) * [Tidy up](#agent-fleet-managed-helm-example-tidy-up) @@ -29,7 +29,7 @@ This guide takes you through these steps: To get started, you need: * A local install of the [Helm](https://helm.sh/) {{k8s}} package manager. -* An [{{ecloud}}](https://cloud.elastic.co/registration?page=docs&placement=docs-body) hosted {{es}} cluster on version 8.18 or higher, with an [Integrations Server](/deploy-manage/deploy/elastic-cloud/ec-customize-deployment-components.md#ec_integrations_server) component included. +* An [{{ech}}](https://cloud.elastic.co/registration?page=docs&placement=docs-body) {{es}} cluster on version 8.18 or higher, with an [Integrations Server](/deploy-manage/deploy/elastic-cloud/ec-customize-deployment-components.md#ec_integrations_server) component included. * An active {{k8s}} cluster. ## Installation overview @@ -46,7 +46,7 @@ By default, all resources are installed in the namespace defined by your current % we will uncomment the next line when the use cases are documented in the landing page :) % For other architectures and use cases, refer to [Advanced use cases](./install-on-kubernetes-using-helm.md#advanced-use-cases). -## Preparations [preparations] +## Add the Elastic Helm repository [preparations] Before installing, add the Elastic Helm repository and verify the available versions of the `elastic-agent` chart. If the repository is already configured, run `helm repo update` to ensure you have the latest package information. From 4fcbf8e7252efb17465d379c08eebb0a9dfe1c66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edu=20Gonz=C3=A1lez=20de=20la=20Herr=C3=A1n?= <25320357+eedugon@users.noreply.github.com> Date: Wed, 7 May 2025 10:18:09 +0200 Subject: [PATCH 05/14] system.enabled flag added and other minor changes --- ...ple-kubernetes-fleet-managed-agent-helm.md | 31 +++++++++++-------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/reference/fleet/example-kubernetes-fleet-managed-agent-helm.md b/reference/fleet/example-kubernetes-fleet-managed-agent-helm.md index d333f4001..630e6d681 100644 --- a/reference/fleet/example-kubernetes-fleet-managed-agent-helm.md +++ b/reference/fleet/example-kubernetes-fleet-managed-agent-helm.md @@ -34,10 +34,10 @@ To get started, you need: ## Installation overview -The default installation shown in this example deploys the following components to monitor your Kubernetes cluster: +The installation and configuration steps shown in this example deploys the following components to monitor your Kubernetes cluster: * {{agent}}, deployed as a `DaemonSet`, connected to {{fleet}}, and configured to collect: - * Host level metrics and logs through the [System Integration](integration-docs://reference/system/index.md). + * Host level metrics and logs through the [System Integration](integration-docs://reference/system/index.md). This enables the monitoring of Kubernetes nodes at OS level. * Kubernetes node and cluster-level metrics and logs through the [Kubernetes Integration](integration-docs://reference/kubernetes/index.md). For cluster-level metrics collection, one of the agents will act as a [leader](./kubernetes_leaderelection-provider.md). * A default installation of `kube-state-metrics` (KSM), configured as a dependency of the chart. KSM is required by the Kubernetes integration to collect cluster-level metrics. @@ -84,6 +84,7 @@ Before installing, add the Elastic Helm repository and verify the available vers ```sh helm install demo elastic/elastic-agent \ --set agent.fleet.enabled=true \ + --set system.enabled=true \ --set agent.fleet.url= \ # Substitute Fleet-URL with the URL that you copied earlier --set agent.fleet.token= \ # Substitute Fleet-token with the enrollment token that you copied earlier. --set agent.fleet.preset=perNode @@ -95,10 +96,22 @@ Before installing, add the Elastic Helm repository and verify the available vers * `demo`: The name for this specific installation of the chart, known as the **release name**. You can choose any name you like. * `elastic/elastic-agent`: The name of the chart to install, using the format `/`. * `--set agent.fleet.enabled=true`: Enables {{fleet}}-managed {{agent}}, which is disabled (`false`) by default. + * `--set system.enabled=true`: Adds the required volumes and mounts to enable host monitoring through the System integration. * `--set agent.fleet.url=`: Specifies the address where {{agent}} connects to {{fleet}} Server in your {{ecloud}} deployment. * `--set agent.fleet.token=`: Sets the enrollment token that {{agent}} uses to authenticate with {{fleet}} Server. * `--set agent.fleet.preset=perNode`: Runs the agent as a `DaemonSet`, to collect node-level metrics and logs. Refer to [](install-on-kubernetes-using-helm.md) for more details and use cases for this parameter. + After your updates, the command should be similar to: + + ```sh + helm install demo elastic/elastic-agent \ + --set agent.fleet.enabled=true \ + --set system.enabled=true \ + --set agent.fleet.url=https://256575858845283fxxxxxxxd5265d2b4.fleet.us-central1.gcp.foundit.no:443 \ + --set agent.fleet.token=eSVvFDUvSUNPFldFdhhZNFwvS5xxxxxxxxxxxxFEWB1eFF1YedUQ1NWFXwr== \ + --set agent.fleet.preset=perNode + ``` + ::::{tip} For a full list of all available values settings and descriptions, refer to the [{{agent}} Helm Chart Readme](https://github.com/elastic/elastic-agent/tree/main/deploy/helm/elastic-agent) and default [values.yaml](https://github.com/elastic/elastic-agent/blob/main/deploy/helm/elastic-agent/values.yaml). @@ -112,16 +125,6 @@ Before installing, add the Elastic Helm repository and verify the available vers * `--set kube-state-metrics.fullnameOverride=ksm`: If you want to deploy KSM with a different release name (it defaults to `kube-state-metrics`). This can be useful if you have already a default installation of KSM and you want a second one. :::: -8. After your updates, the command should be similar to: - - ```sh - helm install demo elastic/elastic-agent \ - --set agent.fleet.enabled=true \ - --set agent.fleet.url=https://256575858845283fxxxxxxxd5265d2b4.fleet.us-central1.gcp.foundit.no:443 \ - --set agent.fleet.token=eSVvFDUvSUNPFldFdhhZNFwvS5xxxxxxxxxxxxFEWB1eFF1YedUQ1NWFXwr== \ - --set agent.fleet.preset=perNode - ``` - 9. Run the command. The command output should confirm that {{agent}} has been installed: @@ -201,6 +204,8 @@ The uninstall should be confirmed as shown: release "demo" uninstalled ``` -As a reminder, for full details about using the {{agent}} Helm chart refer to the [{{agent}} Helm Chart Readme](https://github.com/elastic/elastic-agent/tree/main/deploy/helm/elastic-agent). +## Next steps + +For full details about using the {{agent}} Helm chart refer to the [{{agent}} Helm Chart Readme](https://github.com/elastic/elastic-agent/tree/main/deploy/helm/elastic-agent). Refer also to the [examples](https://github.com/elastic/elastic-agent/tree/main/deploy/helm/elastic-agent/examples) section of the GitHub repository for advanced use cases, such as integrating {{agent}}s with [KSM autosharding](https://github.com/elastic/elastic-agent/tree/main/deploy/helm/elastic-agent/examples/fleet-managed-ksm-sharding), or configuring [mutual TLS authentication](https://github.com/elastic/elastic-agent/tree/main/deploy/helm/elastic-agent/examples/fleet-managed-certificates) between {{agent}}s and the {{fleet}} Server. \ No newline at end of file From f2c449a21d0b86653c9f08bd55079294380b0742 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edu=20Gonz=C3=A1lez=20de=20la=20Herr=C3=A1n?= <25320357+eedugon@users.noreply.github.com> Date: Wed, 7 May 2025 11:37:12 +0200 Subject: [PATCH 06/14] helm repo setup snippet created --- .../_snippets/agent_add_helm_repository.md | 22 ++++++++++++++++ ...ple-kubernetes-fleet-managed-agent-helm.md | 26 +++---------------- 2 files changed, 25 insertions(+), 23 deletions(-) create mode 100644 reference/fleet/_snippets/agent_add_helm_repository.md diff --git a/reference/fleet/_snippets/agent_add_helm_repository.md b/reference/fleet/_snippets/agent_add_helm_repository.md new file mode 100644 index 000000000..47f4a8abd --- /dev/null +++ b/reference/fleet/_snippets/agent_add_helm_repository.md @@ -0,0 +1,22 @@ +Before installing, add the Elastic Helm repository and verify the available versions of the `elastic-agent` chart. If the repository is already configured, run `helm repo update` to ensure you have the latest package information. + +1. Set up Helm repository: + + ```sh + helm repo add elastic https://helm.elastic.co/ + helm repo update + ``` + +2. Verify chart versions: + + ```sh + helm search repo elastic-agent --versions + ``` + + The previous command returns something similar to: + + ```sh + NAME CHART VERSION APP VERSION DESCRIPTION + elastic/elastic-agent 9.0.0 9.0.0 Elastic-Agent Helm Chart + elastic/elastic-agent 8.18.0 8.18.0 Elastic-Agent Helm Chart + ``` diff --git a/reference/fleet/example-kubernetes-fleet-managed-agent-helm.md b/reference/fleet/example-kubernetes-fleet-managed-agent-helm.md index 630e6d681..088bf5289 100644 --- a/reference/fleet/example-kubernetes-fleet-managed-agent-helm.md +++ b/reference/fleet/example-kubernetes-fleet-managed-agent-helm.md @@ -36,7 +36,7 @@ To get started, you need: The installation and configuration steps shown in this example deploys the following components to monitor your Kubernetes cluster: -* {{agent}}, deployed as a `DaemonSet`, connected to {{fleet}}, and configured to collect: +* {{agent}}, deployed as a `DaemonSet`, connected to {{fleet}}, and configured through a {{fleet}} policy to collect: * Host level metrics and logs through the [System Integration](integration-docs://reference/system/index.md). This enables the monitoring of Kubernetes nodes at OS level. * Kubernetes node and cluster-level metrics and logs through the [Kubernetes Integration](integration-docs://reference/kubernetes/index.md). For cluster-level metrics collection, one of the agents will act as a [leader](./kubernetes_leaderelection-provider.md). * A default installation of `kube-state-metrics` (KSM), configured as a dependency of the chart. KSM is required by the Kubernetes integration to collect cluster-level metrics. @@ -48,28 +48,8 @@ By default, all resources are installed in the namespace defined by your current ## Add the Elastic Helm repository [preparations] -Before installing, add the Elastic Helm repository and verify the available versions of the `elastic-agent` chart. If the repository is already configured, run `helm repo update` to ensure you have the latest package information. - -1. Set up Helm repository: - - ```sh - helm repo add elastic https://helm.elastic.co/ - helm repo update - ``` - -2. Verify chart versions: - - ```sh - helm search repo elastic-agent --versions - ``` - - The previous command returns something similar to: - - ```sh - NAME CHART VERSION APP VERSION DESCRIPTION - elastic/elastic-agent 9.0.0 9.0.0 Elastic-Agent Helm Chart - elastic/elastic-agent 8.18.0 8.18.0 Elastic-Agent Helm Chart - ``` +:::{include} _snippets/agent_add_helm_repository.md +::: ## Install {{agent}} [agent-fleet-managed-helm-example-install-agent] From b056b30970d50f0ead9320f88786451cb480c68f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edu=20Gonz=C3=A1lez=20de=20la=20Herr=C3=A1n?= <25320357+eedugon@users.noreply.github.com> Date: Wed, 7 May 2025 14:13:51 +0200 Subject: [PATCH 07/14] minor update --- .../example-kubernetes-fleet-managed-agent-helm.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/reference/fleet/example-kubernetes-fleet-managed-agent-helm.md b/reference/fleet/example-kubernetes-fleet-managed-agent-helm.md index 088bf5289..36c736e6f 100644 --- a/reference/fleet/example-kubernetes-fleet-managed-agent-helm.md +++ b/reference/fleet/example-kubernetes-fleet-managed-agent-helm.md @@ -72,7 +72,7 @@ By default, all resources are installed in the namespace defined by your current Note that the command has these properties: - * `helm install`: Runs the Helm CLI install tool. Use `helm upgrade` to modify or update an existing release. + * `helm install`: Runs the Helm CLI install tool. You can use `helm upgrade` to modify or update an installed release. * `demo`: The name for this specific installation of the chart, known as the **release name**. You can choose any name you like. * `elastic/elastic-agent`: The name of the chart to install, using the format `/`. * `--set agent.fleet.enabled=true`: Enables {{fleet}}-managed {{agent}}, which is disabled (`false`) by default. @@ -105,7 +105,7 @@ By default, all resources are installed in the namespace defined by your current * `--set kube-state-metrics.fullnameOverride=ksm`: If you want to deploy KSM with a different release name (it defaults to `kube-state-metrics`). This can be useful if you have already a default installation of KSM and you want a second one. :::: -9. Run the command. +8. Run the command. The command output should confirm that {{agent}} has been installed: @@ -116,23 +116,23 @@ By default, all resources are installed in the namespace defined by your current ... ``` -10. Run the `kubectl get pods -n default` command to confirm that the {{agent}} pod is running: +9. Run the `kubectl get pods -n default` command to confirm that the {{agent}} pod is running: ```sh NAME READY STATUS RESTARTS AGE agent-pernode-demo-86mst 1/1 Running 0 12s ``` -11. In the **Add agent** flyout, wait a minute or so for confirmation that {{agent}} has successfully enrolled with {{fleet}} and that data is flowing: +10. In the **Add agent** flyout, wait a minute or so for confirmation that {{agent}} has successfully enrolled with {{fleet}} and that data is flowing: :::{image} images/helm-example-nodes-enrollment-confirmation.png :alt: Screen capture of Add Agent UI showing that the agent has enrolled in Fleet :screenshot: ::: -12. In {{fleet}}, open the **Agents** tab and see that an **Agent-pernode-demo-#** agent is running. -13. Select the agent to view its details. -14. On the **Agent details** tab, on the **Integrations** pane, expand `system-1` to confirm that logs and metrics are incoming. You can click either the `Logs` or `Metrics` link to view details. +11. In {{fleet}}, open the **Agents** tab and see that an **Agent-pernode-demo-#** agent is running. +12. Select the agent to view its details. +13. On the **Agent details** tab, on the **Integrations** pane, expand `system-1` to confirm that logs and metrics are incoming. You can click either the `Logs` or `Metrics` link to view details. :::{image} images/helm-example-nodes-logs-and-metrics.png :alt: Screen capture of the Logs and Metrics view on the Integrations pane From fdfb8906a454a4747af09512fc5f5004f72cda9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edu=20Gonz=C3=A1lez=20de=20la=20Herr=C3=A1n?= <25320357+eedugon@users.noreply.github.com> Date: Fri, 9 May 2025 12:44:27 +0200 Subject: [PATCH 08/14] extra refinement to the guide --- .../_snippets/agent_add_helm_repository.md | 2 +- ...ple-kubernetes-fleet-managed-agent-helm.md | 43 +++++++++++-------- 2 files changed, 26 insertions(+), 19 deletions(-) diff --git a/reference/fleet/_snippets/agent_add_helm_repository.md b/reference/fleet/_snippets/agent_add_helm_repository.md index 47f4a8abd..6c6e43f83 100644 --- a/reference/fleet/_snippets/agent_add_helm_repository.md +++ b/reference/fleet/_snippets/agent_add_helm_repository.md @@ -1,4 +1,4 @@ -Before installing, add the Elastic Helm repository and verify the available versions of the `elastic-agent` chart. If the repository is already configured, run `helm repo update` to ensure you have the latest package information. +Before installing, add the Elastic Helm repository to your local Helm configuration and verify the available versions of the `elastic-agent` chart. If the repository is already configured, run `helm repo update` to ensure you have the latest package information. 1. Set up Helm repository: diff --git a/reference/fleet/example-kubernetes-fleet-managed-agent-helm.md b/reference/fleet/example-kubernetes-fleet-managed-agent-helm.md index 36c736e6f..8ce5c333c 100644 --- a/reference/fleet/example-kubernetes-fleet-managed-agent-helm.md +++ b/reference/fleet/example-kubernetes-fleet-managed-agent-helm.md @@ -1,26 +1,23 @@ --- mapped_pages: - https://www.elastic.co/guide/en/fleet/current/example-kubernetes-fleet-managed-agent-helm.html +applies_to: + stack: ga 8.18 --- # Example: Install Fleet-managed Elastic Agent on Kubernetes using Helm [example-kubernetes-fleet-managed-agent-helm] This example demonstrates how to install a {{fleet}}-managed {{agent}} on a {{k8s}} system using a Helm chart, collect {{k8s}} metrics and logs using the [Kubernetes Integration](integration-docs://reference/kubernetes/index.md), and send the data to an {{es}} cluster in {{ecloud}} for visualization in {{kib}}. -For an overview of the {{agent}} Helm chart and its benefits, refer to [Install {{agent}} on Kubernetes using Helm](/reference/fleet/install-on-kubernetes-using-helm.md). - -::::{note} -This guide deploys a single set of {{agent}} DaemonSet pods to collect all metrics, which works well for small to medium-sized {{k8s}} clusters. - -For larger clusters, or when kube-state-metrics (KSM) metrics collection becomes a performance bottleneck, we recommend a more scalable architecture: move the KSM metric collection to a separate set of agents deployed as sidecars alongside KSM, with autosharding enabled. +Although this tutorial uses an {{ech}} deployment, the same steps can be adapted for other deployment types. For self-managed, {{eck}}, or {{ece}} deployments, you might need to provide the {{fleet}} Server CA certificate during the {{agent}} installation, as outlined below. -This can be easily implemented with the Helm chart. For details, refer to the [KSM autosharding example](https://github.com/elastic/elastic-agent/tree/main/deploy/helm/elastic-agent/examples/fleet-managed-ksm-sharding). -:::: +For an overview of the {{agent}} Helm chart and its benefits, refer to [Install {{agent}} on Kubernetes using Helm](/reference/fleet/install-on-kubernetes-using-helm.md). This guide takes you through these steps: +* [Installation overview](#overview) * [Add the Elastic Helm repository](#preparations) -* [Install {{agent}}](#agent-fleet-managed-helm-example-install-agent) +* [Create a {{fleet}} policy and install {{agent}}](#agent-fleet-managed-helm-example-install-agent) * [Install the Kubernetes integration](#agent-fleet-managed-helm-example-install-integration) * [Tidy up](#agent-fleet-managed-helm-example-tidy-up) @@ -32,17 +29,27 @@ To get started, you need: * An [{{ech}}](https://cloud.elastic.co/registration?page=docs&placement=docs-body) {{es}} cluster on version 8.18 or higher, with an [Integrations Server](/deploy-manage/deploy/elastic-cloud/ec-customize-deployment-components.md#ec_integrations_server) component included. * An active {{k8s}} cluster. -## Installation overview +## Installation overview [overview] The installation and configuration steps shown in this example deploys the following components to monitor your Kubernetes cluster: -* {{agent}}, deployed as a `DaemonSet`, connected to {{fleet}}, and configured through a {{fleet}} policy to collect: - * Host level metrics and logs through the [System Integration](integration-docs://reference/system/index.md). This enables the monitoring of Kubernetes nodes at OS level. - * Kubernetes node and cluster-level metrics and logs through the [Kubernetes Integration](integration-docs://reference/kubernetes/index.md). For cluster-level metrics collection, one of the agents will act as a [leader](./kubernetes_leaderelection-provider.md). -* A default installation of `kube-state-metrics` (KSM), configured as a dependency of the chart. KSM is required by the Kubernetes integration to collect cluster-level metrics. +* A default installation of [`kube-state-metrics` (KSM)](https://github.com/kubernetes/kube-state-metrics), configured as a dependency of the Helm chart. KSM is required by the Kubernetes integration to collect cluster-level metrics. + +* A group of {{agent}}s deployed as a [Kubernetes DaemonSet](https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/), connected to {{fleet}}, and configured through a {{fleet}} policy to collect: + * Host-level metrics and logs through the [System Integration](integration-docs://reference/system/index.md): This enables the monitoring of your Kubernetes nodes at OS level. {{agent}} Pods will collect system metrics and logs from their own hosts. + * Kubernetes metrics and logs through the [Kubernetes Integration](integration-docs://reference/kubernetes/index.md): This enables Kubernetes monitoring at both cluster and node levels. All {{agent}} Pods will collect node-level Kubernetes metrics and logs from their own hosts, while one of the agents will also collect cluster-level metrics and events, acting as a [leader](./kubernetes_leaderelection-provider.md). By default, all resources are installed in the namespace defined by your current `kubectl` context. You can override this by specifying a different namespace using the `--namespace` option during installation. +::::{note} +The proposed approach of a single {{agent}} DaemonSet to collect all metrics works well for small to medium-sized {{k8s}} clusters. + +For larger clusters, or when kube-state-metrics (KSM) metrics collection becomes a performance bottleneck, we recommend a more scalable architecture: move the KSM metric collection to a separate set of agents deployed as sidecars alongside KSM, with autosharding enabled. + +This can be easily implemented with the Helm chart. For details, refer to the [KSM autosharding example](https://github.com/elastic/elastic-agent/tree/main/deploy/helm/elastic-agent/examples/fleet-managed-ksm-sharding). +:::: + + % we will uncomment the next line when the use cases are documented in the landing page :) % For other architectures and use cases, refer to [Advanced use cases](./install-on-kubernetes-using-helm.md#advanced-use-cases). @@ -51,7 +58,7 @@ By default, all resources are installed in the namespace defined by your current :::{include} _snippets/agent_add_helm_repository.md ::: -## Install {{agent}} [agent-fleet-managed-helm-example-install-agent] +## Create a {{fleet}} policy and install {{agent}} [agent-fleet-managed-helm-example-install-agent] 1. Open your {{ecloud}} deployment, and from the navigation menu select **Fleet**. 2. From the **Agents** tab, select **Add agent**. @@ -70,7 +77,7 @@ By default, all resources are installed in the namespace defined by your current --set agent.fleet.preset=perNode ``` - Note that the command has these properties: + The command has these properties: * `helm install`: Runs the Helm CLI install tool. You can use `helm upgrade` to modify or update an installed release. * `demo`: The name for this specific installation of the chart, known as the **release name**. You can choose any name you like. @@ -79,7 +86,7 @@ By default, all resources are installed in the namespace defined by your current * `--set system.enabled=true`: Adds the required volumes and mounts to enable host monitoring through the System integration. * `--set agent.fleet.url=`: Specifies the address where {{agent}} connects to {{fleet}} Server in your {{ecloud}} deployment. * `--set agent.fleet.token=`: Sets the enrollment token that {{agent}} uses to authenticate with {{fleet}} Server. - * `--set agent.fleet.preset=perNode`: Runs the agent as a `DaemonSet`, to collect node-level metrics and logs. Refer to [](install-on-kubernetes-using-helm.md) for more details and use cases for this parameter. + * `--set agent.fleet.preset=perNode`: Runs the agent as a `DaemonSet`, which is required for the purpose of this example. Refer to [](install-on-kubernetes-using-helm.md) for more details and use cases for this parameter. After your updates, the command should be similar to: @@ -116,7 +123,7 @@ By default, all resources are installed in the namespace defined by your current ... ``` -9. Run the `kubectl get pods -n default` command to confirm that the {{agent}} pod is running: +9. Run the `kubectl get pods -n default` command to confirm that the {{agent}} Pods are running: ```sh NAME READY STATUS RESTARTS AGE From 98b4d87adcbdd07ee52cb1cbb4e393cd9eeddccd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edu=20Gonz=C3=A1lez=20de=20la=20Herr=C3=A1n?= <25320357+eedugon@users.noreply.github.com> Date: Fri, 9 May 2025 13:12:57 +0200 Subject: [PATCH 09/14] note about taints and tolerations added --- .../fleet/example-kubernetes-fleet-managed-agent-helm.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/reference/fleet/example-kubernetes-fleet-managed-agent-helm.md b/reference/fleet/example-kubernetes-fleet-managed-agent-helm.md index 8ce5c333c..eb24810b1 100644 --- a/reference/fleet/example-kubernetes-fleet-managed-agent-helm.md +++ b/reference/fleet/example-kubernetes-fleet-managed-agent-helm.md @@ -123,13 +123,19 @@ This can be easily implemented with the Helm chart. For details, refer to the [K ... ``` -9. Run the `kubectl get pods -n default` command to confirm that the {{agent}} Pods are running: +9. Run the `kubectl get pods -n default` command to confirm that the {{agent}} Pods are running. You should see one {{agent}} Pod running on each Kubernetes node: ```sh NAME READY STATUS RESTARTS AGE agent-pernode-demo-86mst 1/1 Running 0 12s ``` + ::::{note} + If your Kubernetes nodes have [`taints`](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/) configured, you may need to add `tolerations` to the {{agent}} DaemonSet during installation to ensure the Pods can run on tainted nodes. + + You can do this by setting the `presets.perNode.tolerations[]` value, which accepts standard Kubernetes toleration definitions. + :::: + 10. In the **Add agent** flyout, wait a minute or so for confirmation that {{agent}} has successfully enrolled with {{fleet}} and that data is flowing: :::{image} images/helm-example-nodes-enrollment-confirmation.png From 48b4655be29f5b38d550105aa86dfc67fc4357ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edu=20Gonz=C3=A1lez=20de=20la=20Herr=C3=A1n?= <25320357+eedugon@users.noreply.github.com> Date: Fri, 9 May 2025 13:35:04 +0200 Subject: [PATCH 10/14] capitalization changes --- .../fleet/example-kubernetes-fleet-managed-agent-helm.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/reference/fleet/example-kubernetes-fleet-managed-agent-helm.md b/reference/fleet/example-kubernetes-fleet-managed-agent-helm.md index eb24810b1..1c167f575 100644 --- a/reference/fleet/example-kubernetes-fleet-managed-agent-helm.md +++ b/reference/fleet/example-kubernetes-fleet-managed-agent-helm.md @@ -36,8 +36,8 @@ The installation and configuration steps shown in this example deploys the follo * A default installation of [`kube-state-metrics` (KSM)](https://github.com/kubernetes/kube-state-metrics), configured as a dependency of the Helm chart. KSM is required by the Kubernetes integration to collect cluster-level metrics. * A group of {{agent}}s deployed as a [Kubernetes DaemonSet](https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/), connected to {{fleet}}, and configured through a {{fleet}} policy to collect: - * Host-level metrics and logs through the [System Integration](integration-docs://reference/system/index.md): This enables the monitoring of your Kubernetes nodes at OS level. {{agent}} Pods will collect system metrics and logs from their own hosts. - * Kubernetes metrics and logs through the [Kubernetes Integration](integration-docs://reference/kubernetes/index.md): This enables Kubernetes monitoring at both cluster and node levels. All {{agent}} Pods will collect node-level Kubernetes metrics and logs from their own hosts, while one of the agents will also collect cluster-level metrics and events, acting as a [leader](./kubernetes_leaderelection-provider.md). + * Host-level metrics and logs through the [System integration](integration-docs://reference/system/index.md): This enables the monitoring of your Kubernetes nodes at OS level. {{agent}} Pods will collect system metrics and logs from their own hosts. + * Kubernetes metrics and logs through the [Kubernetes integration](integration-docs://reference/kubernetes/index.md): This enables Kubernetes monitoring at both cluster and node levels. All {{agent}} Pods will collect node-level Kubernetes metrics and logs from their own hosts, while one of the agents will also collect cluster-level metrics and events, acting as a [leader](./kubernetes_leaderelection-provider.md). By default, all resources are installed in the namespace defined by your current `kubectl` context. You can override this by specifying a different namespace using the `--namespace` option during installation. @@ -161,7 +161,7 @@ Now that you’ve {{agent}} and data is flowing, you can set up the {{k8s}} inte 3. On the {{k8s}} integration page, click **Add Kubernetes** to add the integration to your {{agent}} policy. 4. Scroll to the bottom of **Add Kubernetes integration** page. Under **Where to add this integration?** select the **Existing hosts** tab. On the **Agent policies** menu, select the agent policy that you created previously in the [Install {{agent}}](#agent-fleet-managed-helm-example-install-agent) steps. - You can leave all of the other integration settings at their default values. For details about the available inputs and data sets, refer to the [Kubernetes Integration](integration-docs://reference/kubernetes/index.md) documentation. + You can leave all of the other integration settings at their default values. For details about the available inputs and data sets, refer to the [Kubernetes integration](integration-docs://reference/kubernetes/index.md) documentation. ::::{important} All inputs under the **Collect Kubernetes metrics from kube-state-metrics** section default to `kube-state-metrics:8080` as the destination host. This works if you deployed KSM (kube-state-metrics) alongside {{agent}} during the chart installation, which is the default behavior, as both components are installed in the same namespace. From ae116cdf598d02f529536bf36e0fb2d96a7fe5c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edu=20Gonz=C3=A1lez=20de=20la=20Herr=C3=A1n?= <25320357+eedugon@users.noreply.github.com> Date: Fri, 9 May 2025 17:23:29 +0200 Subject: [PATCH 11/14] Apply suggestions from code review Co-authored-by: shainaraskas <58563081+shainaraskas@users.noreply.github.com> --- .../fleet/example-kubernetes-fleet-managed-agent-helm.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/reference/fleet/example-kubernetes-fleet-managed-agent-helm.md b/reference/fleet/example-kubernetes-fleet-managed-agent-helm.md index 1c167f575..65d7f06e5 100644 --- a/reference/fleet/example-kubernetes-fleet-managed-agent-helm.md +++ b/reference/fleet/example-kubernetes-fleet-managed-agent-helm.md @@ -169,7 +169,7 @@ Now that you’ve {{agent}} and data is flowing, you can set up the {{k8s}} inte If your KSM instance runs in a different namespace than {{agent}}, or if it uses a different service name, update the `host` setting in each data set of the integration to point to the KSM service. :::: -5. Click **Save and continue**. When prompted, select to **Add Elastic Agent later** since you’ve already added it using Helm. +5. Click **Save and continue**. When prompted, select **Add Elastic Agent later**, because you’ve already added the agent using Helm. 6. On the {{k8s}} integration page, open the **Assets** tab and select the **[Metrics Kubernetes] Pods** dashboard. On the dashboard, you can view the status of your {{k8s}} pods, including metrics on memory usage, CPU usage, and network throughput. @@ -199,6 +199,6 @@ release "demo" uninstalled ## Next steps -For full details about using the {{agent}} Helm chart refer to the [{{agent}} Helm Chart Readme](https://github.com/elastic/elastic-agent/tree/main/deploy/helm/elastic-agent). +For full details about using the {{agent}} Helm chart, refer to the [{{agent}} Helm Chart Readme](https://github.com/elastic/elastic-agent/tree/main/deploy/helm/elastic-agent). -Refer also to the [examples](https://github.com/elastic/elastic-agent/tree/main/deploy/helm/elastic-agent/examples) section of the GitHub repository for advanced use cases, such as integrating {{agent}}s with [KSM autosharding](https://github.com/elastic/elastic-agent/tree/main/deploy/helm/elastic-agent/examples/fleet-managed-ksm-sharding), or configuring [mutual TLS authentication](https://github.com/elastic/elastic-agent/tree/main/deploy/helm/elastic-agent/examples/fleet-managed-certificates) between {{agent}}s and the {{fleet}} Server. \ No newline at end of file +Refer to the [examples](https://github.com/elastic/elastic-agent/tree/main/deploy/helm/elastic-agent/examples) section of the GitHub repository for advanced use cases, such as integrating {{agent}}s with [KSM autosharding](https://github.com/elastic/elastic-agent/tree/main/deploy/helm/elastic-agent/examples/fleet-managed-ksm-sharding), or configuring [mutual TLS authentication](https://github.com/elastic/elastic-agent/tree/main/deploy/helm/elastic-agent/examples/fleet-managed-certificates) between {{agent}}s and the {{fleet}} Server. \ No newline at end of file From d7b972b6a9f94f24604ccde2d0bcba5e662be1fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edu=20Gonz=C3=A1lez=20de=20la=20Herr=C3=A1n?= <25320357+eedugon@users.noreply.github.com> Date: Fri, 9 May 2025 17:36:13 +0200 Subject: [PATCH 12/14] added steps in headings --- .../fleet/example-kubernetes-fleet-managed-agent-helm.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/reference/fleet/example-kubernetes-fleet-managed-agent-helm.md b/reference/fleet/example-kubernetes-fleet-managed-agent-helm.md index 65d7f06e5..bb60e213b 100644 --- a/reference/fleet/example-kubernetes-fleet-managed-agent-helm.md +++ b/reference/fleet/example-kubernetes-fleet-managed-agent-helm.md @@ -15,7 +15,6 @@ For an overview of the {{agent}} Helm chart and its benefits, refer to [Install This guide takes you through these steps: -* [Installation overview](#overview) * [Add the Elastic Helm repository](#preparations) * [Create a {{fleet}} policy and install {{agent}}](#agent-fleet-managed-helm-example-install-agent) * [Install the Kubernetes integration](#agent-fleet-managed-helm-example-install-integration) @@ -35,7 +34,7 @@ The installation and configuration steps shown in this example deploys the follo * A default installation of [`kube-state-metrics` (KSM)](https://github.com/kubernetes/kube-state-metrics), configured as a dependency of the Helm chart. KSM is required by the Kubernetes integration to collect cluster-level metrics. -* A group of {{agent}}s deployed as a [Kubernetes DaemonSet](https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/), connected to {{fleet}}, and configured through a {{fleet}} policy to collect: +* A group of {{agent}}s deployed as a [Kubernetes DaemonSet](https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/), connected to {{fleet}}, and configured through a {{fleet}} policy to collect the following metrics and logs: * Host-level metrics and logs through the [System integration](integration-docs://reference/system/index.md): This enables the monitoring of your Kubernetes nodes at OS level. {{agent}} Pods will collect system metrics and logs from their own hosts. * Kubernetes metrics and logs through the [Kubernetes integration](integration-docs://reference/kubernetes/index.md): This enables Kubernetes monitoring at both cluster and node levels. All {{agent}} Pods will collect node-level Kubernetes metrics and logs from their own hosts, while one of the agents will also collect cluster-level metrics and events, acting as a [leader](./kubernetes_leaderelection-provider.md). @@ -53,12 +52,12 @@ This can be easily implemented with the Helm chart. For details, refer to the [K % we will uncomment the next line when the use cases are documented in the landing page :) % For other architectures and use cases, refer to [Advanced use cases](./install-on-kubernetes-using-helm.md#advanced-use-cases). -## Add the Elastic Helm repository [preparations] +## Step 1: Add the Elastic Helm repository [preparations] :::{include} _snippets/agent_add_helm_repository.md ::: -## Create a {{fleet}} policy and install {{agent}} [agent-fleet-managed-helm-example-install-agent] +## Step 2: Create a {{fleet}} policy and install {{agent}} [agent-fleet-managed-helm-example-install-agent] 1. Open your {{ecloud}} deployment, and from the navigation menu select **Fleet**. 2. From the **Agents** tab, select **Add agent**. @@ -152,7 +151,7 @@ This can be easily implemented with the Helm chart. For details, refer to the [K :screenshot: ::: -## Install the Kubernetes integration [agent-fleet-managed-helm-example-install-integration] +## Step 3: Install the Kubernetes integration [agent-fleet-managed-helm-example-install-integration] Now that you’ve {{agent}} and data is flowing, you can set up the {{k8s}} integration. From 06a92fbdca5fd8c912a308ec7f05da2ac3d1c402 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edu=20Gonz=C3=A1lez=20de=20la=20Herr=C3=A1n?= <25320357+eedugon@users.noreply.github.com> Date: Fri, 9 May 2025 17:55:51 +0200 Subject: [PATCH 13/14] applies_to and prerequisite refined --- .../fleet/example-kubernetes-fleet-managed-agent-helm.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/reference/fleet/example-kubernetes-fleet-managed-agent-helm.md b/reference/fleet/example-kubernetes-fleet-managed-agent-helm.md index bb60e213b..ebc8f958f 100644 --- a/reference/fleet/example-kubernetes-fleet-managed-agent-helm.md +++ b/reference/fleet/example-kubernetes-fleet-managed-agent-helm.md @@ -3,6 +3,12 @@ mapped_pages: - https://www.elastic.co/guide/en/fleet/current/example-kubernetes-fleet-managed-agent-helm.html applies_to: stack: ga 8.18 + serverless: all + deployment: + ess: all + ece: all + eck: all + self: all --- # Example: Install Fleet-managed Elastic Agent on Kubernetes using Helm [example-kubernetes-fleet-managed-agent-helm] @@ -25,7 +31,7 @@ This guide takes you through these steps: To get started, you need: * A local install of the [Helm](https://helm.sh/) {{k8s}} package manager. -* An [{{ech}}](https://cloud.elastic.co/registration?page=docs&placement=docs-body) {{es}} cluster on version 8.18 or higher, with an [Integrations Server](/deploy-manage/deploy/elastic-cloud/ec-customize-deployment-components.md#ec_integrations_server) component included. +* An [{{ech}}](https://cloud.elastic.co/registration?page=docs&placement=docs-body) {{es}} cluster on version 8.18 or higher, with an [Integrations Server](/deploy-manage/deploy/elastic-cloud/ec-customize-deployment-components.md#ec_integrations_server) component. An {{serverless-full}} project also meets this requirement. * An active {{k8s}} cluster. ## Installation overview [overview] From 8f5f477279b3ac6e2fac1e79bd4cb45bc9bebb51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edu=20Gonz=C3=A1lez=20de=20la=20Herr=C3=A1n?= <25320357+eedugon@users.noreply.github.com> Date: Fri, 9 May 2025 18:00:48 +0200 Subject: [PATCH 14/14] applies_to update --- .../fleet/example-kubernetes-fleet-managed-agent-helm.md | 5 ----- 1 file changed, 5 deletions(-) diff --git a/reference/fleet/example-kubernetes-fleet-managed-agent-helm.md b/reference/fleet/example-kubernetes-fleet-managed-agent-helm.md index ebc8f958f..7dd89915d 100644 --- a/reference/fleet/example-kubernetes-fleet-managed-agent-helm.md +++ b/reference/fleet/example-kubernetes-fleet-managed-agent-helm.md @@ -4,11 +4,6 @@ mapped_pages: applies_to: stack: ga 8.18 serverless: all - deployment: - ess: all - ece: all - eck: all - self: all --- # Example: Install Fleet-managed Elastic Agent on Kubernetes using Helm [example-kubernetes-fleet-managed-agent-helm]