uneeq-oss / spinnaker-mixin

Prometheus Mixin for Spinnaker https://spinnaker.io/
Apache License 2.0
11 stars 6 forks source link

new to mixins #15

Open kafka-kowl-admin opened 2 years ago

kafka-kowl-admin commented 2 years ago

Hi,

I'm new to mixins. I went over the talk at https://promcon.io/2018-munich/talks/prometheus-monitoring-mixins/.

We have kube-prometheus deployed in k8s using helm and spinnaker deployed to a diff k8s using hal - and we have lots of service monitors, prometheus rules, alerts, graf dashes etc installed in our k8s.

We have already created the SMs to scrape spinnaker and we see the targets in prometheus, Also we installed jsonnet, jsonnetfmt, jb and cloned this github project. We now want to create grafana dashes, prometheus rules and alerts and we can directly do kubectl apply on to create those in our k8s. How do I achieve this using this github project ?

Thanks

kafka-kowl-admin commented 2 years ago

tagging @kskewes @christosarvanitis @benclapp

kskewes-sf commented 2 years ago

This mixin outputs Prometheus Operator CRD's so your setup should support them.

Are you using this helm chart?: https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack I haven't used that before and not sure how it works. I couldn't see anything about importing or migrating jsonnet based mixins.

The mixin's from that talk and that this project is based on use jsonnet as an alternative to helm. jsonnet enables importing and modifying the configuration before rendering it out to json or yaml to then kubectl apply -f -.

Can you please try following the steps here: https://github.com/uneeq-oss/spinnaker-mixin#using-the-mixin-as-raw-json-and-yaml-files and then kubectl diff -f ./manifests/ ? If it looks okay then you can try kubectl apply -f ./manifests/ and verify that Grafana dashboards update, Prometheus Alert rule s are created, etc.

If this works out it would be great to update the README.md with any extra steps or clarification.

You can also find us Spinnaker monitoring folk in the #monitoring channel on the Spinnaker Slack.

kafka-kowl-admin commented 2 years ago

@kskewes-sf yes. Using helm to deploy kube-prometheus Tried the link you shared - https://github.com/uneeq-oss/spinnaker-mixin#using-the-mixin-as-raw-json-and-yaml-files Didnt work. This is what I did :

  1. installed go, jsonnet and jsonnetfmt
    
    [root@spinnaker-mixin]# go version && jsonnet --version && jsonnetfmt --version
    go version go1.17.8 linux/amd64
    Jsonnet commandline interpreter (Go implementation) v0.18.0
    Jsonnet reformatter v0.18.0
2. cloned this repo 

git clone https://github.com/uneeq-oss/spinnaker-mixin.git

3. then did 

cd spinnaker-mixin jb install

4. and finally "make" but this step threw errors. Also did see any files generated in manifests dir. 

[root@spinnaker-mixin]# make find . -name '.libsonnet' -print -o -name '.jsonnet' -print | \ xargs -n 1 -- jsonnetfmt -i bash: line 0: bash: find . -name '.libsonnet' -print -o -name '.jsonnet' -print | \ xargs -n 1 -- jsonnetfmt -i: invalid option name make: *** [fmt] Error 2

kskewes-sf commented 2 years ago

Sorry I had missed https://github.com/jsonnet-bundler/jsonnet-bundler from the install steps.

Could you please follow changes #16 and see if the jsonnet files render for you?