Git Product home page Git Product logo

cortex-jsonnet's Introduction

Jsonnet for Cortex on Kubernetes

This repo has the jsonnet for deploying Cortex and the related monitoring in Kubernetes.

To generate the YAMLs for deploying Cortex:

  1. Make sure you have tanka and jb installed:

    Follow the steps at https://tanka.dev/install. If you have go installed locally you can also use:

    $ # make sure to be outside of GOPATH or a go.mod project
    $ GO111MODULE=on go get github.com/grafana/tanka/cmd/tk
    $ GO111MODULE=on go get github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb
  2. Initialise the Tanka, and install the Cortex and Kubernetes Jsonnet libraries.

    $ mkdir <name> && cd <name>
    $ tk init --k8s=false
    $ # The k8s-alpha library supports Kubernetes versions 1.14+
    $ jb install github.com/jsonnet-libs/k8s-alpha/1.18
    $ cat <<EOF > lib/k.libsonnet
      (import "github.com/jsonnet-libs/k8s-alpha/1.18/main.libsonnet")
      + (import "github.com/jsonnet-libs/k8s-alpha/1.18/extensions/kausal-shim.libsonnet")
      EOF
    $ jb install github.com/grafana/cortex-jsonnet/cortex@main
  3. Use the example monitoring.jsonnet.example:

    $ cp vendor/cortex/cortex-manifests.jsonnet.example environments/default/main.jsonnet
  4. Check what is in the example:

    $ cat environments/default/main.jsonnet
    ...
  5. Generate the YAML manifests:

    $ tk show environments/default

    To output YAML manifests to ./manifests, run:

    $ tk export manifests environments/default

Monitoring for Cortex

To generate the Grafana dashboards and Prometheus alerts for Cortex:

$ GO111MODULE=on go get github.com/monitoring-mixins/mixtool/cmd/mixtool
$ GO111MODULE=on go get github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb
$ git clone https://github.com/grafana/cortex-jsonnet
$ cd cortex-jsonnet
$ make build-mixin

This will leave all the alerts and dashboards in cortex-mixin/cortex-mixin.zip (or cortex-mixin/out).

If you get an error like cannot use cli.StringSliceFlag literal (type cli.StringSliceFlag) as type cli.Flag in slice literal when installing mixtool, make sure you set GO111MODULE=on before go get.

cortex-jsonnet's People

Contributors

pracucci avatar gotjosh avatar pstibrany avatar tomwilkie avatar jtlisi avatar darrenjaneczek avatar gouthamve avatar stevesg avatar jdbaldry avatar codesome avatar aknuds1 avatar owen-d avatar aallawala avatar joe-elliott avatar cstyan avatar simonswine avatar annanay25 avatar michelhollands avatar amckinley avatar duologic avatar jvrplmlmn avatar cyriltovena avatar umamialex avatar sandeepsukhani avatar bboreham avatar sh0rez avatar beorn7 avatar 56quarters avatar colega avatar forestsword avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.