-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* adds jsonnet-libs/k8s-alpha, redirects tanka install docs * removes vendor dir from loki ksonnet * docs for non-GA tanka requirement * Update docs/sources/installation/tanka.md Co-authored-by: Ed Welch <[email protected]> Co-authored-by: Ed Welch <[email protected]>
- Loading branch information
Showing
4 changed files
with
72 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,95 +1,3 @@ | ||
# Deploy Loki to Kubernetes | ||
|
||
## Prerequisites | ||
|
||
Make sure you have a recent version of [Tanka](https://github.com/grafana/tanka). Follow their [install instructions](https://tanka.dev/install) to do so. Make sure to install [jsonnet-bundler](https://github.com/jsonnet-bundler/jsonnet-bundler) as well. | ||
|
||
```bash | ||
# Verify it works | ||
$ tk --version | ||
tk version v0.6.1 | ||
``` | ||
|
||
In your config repo, if you don't yet have a Tanka project set up: | ||
|
||
```bash | ||
# create a directory (any name works) | ||
$ mkdir config && cd config/ | ||
$ tk init | ||
$ tk env add environments/loki --namespace=loki | ||
$ tk env set environments/loki --server=https://${K8S_MASTER_ADDRESS}:6443 | ||
``` | ||
|
||
## Deploying Promtail to your cluster. | ||
|
||
Grab the `promtail` module using jb: | ||
|
||
``` | ||
$ jb install github.com/grafana/loki/production/ksonnet/promtail | ||
``` | ||
|
||
Replace the contents of `environments/loki/main.jsonnet` with: | ||
```jsonnet | ||
local promtail = import 'promtail/promtail.libsonnet'; | ||
promtail + { | ||
_config+:: { | ||
namespace: 'loki', | ||
promtail_config+: { | ||
clients: [ | ||
{ | ||
scheme:: 'https', | ||
hostname:: 'logs-us-west1.grafana.net', | ||
username:: 'user-id', | ||
password:: 'password', | ||
external_labels: {}, | ||
} | ||
], | ||
container_root_path: '/var/lib/docker', | ||
}, | ||
}, | ||
} | ||
``` | ||
Notice that `container_root_path` is your own data root for docker daemon, use `docker info | grep "Root Dir"` to get it. | ||
|
||
Now use `tk show environments/loki` to see the yaml, and `tk apply environments/loki` to apply it to the cluster. | ||
|
||
## Deploying Loki to your cluster. | ||
|
||
If you want to further also deploy the server to the cluster, then run the following to install the module: | ||
|
||
``` | ||
$ jb install github.com/grafana/loki/production/ksonnet/loki | ||
``` | ||
Be sure to replace the username, password and the relevant htpasswd contents. | ||
Replace the contents of `environments/loki/main.jsonnet` with: | ||
|
||
```jsonnet | ||
local gateway = import 'loki/gateway.libsonnet'; | ||
local loki = import 'loki/loki.libsonnet'; | ||
local promtail = import 'promtail/promtail.libsonnet'; | ||
loki + promtail + gateway { | ||
_config+:: { | ||
namespace: 'loki', | ||
htpasswd_contents: 'loki:$apr1$H4yGiGNg$ssl5/NymaGFRUvxIV1Nyr.', | ||
promtail_config: { | ||
scheme: 'http', | ||
hostname: 'gateway.%(namespace)s.svc' % $._config, | ||
username: 'loki', | ||
password: 'password', | ||
container_root_path: '/var/lib/docker', | ||
}, | ||
replication_factor: 3, | ||
consul_replicas: 1, | ||
}, | ||
} | ||
``` | ||
Notice that `container_root_path` is your own data root for docker daemon, use `docker info | grep "Root Dir"` to get it. | ||
|
||
Use `tk show environments/loki` to see the manifests being deployed to the cluster. | ||
Finally `tk apply environments/loki` will deploy the server components to your cluster. | ||
See the [Tanka Installation Docs](../../docs/sources/installation/tanka.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
{ | ||
"version": 1, | ||
"dependencies": [ | ||
{ | ||
"source": { | ||
"git": { | ||
"remote": "https://github.com/grafana/jsonnet-libs.git", | ||
"subdir": "consul" | ||
} | ||
}, | ||
"version": "8629e32d04a0eefdce41224540f0d31de7d40deb", | ||
"sum": "whodWjF2UjlDT6rDiBsxbT+71UGD2J7IKiVxJETrXCA=" | ||
}, | ||
{ | ||
"source": { | ||
"git": { | ||
"remote": "https://github.com/grafana/jsonnet-libs.git", | ||
"subdir": "jaeger-agent-mixin" | ||
} | ||
}, | ||
"version": "8629e32d04a0eefdce41224540f0d31de7d40deb", | ||
"sum": "DsdBoqgx5kE3zc6fMYnfiGjW2+9Mx2OXFieWm1oFHgY=" | ||
}, | ||
{ | ||
"source": { | ||
"git": { | ||
"remote": "https://github.com/grafana/jsonnet-libs.git", | ||
"subdir": "ksonnet-util" | ||
} | ||
}, | ||
"version": "8629e32d04a0eefdce41224540f0d31de7d40deb", | ||
"sum": "TGgjbv8oGfmMNjfvcgxi2cX9RAJKGZnYGLEhzK2wNjM=" | ||
}, | ||
{ | ||
"source": { | ||
"git": { | ||
"remote": "https://github.com/grafana/jsonnet-libs.git", | ||
"subdir": "memcached" | ||
} | ||
}, | ||
"version": "8629e32d04a0eefdce41224540f0d31de7d40deb", | ||
"sum": "AIspZ151p0qkxVc9tuoAEYNrkazV6QncWWsIsarK9GE=" | ||
}, | ||
{ | ||
"source": { | ||
"git": { | ||
"remote": "https://github.com/jsonnet-libs/k8s-alpha.git", | ||
"subdir": "1.14" | ||
} | ||
}, | ||
"version": "4423ca26d1762943b9975fd4f5cc229e814fe8b6", | ||
"sum": "00qOXX9Ddf0r2AR3NX7d9A/9MFaAesdGxCs6sXUobok=" | ||
} | ||
], | ||
"legacyImports": false | ||
} |