Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc(production): replace ksonnet with Tanka #1039

Merged
merged 1 commit into from
Sep 22, 2019
Merged
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
34 changes: 15 additions & 19 deletions production/ksonnet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,33 @@

## Prerequisites

Make sure you have the ksonnet v0.8.0:
Make sure you have a recent version of [Tanka](https://github.com/grafana/tanka). Follow their [install instructions](https://tanka.dev/#getting-started) to do so. Make sure to install [jsonnet-bundler](https://github.com/jsonnet-bundler/jsonnet-bundler) as well.

```
$ brew install https://raw.githubusercontent.com/ksonnet/homebrew-tap/82ef24cb7b454d1857db40e38671426c18cd8820/ks.rb
$ brew pin ks
$ ks version
ksonnet version: v0.8.0
jsonnet version: v0.9.5
client-go version: v1.6.8-beta.0+$Format:%h$
```bash
# Verify it works
$ tk --version
tk version v0.5.0
```

In your config repo, if you don't have a ksonnet application, make a new one (will copy credentials from current context):
In your config repo, if you don't yet have the directory structure of Tanka set up:

```
$ ks init <application name>
$ cd <application name>
$ ks env add loki --namespace=loki
```bash
# create a directory (any name works)
$ mkdir config && cd config/
$ tk init
$ tk env add loki --namespace=loki
```

## Deploying Promtail to your cluster.

Grab the promtail module using jb:

```
$ go get -u github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb
$ jb init
$ 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';


Expand Down Expand Up @@ -72,7 +68,7 @@ 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';
Expand All @@ -97,5 +93,5 @@ loki + promtail + gateway {
```
Notice that `container_root_path` is your own data root for docker daemon, use `docker info | grep "Root Dir"` to get it.

Do `ks show loki` to see the manifests being deployed to the cluster.
Finally `ks apply loki` to deploy the server components to your cluster.
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.