Skip to content

Commit

Permalink
Update Promtail installation
Browse files Browse the repository at this point in the history
  • Loading branch information
JStickler committed Apr 24, 2024
1 parent 0c51186 commit d2d3ad8
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 38 deletions.
63 changes: 36 additions & 27 deletions docs/sources/send-data/promtail/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,43 +23,52 @@ See the instructions [here](https://grafana.com/docs/loki/<LOKI_VERSION>/setup/i

## Install using Docker

```bash
# modify tag to most recent version
docker pull grafana/promtail:2.9.2
```
1. Make sure to modify the tag to the most recent version.

```bash
docker pull grafana/promtail:3.0.0
```

1. Create your Promtail configuration file in a file called `promtail-config.yaml`. Refer to the [Promtail configuration reference](https://grafana.com/docs/loki/<LOKI_VERSION>/send-data/promtail/configuration/) for more details.

1. Note that you will need to replace `<local-path>` in the commands with your local path.

```bash
docker run -v <local-path>:/mnt/config -v /var/log:/var/log --link loki grafana/promtail:3.0.0 --config.file=/mnt/config/promtail-config.yaml
```

## Install using Helm

Make sure that Helm is installed.
See [Installing Helm](https://helm.sh/docs/intro/install/).
Then you can add Grafana's chart repository to Helm:
1. Make sure that Helm is installed. See [Installing Helm](https://helm.sh/docs/intro/install/).

```bash
helm repo add grafana https://grafana.github.io/helm-charts
```
1. Then you can add Grafana's chart repository to Helm:
And the chart repository can be updated by running:
```bash
helm repo add grafana https://grafana.github.io/helm-charts
```
```bash
helm repo update
```
1. Update the chart repository:
Create the configuration file `values.yaml`. The example below illustrates a connection to the locally deployed loki server:
```bash
helm repo update
```
```yaml
config:
# publish data to loki
clients:
- url: http://loki-gateway/loki/api/v1/push
tenant_id: 1
```
1. Create the configuration file `values.yaml`. The example below illustrates a connection to the locally deployed loki server:
Finally, Promtail can be deployed with:
```yaml
config:
# publish data to loki
clients:
- url: http://loki-gateway/loki/api/v1/push
tenant_id: 1
```
```bash
# The default helm configuration deploys promtail as a daemonSet (recommended)
helm upgrade --values values.yaml --install promtail grafana/promtail
```
1. Finally, Promtail can be deployed with:
```bash
# The default helm configuration deploys promtail as a daemonSet (recommended)
helm upgrade --values values.yaml --install promtail grafana/promtail
```
## Install as Kubernetes daemonSet (recommended)
Expand Down
22 changes: 11 additions & 11 deletions docs/sources/setup/install/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ The configuration files associated with these installation instructions run Loki
1. Copy and paste the following commands into your command line to download `loki-local-config.yaml` and `promtail-docker-config.yaml` to your `loki` directory.

```bash
wget https://raw.githubusercontent.com/grafana/loki/v2.9.2/cmd/loki/loki-local-config.yaml -O loki-config.yaml
wget https://raw.githubusercontent.com/grafana/loki/v2.9.2/clients/cmd/promtail/promtail-docker-config.yaml -O promtail-config.yaml
wget https://raw.githubusercontent.com/grafana/loki/v3.0.0/cmd/loki/loki-local-config.yaml -O loki-config.yaml
wget https://raw.githubusercontent.com/grafana/loki/v3.0.0/clients/cmd/promtail/promtail-docker-config.yaml -O promtail-config.yaml
```

1. Copy and paste the following commands into your command line to start the Docker containers using the configuration files you downloaded in the previous step.

```bash
docker run --name loki -d -v $(pwd):/mnt/config -p 3100:3100 grafana/loki:2.9.2 -config.file=/mnt/config/loki-config.yaml
docker run --name promtail -d -v $(pwd):/mnt/config -v /var/log:/var/log --link loki grafana/promtail:2.9.2 -config.file=/mnt/config/promtail-config.yaml
docker run --name loki -d -v $(pwd):/mnt/config -p 3100:3100 grafana/loki:3.0.0 -config.file=/mnt/config/loki-config.yaml
docker run --name promtail -d -v $(pwd):/mnt/config -v /var/log:/var/log --link loki grafana/promtail:3.0.0 -config.file=/mnt/config/promtail-config.yaml
```

{{< admonition type="note" >}}
Expand All @@ -56,8 +56,8 @@ The configuration files associated with these installation instructions run Loki
```bash
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
9485de9ad351 grafana/promtail:2.9.2 "/usr/bin/promtail -…" About a minute ago Up About a minute promtail
cece1df84519 grafana/loki:2.9.2 "/usr/bin/loki -conf…" About a minute ago Up About a minute 0.0.0.0:3100->3100/tcp, :::3100->3100/tcp loki
9485de9ad351 grafana/promtail:3.0.0 "/usr/bin/promtail -…" About a minute ago Up About a minute promtail
cece1df84519 grafana/loki:3.0.0 "/usr/bin/loki -conf…" About a minute ago Up About a minute 0.0.0.0:3100->3100/tcp, :::3100->3100/tcp loki
```

1. Verify that Loki is up and running.
Expand All @@ -71,15 +71,15 @@ The configuration files associated with these installation instructions run Loki

```bash
cd "<local-path>"
wget https://raw.githubusercontent.com/grafana/loki/v2.9.2/cmd/loki/loki-local-config.yaml -O loki-config.yaml
wget https://raw.githubusercontent.com/grafana/loki/v2.9.2/clients/cmd/promtail/promtail-docker-config.yaml -O promtail-config.yaml
wget https://raw.githubusercontent.com/grafana/loki/v3.0.0/cmd/loki/loki-local-config.yaml -O loki-config.yaml
wget https://raw.githubusercontent.com/grafana/loki/v3.0.0/clients/cmd/promtail/promtail-docker-config.yaml -O promtail-config.yaml
```

1. Copy and paste the following commands into your command line to start the Docker containers using the configuration files you downloaded in the previous step. Note that you will need to replace the `<local-path>` in the commands with your local path.

```bash
docker run --name loki -v <local-path>:/mnt/config -p 3100:3100 grafana/loki:2.9.2 --config.file=/mnt/config/loki-config.yaml
docker run -v <local-path>:/mnt/config -v /var/log:/var/log --link loki grafana/promtail:2.9.2 --config.file=/mnt/config/promtail-config.yaml
docker run --name loki -v <local-path>:/mnt/config -p 3100:3100 grafana/loki:3.0.0 --config.file=/mnt/config/loki-config.yaml
docker run -v <local-path>:/mnt/config -v /var/log:/var/log --link loki grafana/promtail:3.0.0 --config.file=/mnt/config/promtail-config.yaml
```

1. Verify that Loki is up and running.
Expand All @@ -101,7 +101,7 @@ Run the following commands in your command line. They work for Windows or Linux
1. Copy and paste the following command into your command line to download the `docker-compose` file.

```bash
wget https://raw.githubusercontent.com/grafana/loki/v2.9.2/production/docker-compose.yaml -O docker-compose.yaml
wget https://raw.githubusercontent.com/grafana/loki/v3.0.0/production/docker-compose.yaml -O docker-compose.yaml
```

1. With `loki` as the current working directory, run the following 'docker-compose` command:
Expand Down

0 comments on commit d2d3ad8

Please sign in to comment.