From f8ce8ac611cc5f09a892af8dee992df6696bc778 Mon Sep 17 00:00:00 2001 From: Robert Fratto Date: Wed, 10 Jan 2024 13:40:33 -0500 Subject: [PATCH] docs: remove reference to production/kubernetes (#6079) This commit modifies the Kubernetes installation instructions for static mode to use the Grafana Agent Helm chart instead of the abandoned production/kubernetes manifests. Related to #6077. Co-authored-by: Clayton Cornell <131809008+clayton-cornell@users.noreply.github.com> --- .../install/install-agent-kubernetes.md | 51 ++++++++++++------- 1 file changed, 32 insertions(+), 19 deletions(-) diff --git a/docs/sources/static/set-up/install/install-agent-kubernetes.md b/docs/sources/static/set-up/install/install-agent-kubernetes.md index c8df4dd8fa33..95fdd5597b53 100644 --- a/docs/sources/static/set-up/install/install-agent-kubernetes.md +++ b/docs/sources/static/set-up/install/install-agent-kubernetes.md @@ -11,40 +11,53 @@ weight: 300 # Deploy Grafana Agent in static mode on Kubernetes -You can deploy Grafana Agent in static mode on Kubernetes. +You can use the Helm chart for Grafana Agent to deploy Grafana Agent in static mode on Kubernetes. + +## Before you begin + +* Install [Helm][] on your computer. +* Configure a Kubernetes cluster that you can use for Grafana Agent. +* Configure your local Kubernetes context to point to the cluster. + +[Helm]: https://helm.sh ## Deploy -To deploy Grafana Agent in static mode on Kubernetes, perform the following steps. +{{% admonition type="note" %}} +These instructions show you how to install the generic [Helm chart](https://github.com/grafana/agent/tree/main/operations/helm/charts/grafana-agent) for Grafana Agent. +You can deploy Grafana Agent in static mode or flow mode. The Helm chart deploys flow mode by default. +{{% /admonition %}} -1. Download one of the following manifests from GitHub and save it as `manifest.yaml`: +To deploy Grafana Agent in static mode on Kubernetes using Helm, run the following commands in a terminal window: - - Metric collection (StatefulSet): [agent-bare.yaml](https://github.com/grafana/agent/blob/main/production/kubernetes/agent-bare.yaml) - - Log collection (DaemonSet): [agent-loki.yaml](https://github.com/grafana/agent/blob/main/production/kubernetes/agent-loki.yaml) - - Trace collection (Deployment): [agent-traces.yaml](https://github.com/grafana/agent/blob/main/production/kubernetes/agent-traces.yaml) +1. Add the Grafana Helm chart repository: -1. Edit the downloaded `manifest.yaml` and replace the placeholders with information relevant to your Kubernetes deployment. + ```shell + helm repo add grafana https://grafana.github.io/helm-charts + ``` -1. Apply the modified manifest file: +1. Update the Grafana Helm chart repository: ```shell - kubectl -n default apply -f manifest.yaml + helm repo update ``` -{{% admonition type="note" %}} -The manifests do not include the `ConfigMaps` which are necessary to run Grafana Agent. -{{% /admonition %}} +1. Install Grafana Agent in static mode: -For sample configuration files and detailed instructions, refer to [Configure Kubernetes Monitoring](/docs/grafana-cloud/monitor-infrastructure/kubernetes-monitoring/configuration/) in the Grafana Cloud documentation. + ```shell + helm install grafana/grafana-agent --set agent.mode=static + ``` + Replace the following: -## Rebuild the Kubernetes manifests + - _``_: The name to use for your Grafana Agent installation, such as `grafana-agent`. -The manifests provided are created using Grafana Labs' production Tanka configs with some default values. If you want to build the YAML file with some custom values, you must install the following applications: + {{% admonition type="warning" %}} + Always pass `--set agent.mode=static` in `helm install` or `helm upgrade` commands to ensure Grafana Agent gets installed in static mode. + Alternatively, set `agent.mode` to `static` in your values.yaml file. + {{% /admonition %}} -- [Tanka](https://github.com/grafana/tanka) version 0.8 or higher -- [jsonnet-bundler](https://github.com/jsonnet-bundler/jsonnet-bundler) version 0.2.1 or higher +For more information on the Grafana Agent Helm chart, refer to the Helm chart documentation on [Artifact Hub][]. -Refer to the [`template` Tanka environment](https://github.com/grafana/agent/blob/main/production/kubernetes/build/templates) for the current settings that initialize the Grafana Agent Tanka configurations. +[Artifact Hub]: https://artifacthub.io/packages/helm/grafana/grafana-agent -To build the YAML files, run the `/build/build.sh` script, or run `make example-kubernetes` from the project's root directory.