Skip to content
Open
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
116 changes: 101 additions & 15 deletions docs/OpenLDAP.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,41 @@
## DevOps-X with OpenLDAP

## Custom OpenLDAP for Product
### 写在前面的话

*注意: 以下配置是在执行DevOps-X工具链安装前配置的*
DevOps-X 中使用到的组件对接OpenLDAP的方式不尽相同,有的可以通过安装前的配置定义即可对接上,而有的组件是内置对接OpenLDAP功能的,这部分组件就需要在安装完成后在相应页面进行配置修改。

* Gitlab、Sonarqube需安装前配置对接OpenLDAP
* Jenkins、Redmine、Nexus需安装后页面配置OpenLDAP

### 详细配置过程

---
安装前配置

* 自定义OpenLDAP配置
* Gitlab配置OpenLDAP
* Sonarqube配置OpenLDAP
* Jenkins配置OpenLDAP插件

DevOps-X安装

安装后配置

* Jenkins配置对接OpenLDAP
* Redmine配置对接OpenLDAP
* Nexus 配置对接OpenLDAP

OpenLDAP用户创建

* 用户创建

<br>

### 安装前配置
---

**自定义OpenLDAP配置**

1. 自定义OpenLDAP配置

修改文件`devops-x/helm/openldap/values.yaml`

Expand All @@ -30,9 +61,21 @@ PhpLdapAdmin:
- ldapadmin.devopsedu.com ## phpldapadmin访问域名
```

修改完之后,保存
修改完之后,保存。

`使用上述openldap配置后生成的配置信息如下`

```
LDAP_HOST: openldap.default.svc.cluster.local
LDAP_PORT: 389
LDAP_BIND_DN: "cn=admin,dc=devopsedu,dc=com"
LDAP_PASS: "admin"
LDAP_BASE: "dc=devopsedu,dc=com"
```

2. 配置Gitlab对接OpenLDAP
<br>

**Gitlab配置OpenLDAP**

修改文件`devops-x/helm/gitlab/values.yaml`

Expand Down Expand Up @@ -60,7 +103,9 @@ config:

修改完之后,保存

3. 配置SonarQube对接OpenLDAP
<br>

**Sonarqube配置OpenLDAP**

修改文件`devops-x/helm/sonarqube/values.yaml`

Expand Down Expand Up @@ -90,7 +135,9 @@ sonarProperties: |

修改完之后,保存

4. 配置Jenkins对接OpenLDAP
<br>

**Jenkins配置OpenLDAP插件**

修改文件`devops-x/helm/jenkins/values.yaml`

Expand All @@ -110,20 +157,59 @@ sonarProperties: |
...
```

详细配置请参考:[Jenkins配置LDAP链接](https://wiki.jenkins.io/display/JENKINS/LDAP+Plugin)
<br>

5. 配置Redmine 和 Sonatype-nexus对接OpenLDAP
### DevOps-X安装
---

由于应用本身已支持配置OpenLDAP ,因此,在页面直接添加OpenLDAP 相关配置 即可。
请[返回首页](https://github.com/unixhot/devops-x)开始你的Devops-X安装

6. 新增LDAP用户
<br>

请参考:`devops-x/helm/openldap/README.md` 中 TEST 部分。
### 安装后配置
---

**Jenkins配置对接OpenLDAP**

在Jenkins页面打开”系统管理“中的"全局安全配置",然后“启用安全”中 配置LDAP

## 开始安装
![参考如图](https://github.com/DINNAS/devops-x/blob/master/docs/jenkins-ldap-config-01.png)

在上述配置完成后,即可开始安装DevOpx-X 工具链
配置Server
```
ldap://openldap.default.svc.cluster.local:389
```
此处根据上述配置,使用默认端口389.

配置root DN
```
dc=devopsedu,dc=com
```

配置User search filter
```
uid={0}
```

配置Manager DN
```
cn=admin,dc=devopsedu,dc=com
```

配置Manager Password
```
admin
```

其他配置按照需求填写,以上配置详细解释,参照[Jenkins链接](https://wiki.jenkins.io/display/JENKINS/LDAP+Plugin)

上述配置完毕后,既可以在“安全组”中添加OpenLDAP中的用户到Jenkins中。

2. Redmine配置对接OpenLDAP


3. Nexus 配置对接OpenLDAP

请参考:`devops-x/helm/openldap/README.md` 中 TEST 部分。

**请开始你的安装**

Binary file added docs/jenkins-ldap-config-01.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions helm/gitlab/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -139,13 +139,13 @@ config:
LDAP_UID: "uid"
LDAP_METHOD: "plain"
LDAP_VERIFY_SSL: "false"
LDAP_BIND_DN: "cn=admin,dc=example,dc=com"
LDAP_BIND_DN: "cn=admin,dc=devopsedu,dc=com"
LDAP_PASS: "admin"
LDAP_TIMEOUT: "10"
LDAP_ACTIVE_DIRECTORY: "false"
LDAP_ALLOW_USERNAME_OR_EMAIL_LOGIN: "false"
LDAP_BLOCK_AUTO_CREATED_USERS: "false"
LDAP_BASE: "dc=example,dc=com"
LDAP_BASE: "dc=devopsedu,dc=com"
LDAP_USER_FILTER: ""


Expand Down
2 changes: 1 addition & 1 deletion helm/jenkins/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ Master:
- credentials-binding:1.16
- git:3.9.0
- gitlab:1.5.6
- ldap:1.2.0
- ldap:1.20
- ldapemail-plugin:0.8
# Used to approve a list of groovy functions in pipelines used the script-security plugin. Can be viewed under /scriptApproval
# ScriptApproval:
Expand Down
6 changes: 3 additions & 3 deletions helm/sonarqube/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,15 @@ plugins:
sonarProperties: |
sonar.security.realm=LDAP
ldap.url=ldap://openldap.default.svc.cluster.local:389
ldap.bindDn=cn=admin,dc=example,dc=com
ldap.bindDn=cn=admin,dc=devopsedu,dc=com
ldap.bindPassword=admin

ldap.user.baseDn=ou=users,dc=example,dc=com
ldap.user.baseDn=ou=users,dc=devopsedu,dc=com
ldap.user.request=(&(objectClass=inetOrgPerson)(uid={login}))
ldap.user.realNameAttribute=cn
ldap.user.emailAttribute=mail

ldap.group.baseDn=ou=groups,dc=example,dc=com
ldap.group.baseDn=ou=devopsx,dc=devopsedu,dc=com
ldap.group.request=(&(objectClass=posixGroup)(memberUid={uid}))


Expand Down