Skip to content
This repository was archived by the owner on Jul 28, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 7 additions & 25 deletions docs/getting-started/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ with the Grafana Agent Operator, please refer to the Operator-specific
Currently, there are six ways to install the agent:

- Use our Docker container
- Use the Kubernetes install script (_recommended basic_)
- Use the Kubernetes manifest
- Use the Kubernetes manifests directly
- Use the Kubernetes manifests along with the [Grafana Cloud Kubernetes Quickstart Guides](#grafana-cloud-kubernetes-quickstart-guides)
- Installing the static binaries locally
- Using Grafana Labs' official Tanka configs (_recommended advanced_)
- Using the [Windows Installer]({{< relref "./install-agent-on-windows.md" >}})
Expand Down Expand Up @@ -45,33 +45,15 @@ to the end of the `docker run` command:
Note that using paths on your host machine must be exposed to the Docker
container through a bind mount for the flags to work properly.

## Kubernetes install script
## Kubernetes manifests

Running this script automatically downloads and applies our recommended
Grafana Agent Kubernetes deployment manifests (requires `envsubst` (GNU gettext)).
Two manifests will be installed: one for collecting metrics, and the other for
collecting logs. You will be prompted for input for each manifest that is
applied.
If you wish to manually modify the Kubernetes manifests before deploying them, you can do so by downloading them from the [`kubernetes` directory](../../production/kubernetes/). Note that these manifests do not include Agent configuration files. For sample configuration, please see the Grafana Cloud Kubernetes quickstarts.

> **Warning:** Always verify scripts from the internet before running them.
## Grafana Cloud kubernetes quickstart guides

```
NAMESPACE="default" /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/grafana/agent/release/production/kubernetes/install.sh)" | kubectl -ndefault apply -f -
NAMESPACE="default" /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/grafana/agent/release/production/kubernetes/install-loki.sh)" | kubectl apply -f -
NAMESPACE="default" /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/grafana/agent/release/production/kubernetes/install-tempo.sh)" | kubectl apply -f -
```

**Note:** For the above script to scrape your pods, they must conform to the following rules:

- The pod must _not_ have an annotation matching `prometheus.io/scrape: "false"` (this wouldn't be there unless you explicitly add it or if you deploy a Helm chart that has it).
- The pod _must_ have a port with a name ending in `-metrics`. This is the port that will be scraped by the Agent. A lot of people using Helm struggle with this, since Helm charts don't usually follow this. You would need to add a new scrape config to scrape helm charts or find a way to tweak the Helm chart to follow this rules.
- The pod _must_ have a label named name with any non-empty value. Helm usually lets you add extra labels, so this is less of a problem for Helm users.
- The pod must currently be running. (i.e., Kubernetes must not report it having a phase of Succeeded or Failed).

## Kubernetes manifest
These guides help you get up and running with the Agent and Grafana Cloud, and include sample ConfigMaps.

If you wish to manually modify the Kubernetes manifest before deploying it
yourself, you can do so by downloading the [`agent.yaml` file](../../production/kubernetes/agent.yaml).
You can find them in the [Grafana Cloud documentation](https://grafana.com/docs/grafana-cloud/quickstart/agent-k8s/)

## Install locally

Expand Down
29 changes: 9 additions & 20 deletions production/README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,15 @@
# Running Grafana Agent

There are a few ways to run the Grafana Agent, in order from
easiest to hardest:
Here are some resources to help you run the Grafana Agent:

- [Use the Install Script for Kubernetes](#install-script-for-kubernetes)
- [Windows Installation](#windows-installation)
- [Run the Agent with Docker](#running-the-agent-with-docker)
- [Run the Agent locally](#running-the-agent-locally)
- [Use the example Kubernetes configs](#use-the-example-kubernetes-configs)
- [Grafana Cloud Kubernetes Quickstart Guides](#grafana-cloud-kubernetes-quickstart-guides)
- [Build the Agent from Source](#build-the-agent-from-source)
- [Use our production Tanka configs](#use-our-production-tanka-configs)
Comment thread
hjet marked this conversation as resolved.

## Install Script for Kubernetes

The Grafana Agent repository comes with installation scripts to
configure components and return a Kubernetes manifest that uses our preferred
defaults. To run the script, copy and paste this in your terminal:

```
NAMESPACE="default" /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/grafana/agent/release/production/kubernetes/install.sh)" | kubectl apply -f -
NAMESPACE="default" /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/grafana/agent/release/production/kubernetes/install-loki.sh)" | kubectl apply -f -
NAMESPACE="default" /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/grafana/agent/release/production/kubernetes/install-tempo.sh)" | kubectl apply -f -
```

See the [Kubernetes README](./kubernetes/README.md) for more information.

## Windows Installation

To run the Windows Installation, download the Windows Installer executable from the [release page](https://github.com/grafana/agent/releases). Then run the installer, this will setup the Agent and run the Agent as a Windows Service. More details can be found in the [Windows Guide](../docs/getting-started/install-agent-on-windows.md)
Expand All @@ -51,9 +36,13 @@ Agent as a long-living process (e.g., write your own systemd unit files).

## Use the example Kubernetes configs

The install script replaces variable placeholders in the [example Kubernetes
manifest](./kubernetes/agent.yaml) in the Kubernetes directory. Feel free to
examine that file and modify it for your own needs!
You can find sample deployment manifests in the [Kubernetes](./kubernetes) directory.

## Grafana Cloud Kubernetes quickstart guides

These guides help you get up and running with the Agent and Grafana Cloud, and include sample ConfigMaps.

You can find them in the [Grafana Cloud documentation](https://grafana.com/docs/grafana-cloud/quickstart/agent-k8s/)

## Build the Agent from source

Expand Down
49 changes: 14 additions & 35 deletions production/kubernetes/README.md
Original file line number Diff line number Diff line change
@@ -1,50 +1,28 @@
# Kubernetes Config

This directory contains Kubernetes manifest templates and installation scripts
for rendering the templates so they can be applied against Kubernetes.
This directory contains Kubernetes manifest templates for rolling out the Agent.

Manifests:

- Metric collection: [`agent.yaml`](./agent.yaml)
- Log collection: [`agent-loki.yaml`](./agent-loki.yaml)
- Trace collection: [`agent-tempo.yaml`](./agent-tempo.yaml)
- Metric collection (Deployment): [`agent-bare.yaml`](./agent-bare.yaml)
- Log collection (DaemonSet): [`agent-loki.yaml`](./agent-loki.yaml)
- Trace collection (DaemonSet): [`agent-tempo.yaml`](./agent-tempo.yaml)

Installation script:
These manifests do not include the Agent's configuration (ConfigMaps).

- Metric collection: [`install.sh`](./install.sh)
- Log collection: [`install-loki.sh`](./install-loki.sh)
- Trace collection: [`install-tempo.sh`](./install-tempo.sh)
For sample configurations and detailed installation instructions, please head to:

## Install Scripts

There are two installation scripts, one for metrics and the other for logs. Each
install script does the following:

1. Prmopts the user for their remote target credentials (Prometheus remote_write, Loki client).
2. Downloads the manifest template from GitHub
3. Substitutes variables in the template with the provided input from
step 1.
4. Prints out the final manifest to stdout without applying it.

Here's a script to copy and paste to install the Agent on Kubernetes for
collecting metrics, logs, and traces (requires `envsubst` (GNU gettext)):

```
NAMESPACE="default" /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/grafana/agent/release/production/kubernetes/install.sh)" | kubectl apply -f -
NAMESPACE="default" /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/grafana/agent/release/production/kubernetes/install-loki.sh)" | kubectl apply -f -
NAMESPACE="default" /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/grafana/agent/release/production/kubernetes/install-tempo.sh)" | kubectl apply -f -
```
- [Grafana Agent Metrics Kubernetes Quickstart](https://grafana.com/docs/grafana-cloud/quickstart/agent-k8s/k8s_agent_metrics/)
- [Grafana Agent Logs Kubernetes Quickstart](https://grafana.com/docs/grafana-cloud/quickstart/agent-k8s/k8s_agent_logs/)

## Manually Applying

Since the manifest files are just templates, note that they are *not* ready for
applying out of the box and you will have to manually reroduce the steps that
the installation script does:
applying out of the box and you will have to manually perform the following steps:

1. Download the manifest as `manifest.yaml`.
1. Download the manifest as `manifest.yaml`

2. Modify your copy of the manifest, replacing all variables with the
appropriate values.
2. Modify your copy of the manifest, replacing relevant variables with the appropriate values

3. Apply the modified manifest file: `kubectl -ndefault apply -f manifest.yaml`.

Expand All @@ -59,6 +37,7 @@ of software installed:
2. [`jsonnet-bundler`](https://github.com/jsonnet-bundler/jsonnet-bundler) >= v0.2.1

See the [`template` Tanka environment](./build/templates) for the current
settings that initialize the Grafana Agent Tanka configs. To build the YAML
file, execute the `./build/build.sh` script or run `make example-kubernetes`
settings that initialize the Grafana Agent Tanka configs.

To build the YAML files, execute the `./build/build.sh` script or run `make example-kubernetes`
from the project's root directory.
Loading