17.5.2. 使用 RFC2307 模式及用户定义的名称映射来同步组
使用用户定义的名称映射同步组时,配置文件会更改为包含这些映射,如下所示。
使用 RFC 2307 模式及用户定义的名称映射的 LDAP 同步配置:rfc2307_config_user_defined.yaml
kind: LDAPSyncConfig
apiVersion: v1
groupUIDNameMapping:
"cn=admins,ou=groups,dc=example,dc=com": Administrators
rfc2307:
groupsQuery:
baseDN: "ou=groups,dc=example,dc=com"
scope: sub
derefAliases: never
pageSize: 0
groupUIDAttribute: dn
groupNameAttributes: [ cn ]
groupMembershipAttributes: [ member ]
usersQuery:
baseDN: "ou=users,dc=example,dc=com"
scope: sub
derefAliases: never
pageSize: 0
userUIDAttribute: dn
userNameAttributes: [ mail ]
tolerateMemberNotFoundErrors: false
tolerateMemberOutOfScopeErrors: false
先决条件
- 创建配置文件。
流程
使用
rfc2307_config_user_defined.yaml文件运行同步:$ oc adm groups sync --sync-config=rfc2307_config_user_defined.yaml --confirmOpenShift Container Platform 创建以下组记录作为上述同步操作的结果:
使用
rfc2307_config_user_defined.yaml文件创建的 OpenShift Container Platform 组apiVersion: user.openshift.io/v1 kind: Group metadata: annotations: openshift.io/ldap.sync-time: 2015-10-13T10:08:38-0400 openshift.io/ldap.uid: cn=admins,ou=groups,dc=example,dc=com openshift.io/ldap.url: LDAP_SERVER_IP:389 creationTimestamp: name: Administrators1 users: - jane.smith@example.com - jim.adams@example.com- 1
- 由用户定义的名称映射指定的组名称。