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

new to mixins #15

Open
kafka-kowl-admin opened this issue Mar 16, 2022 · 4 comments
Open

new to mixins #15

kafka-kowl-admin opened this issue Mar 16, 2022 · 4 comments

Comments

@kafka-kowl-admin
Copy link

kafka-kowl-admin commented Mar 16, 2022

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
Copy link
Author

kafka-kowl-admin commented Mar 16, 2022

tagging @kskewes @christosarvanitis @benclapp

@kskewes-sf
Copy link
Contributor

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
Copy link
Author

@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

  1. cloned this repo
git clone https://github.com/uneeq-oss/spinnaker-mixin.git
  1. then did
cd spinnaker-mixin
jb install
  1. 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
Copy link
Contributor

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants