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

Create ldap configmap example #1376

Merged
merged 1 commit into from
Jan 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions examples/ldap/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
title: "LDAP configmap auth"
linkTitle: "LDAP configmap auth"
---

A basic example of a Grafana Deployment with LDAP integration. The LDAP integration in Grafana allows your Grafana users to login with their LDAP credentials
For cusomize you ldap-config configmap read [this](https://grafana.com/docs/grafana/latest/setup-grafana/configure-security/configure-authentication/ldap/)

{{< readfile file="resources.yaml" code="true" lang="yaml" >}}
64 changes: 64 additions & 0 deletions examples/ldap/resources.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
---
apiVersion: v1
kind: ConfigMap
metadata:
name: ldap-config
data:
ldap.toml: |
verbose_logging = true
[[servers]]
host = "ldap.grafana.org"
port = 389
use_ssl = true
start_tls = false
ssl_skip_verify = true
bind_dn = "user@grafana.org"
bind_password = 'user_password123'
search_filter = "(sAMAccountName=%s)"
search_base_dns = ["DC=grafana,DC=org"]
[servers.attributes]
name = "givenName"
surname = "sn"
username = "sAMAccountName"
member_of = "memberOf"
email = "mail"
[[servers.group_mappings]]
group_dn = "cn=superadmins,dc=grafana,dc=org"
org_role = "Admin"
grafana_admin = true
[[servers.group_mappings]]
group_dn = "cn=users,dc=grafana,dc=org"
org_role = "Editor"
[[servers.group_mappings]]
group_dn = "*"
org_role = "Viewer"
---
apiVersion: grafana.integreatly.org/v1beta1
kind: Grafana
metadata:
name: grafana
labels:
dashboards: "grafana"
spec:
config:
log:
mode: "console"
auth:
disable_login_form: "false"
auth.ldap:
enabled: "true"
config_file: /etc/grafana-configmaps/ldap.toml
deployment:
spec:
template:
spec:
containers:
- name: grafana
volumeMounts:
- mountPath: /etc/grafana-configmaps
name: grafana-configmaps
readOnly: false
volumes:
- name: grafana-configmaps
configMap:
name: ldap-config