You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+18-32Lines changed: 18 additions & 32 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -173,7 +173,7 @@ Then access via [http://localhost:9093](http://localhost:9093)
173
173
## Customizing Kube-Prometheus
174
174
175
175
This section:
176
-
* describes how to customize the kube-prometheus library via compiling the kube-prometheus manifests yourself (as an alternative to the [Quickstart section](#Quickstart)).
176
+
* describes how to customize the kube-prometheus library via compiling the kube-prometheus manifests yourself (as an alternative to the [Quickstart section](#quickstart)).
177
177
* still doesn't require you to make a copy of this entire repository, but rather only a copy of a few select files.
> Note: some of the following components must be configured beforehand. See [configuration](#configuration) and [customization-examples](#customization-examples).
212
212
213
-
[embedmd]:#(example.jsonnet)
214
-
```jsonnet
213
+
```jsonnet mdox-exec="cat example.jsonnet"
215
214
local kp =
216
215
(import 'kube-prometheus/main.libsonnet') +
217
216
// Uncomment the following imports to enable its patches
@@ -250,8 +249,7 @@ local kp =
250
249
251
250
And here's the [build.sh](build.sh) script (which uses `vendor/` to render all manifests in a json structure of `{filename: manifest-content}`):
252
251
253
-
[embedmd]:#(build.sh)
254
-
```sh
252
+
```sh mdox-exec="cat build.sh"
255
253
#!/usr/bin/env bash
256
254
257
255
# This script uses arg $1 (name of *.jsonnet file to use) to generate the manifests/*.yaml files.
@@ -343,7 +341,7 @@ Configuration is mainly done in the `values` map. You can see this being used in
343
341
},
344
342
```
345
343
346
-
The grafana definition is located in a different project (https://github.com/brancz/kubernetes-grafana), but needed configuration can be customized from the same top level `values` field. For example to allow anonymous access to grafana, add the following `values` section:
344
+
The grafana definition is located in a different project (https://github.com/brancz/kubernetes-grafana), but needed configuration can be customized from the same top level `values` field. For example to allow anonymous access to grafana, add the following `values` section:
@@ -457,8 +451,7 @@ To give another customization example, the name of the `Prometheus` object provi
457
451
458
452
Standard Kubernetes manifests are all written using [ksonnet-lib](https://github.com/ksonnet/ksonnet-lib/), so they can be modified with the mixins supplied by ksonnet-lib. For example to override the namespace of the node-exporter DaemonSet:
@@ -474,8 +467,7 @@ Standard Kubernetes manifests are all written using [ksonnet-lib](https://github
474
467
475
468
The Alertmanager configuration is located in the `values.alertmanager.config` configuration field. In order to set a custom Alertmanager configuration simply set this field.
@@ -517,8 +508,7 @@ In the above example the configuration has been inlined, but can just as well be
517
508
518
509
In order to monitor additional namespaces, the Prometheus server requires the appropriate `Role` and `RoleBinding` to be able to discover targets from that namespace. By default the Prometheus server is limited to the three namespaces it requires: default, kube-system and the namespace you configure the stack to run in via `$.values.namespace`. This is specified in `$.values.prometheus.namespaces`, to add new namespaces to monitor, simply append the additional namespaces:
In case you want to monitor all namespaces in a cluster, you can add the following mixin. Also, make sure to empty the namespaces defined in prometheus so that roleBindings are not created against them.
@@ -630,7 +618,7 @@ Proceed with [creating ServiceMonitors for the services in the namespaces](#defi
630
618
631
619
### Static etcd configuration
632
620
633
-
In order to configure a static etcd cluster to scrape there is a simple [kube-prometheus-static-etcd.libsonnet](jsonnet/kube-prometheus/kube-prometheus-static-etcd.libsonnet) mixin prepared - see [etcd.jsonnet](examples/etcd.jsonnet) for an example of how to use that mixin, and [Monitoring external etcd](docs/monitoring-external-etcd.md) for more information.
621
+
In order to configure a static etcd cluster to scrape there is a simple [static-etcd.libsonnet](jsonnet/kube-prometheus/addons/static-etcd.libsonnet) mixin prepared - see [etcd.jsonnet](examples/etcd.jsonnet) for an example of how to use that mixin, and [Monitoring external etcd](docs/monitoring-external-etcd.md) for more information.
634
622
635
623
> Note that monitoring etcd in minikube is currently not possible because of how etcd is setup. (minikube's etcd binds to 127.0.0.1:2379 only, and within host networking namespace.)
636
624
@@ -639,8 +627,7 @@ In order to configure a static etcd cluster to scrape there is a simple [kube-pr
639
627
To prevent `Prometheus` and `Alertmanager` instances from being deployed onto the same node when
640
628
possible, one can include the [kube-prometheus-anti-affinity.libsonnet](jsonnet/kube-prometheus/addons/anti-affinity.libsonnet) mixin:
@@ -664,8 +651,7 @@ local kp = (import 'kube-prometheus/main.libsonnet') +
664
651
Sometimes in small clusters, the CPU/memory limits can get high enough for alerts to be fired continuously. To prevent this, one can strip off the predefined limits.
Copy file name to clipboardExpand all lines: developer-workspace/README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,7 +26,7 @@ If you are working on new features/bug fixes, you can regenerate kube-prometheus
26
26
27
27
Gitpod is already available to everyone to use for free. It can also run commands that we speficy in the `.gitpod.yml` file located in the root directory of the git repository, so even the cluster creation can be fully automated.
28
28
29
-
You can use the same workflow as mentioned in the [Codespaces](#Codespaces) section, however Gitpod doesn't have native support for any kubernetes distribution. The workaround is to create a full QEMU Virtual Machine and deploy [k3s](https://github.com/k3s-io/k3s) inside this VM. Don't worry, this whole process is already fully automated, but due to the workaround the whole workspace may be very slow.
29
+
You can use the same workflow as mentioned in the [Codespaces](#codespaces) section, however Gitpod doesn't have native support for any kubernetes distribution. The workaround is to create a full QEMU Virtual Machine and deploy [k3s](https://github.com/k3s-io/k3s) inside this VM. Don't worry, this whole process is already fully automated, but due to the workaround the whole workspace may be very slow.
30
30
31
31
To open up a workspace with Gitpod, you can install the [Google Chrome extension](https://www.gitpod.io/docs/browser-extension/) to add a new button to Github UI and use it on PRs or from the main page. Or by directly typing in the browser `http://gitpod.io/#https://github.com/prometheus-operator/kube-prometheus/pull/<Pull Request Number>` or just `http://gitpod.io/#https://github.com/prometheus-operator/kube-prometheus`
One fatal issue that can occur is that you run out of IP addresses in your eks cluster. (Generally happens due to error configs where pods keep scheduling).
6
6
7
7
You can monitor the `awscni` using kube-promethus with :
Copy file name to clipboardExpand all lines: docs/developing-prometheus-rules-and-grafana-dashboards.md
+9-16Lines changed: 9 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,8 +20,7 @@ For both the Prometheus rules and the Grafana dashboards Kubernetes `ConfigMap`s
20
20
21
21
As a basis, all examples in this guide are based on the base example of the kube-prometheus [readme](../README.md):
22
22
23
-
[embedmd]:#(../example.jsonnet)
24
-
```jsonnet
23
+
```jsonnet mdox-exec="cat example.jsonnet"
25
24
local kp =
26
25
(import 'kube-prometheus/main.libsonnet') +
27
26
// Uncomment the following imports to enable its patches
@@ -68,8 +67,7 @@ The format is exactly the Prometheus format, so there should be no changes neces
68
67
69
68
> Note that alerts can just as well be included into this file, using the jsonnet `import` function. In this example it is just inlined in order to demonstrate their use in a single file.
local kp = (import 'kube-prometheus/main.libsonnet') + {
74
72
values+:: {
75
73
common+: {
@@ -124,8 +122,7 @@ In order to add a recording rule, simply do the same with the `prometheusRules`
124
122
125
123
> Note that rules can just as well be included into this file, using the jsonnet `import` function. In this example it is just inlined in order to demonstrate their use in a single file.
local kp = (import 'kube-prometheus/main.libsonnet') + {
190
186
values+:: {
191
187
common+: {
@@ -337,8 +333,7 @@ We recommend using the [grafonnet](https://github.com/grafana/grafonnet-lib/) li
337
333
338
334
> Note that dashboards can just as well be included into this file, using the jsonnet `import` function. In this example it is just inlined in order to demonstrate their use in a single file.
As jsonnet is a superset of json, the jsonnet `import` function can be used to include Grafana dashboard json blobs. In this example we are importing a [provided example dashboard](../examples/example-grafana-dashboard.json).
In case you have lots of json dashboard exported out from grafana UI the above approach is going to take lots of time to improve performance we can use `rawDashboards` field and provide it's value as json string by using `importstr`
Copy file name to clipboardExpand all lines: docs/exposing-prometheus-alertmanager-grafana-ingress.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -104,7 +104,7 @@ k.core.v1.list.new([
104
104
105
105
In order to expose Alertmanager and Grafana, simply create additional fields containing an ingress object, but simply pointing at the `alertmanager` or `grafana` instead of the `prometheus-k8s` Service. Make sure to also use the correct port respectively, for Alertmanager it is also `web`, for Grafana it is `http`. Be sure to also specify the appropriate external URL. Note that the external URL for grafana is set in a different way than the external URL for Prometheus or Alertmanager. See [ingress.jsonnet](../examples/ingress.jsonnet) for how to set the Grafana external URL.
106
106
107
-
In order to render the ingress objects similar to the other objects use as demonstrated in the [main readme](../README.md#usage):
107
+
In order to render the ingress objects similar to the other objects use as demonstrated in the [main readme](../README.md):
108
108
109
109
```
110
110
{ ['00namespace-' + name]: kp.kubePrometheus[name] for name in std.objectFields(kp.kubePrometheus) } +
0 commit comments