Red Hat Training

A Red Hat training course is available for OpenShift Container Platform

14.3. 运行 LDAP 同步

创建 同步配置文件 后,同步可以开始。OpenShift Container Platform 允许管理员与同一服务器进行多种不同类型的同步。

注意

默认情况下,所有组同步或修剪操作都是空运行,因此您必须在 sync-groups 命令上设置 --confirm 标志,以便更改 OpenShift Container Platform 组记录。

将 LDAP 服务器上的所有组与 OpenShift Container Platform 同步:

$ oc adm groups sync --sync-config=config.yaml --confirm

同步所有已在 OpenShift Container Platform 中并与配置文件中指定的 LDAP 服务器中的组对应的组:

$ oc adm groups sync --type=openshift --sync-config=config.yaml --confirm

要将 LDAP 组的子集与 OpenShift Container Platform 同步,您可以使用白名单文件、黑名单文件或两者:

注意

您可以使用黑名单文件、白名单文件或白名单字面量的任意组合。白名单和黑名单文件必须每行包含一个唯一组标识符,您可以在该命令本身中直接包含白名单字面量。这些准则适用于在 LDAP 服务器上找到的组,以及 OpenShift Container Platform 中已存在的组。

$ oc adm groups sync --whitelist=<whitelist_file> \
                   --sync-config=config.yaml    \
                   --confirm
$ oc adm groups sync --blacklist=<blacklist_file> \
                   --sync-config=config.yaml    \
                   --confirm
$ oc adm groups sync <group_unique_identifier>    \
                   --sync-config=config.yaml    \
                   --confirm
$ oc adm groups sync <group_unique_identifier>    \
                   --whitelist=<whitelist_file> \
                   --blacklist=<blacklist_file> \
                   --sync-config=config.yaml    \
                   --confirm
$ oc adm groups sync --type=openshift             \
                   --whitelist=<whitelist_file> \
                   --sync-config=config.yaml    \
                   --confirm