Here are some resources to help you run the Grafana Agent:
- Windows Installation
- Run the Agent with Docker
- Run the Agent locally
- Use the example Kubernetes configs
- Grafana Cloud Kubernetes Quickstart Guides
- Build the Agent from Source
- Use our production Tanka configs
To run the Windows Installation, download the Windows Installer executable from the release page. 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
To run the Agent with Docker, you should have a configuration file on
your local machine ready to bind mount into the container. Then modify
the following command for your environment. Replace /path/to/config.yaml
with
the full path to your YAML configuration, and replace /tmp/agent
with the
directory on your host that you want the agent to store its WAL.
docker run \
-v /tmp/agent:/etc/agent/data \
-v /path/to/config.yaml:/etc/agent/agent.yaml \
grafana/agent:v0.18.4
Currently, you must provide your own system configuration files to run the Agent as a long-living process (e.g., write your own systemd unit files).
You can find sample deployment manifests in the Kubernetes directory.
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
Go 1.14 is currently needed to build the agent from source. Run make agent
from the root of this repository, and then the build agent binary will be placed
at ./cmd/agent/agent
.
The Tanka configs we use to deploy the agent ourselves can be found in our production Tanka directory. These configs are also used to generate the Kubernetes configs for the install script. To get started with the tanka configs, do the following:
mkdir tanka-agent
cd tanka-agent
tk init --k8s=false
jb install github.com/grafana/agent/production/tanka/grafana-agent
# substitute your target k8s version for "1.16" in the next few commands
jb install github.com/jsonnet-libs/k8s-alpha/1.16
echo '(import "github.com/jsonnet-libs/k8s-alpha/1.16/main.libsonnet")' > lib/k.libsonnet
echo '+ (import "github.com/jsonnet-libs/k8s-alpha/1.16/extensions/kausal-shim.libsonnet")' >> lib/k.libsonnet
Then put this in environments/default/main.jsonnet
:
local agent = import 'grafana-agent/grafana-agent.libsonnet';
agent {
_config+:: {
namespace: 'grafana-agent'
},
}
If all these steps worked, tk eval environments/default
should output the
default JSON we use to build our Kubernetes manifests.