Skip to content

Commit 864ca1e

Browse files
authored
Merge pull request prometheus-operator#1448 from andrein/cherry-pick-1445
Cherry-pick grafana LDAP into release-0.9
2 parents b6ab321 + 822f885 commit 864ca1e

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

examples/grafana-ldap.jsonnet

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
local kp =
2+
(import 'kube-prometheus/main.libsonnet') +
3+
{
4+
values+:: {
5+
common+: {
6+
namespace: 'monitoring',
7+
},
8+
grafana+: {
9+
config+: {
10+
sections: {
11+
'auth.ldap': {
12+
enabled: true,
13+
config_file: '/etc/grafana/ldap.toml',
14+
allow_sign_up: true,
15+
},
16+
},
17+
},
18+
ldap: |||
19+
[[servers]]
20+
host = "127.0.0.1"
21+
port = 389
22+
use_ssl = false
23+
start_tls = false
24+
ssl_skip_verify = false
25+
26+
bind_dn = "cn=admins,dc=example,dc=com"
27+
bind_password = 'grafana'
28+
29+
search_filter = "(cn=%s)"
30+
search_base_dns = ["dc=example,dc=com"]
31+
|||,
32+
},
33+
},
34+
};
35+
36+
{ ['grafana-' + name]: kp.grafana[name] for name in std.objectFields(kp.grafana) }

jsonnet/kube-prometheus/components/grafana.libsonnet

+2
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ local defaults = {
2727
containers: [],
2828
datasources: [],
2929
config: {},
30+
ldap: null,
3031
plugins: [],
3132
env: [],
3233
};
@@ -57,6 +58,7 @@ function(params) {
5758
folderDashboards: g._config.folderDashboards,
5859
containers: g._config.containers,
5960
config+: g._config.config,
61+
ldap: g._config.ldap,
6062
plugins+: g._config.plugins,
6163
env: g._config.env,
6264
} + (

0 commit comments

Comments
 (0)