- Notifications
You must be signed in to change notification settings - Fork6
Kubernetes Prometheus Pushgateway in Jsonnet format
License
NotificationsYou must be signed in to change notification settings
latchmihay/kube-prometheus-pushgateway
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Kubernetes Prometheus Pushgateway in Jsonnet format as a reusable component.
It is aimed to be used and consumbed bycoreos/kube-prometheus
Use this package in your own infrastructure usingjsonnet-bundler
:
jb install github.com/latchmihay/kube-prometheus-pushgateway/prometheus-pushgateway
An example of how to use it could be: (save as example.jsonnet)
local kp = (import"prometheus-pushgateway/pushgateway.libsonnet") + {_config+:: {namespace:'monitoring', }, };{ ['prometheus-pushgateway-' + name]: kp.pushgateway[name],for nameinstd.objectFields(kp.pushgateway) }
This builds a Prometheus Push Gateway stack
Simply run:
$ jsonnet -J vendor example.jsonnet
This quickstart requires the kube-prometheus to already be deployed and running.
Running this one command should then be enough:
make deploy
go get github.com/jsonnet-bundler/jsonnet-bundler/cmd/jbgo get github.com/brancz/gojsontoyamlcd prometheus-pushgateway&& jb install&&cd ..rm -rf manifestsmkdir manifestsjsonnet -J prometheus-pushgateway/vendor -m manifests example.jsonnet| xargs -I{} sh -c'cat {} | gojsontoyaml > {}.yaml; rm -f {}' -- {}cat manifests/*
git clone https://github.com/coreos/kube-prometheus.gitcd kube-prometheusjb install github.com/latchmihay/kube-prometheus-pushgateway/prometheus-pushgatewaycat> withPromGateway.jsonnet<<EOFlocal kp = (import 'kube-prometheus/kube-prometheus.libsonnet') + (import "prometheus-pushgateway/pushgateway.libsonnet") + { _config+:: { namespace: 'monitoring', }, };{ ['prometheus-pushgateway-' + name]: kp.pushgateway[name], for name in std.objectFields(kp.pushgateway) } +{ ['00namespace-' + name]: kp.kubePrometheus[name] for name in std.objectFields(kp.kubePrometheus) } +{ ['0prometheus-operator-' + name]: kp.prometheusOperator[name] for name in std.objectFields(kp.prometheusOperator) } +{ ['node-exporter-' + name]: kp.nodeExporter[name] for name in std.objectFields(kp.nodeExporter) } +{ ['kube-state-metrics-' + name]: kp.kubeStateMetrics[name] for name in std.objectFields(kp.kubeStateMetrics) } +{ ['alertmanager-' + name]: kp.alertmanager[name] for name in std.objectFields(kp.alertmanager) } +{ ['prometheus-' + name]: kp.prometheus[name] for name in std.objectFields(kp.prometheus) } +{ ['prometheus-adapter-' + name]: kp.prometheusAdapter[name] for name in std.objectFields(kp.prometheusAdapter) } +{ ['grafana-' + name]: kp.grafana[name] for name in std.objectFields(kp.grafana) }EOF./build.sh withPromGateway.jsonnet# everything is at manifests folder
git clone https://github.com/coreos/kube-prometheus.gitcd kube-prometheuscat> withPromGateway.jsonnet<<EOFlocal kp = (import 'kube-prometheus/kube-prometheus.libsonnet') + (import "prometheus-pushgateway/pushgateway.libsonnet") + { _config+:: { namespace: 'monitoring', }, };{ ['prometheus-pushgateway-' + name]: kp.pushgateway[name], for name in std.objectFields(kp.pushgateway) } +{ ['00namespace-' + name]: kp.kubePrometheus[name] for name in std.objectFields(kp.kubePrometheus) } +{ ['0prometheus-operator-' + name]: kp.prometheusOperator[name] for name in std.objectFields(kp.prometheusOperator) } +{ ['node-exporter-' + name]: kp.nodeExporter[name] for name in std.objectFields(kp.nodeExporter) } +{ ['kube-state-metrics-' + name]: kp.kubeStateMetrics[name] for name in std.objectFields(kp.kubeStateMetrics) } +{ ['alertmanager-' + name]: kp.alertmanager[name] for name in std.objectFields(kp.alertmanager) } +{ ['prometheus-' + name]: kp.prometheus[name] for name in std.objectFields(kp.prometheus) } +{ ['prometheus-adapter-' + name]: kp.prometheusAdapter[name] for name in std.objectFields(kp.prometheusAdapter) } +{ ['grafana-' + name]: kp.grafana[name] for name in std.objectFields(kp.grafana) }EOFdocker run --rm -v$(pwd):$(pwd) --workdir$(pwd) quay.io/coreos/jsonnet-ci jb install github.com/latchmihay/kube-prometheus-pushgateway/prometheus-pushgatewaydocker run --rm -v$(pwd):$(pwd) --workdir$(pwd) quay.io/coreos/jsonnet-ci ./build.sh withPromGateway.jsonnet# all the yamls are in the manifests folder
About
Kubernetes Prometheus Pushgateway in Jsonnet format
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
No releases published
Packages0
No packages published
Contributors2
Uh oh!
There was an error while loading.Please reload this page.