docs/customizations: Move customization examples to dedicated folder
With the objective of improving our README, customization examples are being moved to a dedicated folder under `docs/`. Signed-off-by: ArthurSens <arthursens2005@gmail.com>
This commit is contained in:
@@ -5,15 +5,14 @@ local kp = (import 'kube-prometheus/main.libsonnet') +
|
||||
namespace: 'monitoring',
|
||||
},
|
||||
|
||||
// Reference info: https://github.com/coreos/kube-prometheus/blob/master/README.md#static-etcd-configuration
|
||||
etcd+: {
|
||||
// Configure this to be the IP(s) to scrape - i.e. your etcd node(s) (use commas to separate multiple values).
|
||||
ips: ['127.0.0.1'],
|
||||
|
||||
// Reference info:
|
||||
// * https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#servicemonitorspec (has endpoints)
|
||||
// * https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#endpoint (has tlsConfig)
|
||||
// * https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#tlsconfig (has: caFile, certFile, keyFile, serverName, & insecureSkipVerify)
|
||||
// * https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/api.md#servicemonitorspec (has endpoints)
|
||||
// * https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/api.md#endpoint (has tlsConfig)
|
||||
// * https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/api.md#tlsconfig (has: caFile, certFile, keyFile, serverName, & insecureSkipVerify)
|
||||
|
||||
// Set these three variables to the fully qualified directory path on your work machine to the certificate files that are valid to scrape etcd metrics with (check the apiserver container).
|
||||
// Most likely these certificates are generated somewhere in an infrastructure repository, so using the jsonnet `importstr` function can
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
((import 'kube-prometheus/main.libsonnet') + {
|
||||
nodeExporter+: {
|
||||
daemonset+: {
|
||||
metadata+: {
|
||||
namespace: 'my-custom-namespace',
|
||||
},
|
||||
},
|
||||
},
|
||||
}).nodeExporter.daemonset
|
||||
37
examples/name-namespace-overrides.jsonnet
Normal file
37
examples/name-namespace-overrides.jsonnet
Normal file
@@ -0,0 +1,37 @@
|
||||
local kp = (import 'kube-prometheus/main.libsonnet') +
|
||||
{
|
||||
values+:: {
|
||||
common+: {
|
||||
namespace: 'monitoring',
|
||||
},
|
||||
|
||||
prometheus+: {
|
||||
namespace: 'foo',
|
||||
name: 'bar',
|
||||
},
|
||||
|
||||
alertmanager+: {
|
||||
namespace: 'bar',
|
||||
name: 'foo',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
{ 'setup/0namespace-namespace': kp.kubePrometheus.namespace } +
|
||||
// Add the restricted psp to setup
|
||||
{
|
||||
['setup/prometheus-operator-' + name]: kp.prometheusOperator[name]
|
||||
for name in std.filter((function(name) name != 'serviceMonitor' && name != 'prometheusRule'), std.objectFields(kp.prometheusOperator))
|
||||
} +
|
||||
// serviceMonitor and prometheusRule are separated so that they can be created after the CRDs are ready
|
||||
{ 'prometheus-operator-serviceMonitor': kp.prometheusOperator.serviceMonitor } +
|
||||
{ 'prometheus-operator-prometheusRule': kp.prometheusOperator.prometheusRule } +
|
||||
{ 'kube-prometheus-prometheusRule': kp.kubePrometheus.prometheusRule } +
|
||||
{ ['alertmanager-' + name]: kp.alertmanager[name] for name in std.objectFields(kp.alertmanager) } +
|
||||
{ ['blackbox-exporter-' + name]: kp.blackboxExporter[name] for name in std.objectFields(kp.blackboxExporter) } +
|
||||
{ ['grafana-' + name]: kp.grafana[name] for name in std.objectFields(kp.grafana) } +
|
||||
{ ['kube-state-metrics-' + name]: kp.kubeStateMetrics[name] for name in std.objectFields(kp.kubeStateMetrics) } +
|
||||
{ ['kubernetes-' + name]: kp.kubernetesControlPlane[name] for name in std.objectFields(kp.kubernetesControlPlane) }
|
||||
{ ['node-exporter-' + name]: kp.nodeExporter[name] for name in std.objectFields(kp.nodeExporter) } +
|
||||
{ ['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) }
|
||||
@@ -1,9 +0,0 @@
|
||||
((import 'kube-prometheus/main.libsonnet') + {
|
||||
prometheus+: {
|
||||
prometheus+: {
|
||||
metadata+: {
|
||||
name: 'my-name',
|
||||
},
|
||||
},
|
||||
},
|
||||
}).prometheus.prometheus
|
||||
Reference in New Issue
Block a user