同步ldap账户
hongmingK零SK壹S
zhejiez 你的环境是3.0 还是 3.1 ? 参照这个文档进行配置 https://kubesphere.com.cn/docs/access-control-and-account-management/configuring-authentication/#ldap-authentication, 需要重启 ks-apiserver
hongmingK零SK壹S
- 已编辑
zhejiez 把这些配置再恢复一下 https://github.com/kubesphere/ks-installer/blob/v3.0.0/roles/ks-core/config/templates/kubesphere-config.yaml.j2#L16-L21,不能删了, 这个是内置 LDAP 的配置
hongmingK零SK壹S
identityProviders 这个 section 才是配置外部LDAP认证
这个是KS内置LDAP的配置
hongmingK零SK壹S
zhejiez 看看这个 https://kubesphere.com.cn/docs/faq/access-control/cannot-login/, v3.0.0 对 kubesphere-system 下的 LDAP 和 jenkins 依赖比较重,这两个服务异常会影响用户状态同步
hongmingK零SK壹S
for user in `kubectl get users -l \!iam.kubesphere.io/origin-uid,iam.kubesphere.io/identify-provider -o jsonpath="{.items[*].metadata.name}"`; do kubectl label user $user iam.kubesphere.io/origin-uid=$user; done
cat << EOF | kubectl apply -f -
apiVersion: iam.kubesphere.io/v1alpha2
kind: GlobalRoleBinding
metadata:
name: pre-registration
roleRef:
apiGroup: iam.kubesphere.io
kind: GlobalRole
name: pre-registration
subjects:
- apiGroup: rbac.authorization.k8s.io
kind: Group
name: pre-registration
EOF