我有使用Helm安装Gitlab CE,但是我们的AD用户不能登录到这个平台。登录UI中显示了以下错误:Could not authenticate you from Ldapmain because "Invalid credentials for userX"
用户的无效凭据 (但凭据可以!)
安装:
helm upgrade --install gitlab gitlab/gitlab --namespace my-ns --tiller-namespace tiller-ns --timeout 600 --set global.edition=ce --set global.hosts.domain=example.com --set global.hosts.externalIP=<ExternalIPAddressAllocatedToTheNGINXIngressControllerLBService> --set nginx-ingress.enabled=false --set global.ingress.class=mynginx-ic --set certmanager.install=false --set global.ingress.configureCertmanager=false --set gitlab-runner.install=false --set prometheus.install=false --set registry.enabled=false --set gitlab.gitaly.persistence.enabled=false --set postgresql.persistence.enabled=false --set redis.persistence.enabled=false --set minio.persistence.enabled=false --set global.appConfig.ldap.servers.main.label='LDAP' --set global.appConfig.ldap.servers.main.host=<IPAddressOfMyDomainController> --set global.appConfig.ldap.servers.main.port='389' --set global.appConfig.ldap.servers.main.uid='sAMAccountName' --set global.appConfig.ldap.servers.main.bind_dn='CN=testuser,OU=sampleOU3,OU=sampleOU2,OU=sampleOU1,DC=example,DC=com' --set global.appConfig.ldap.servers.main.password.secret='gitlab-ldap-secret' --set global.appConfig.ldap.servers.main.password.key='password'
Notes
-I以前分别安装了我自己的NGINX控制器:
helm install stable/nginx-ingress --name nginx-ingress --namespace my-ns --tiller-namespace tiller-ns --set controller.ingressClass=mynginx-ic
-I之前为配置为bind_dn的用户创建了一个密码('CN=testuser,OU=sampleOU3,OU=sampleOU2,OU=sampleOU1,DC=example,DC=com')。密码使用base64编码,如文献资料中所示
档案:gitlab-ldap-分泌.ldap
apiVersion: v1
kind: Secret
metadata:
name: gitlab-ldap-secret
data:
password: encodedpass-blablabla
在安装图表的过程中,为了在命令行中提供所有这些参数,我尝试了配置-Instead提供的各种values.yaml中的所有参数,但为了再现目的,这里似乎更容易用这种方式进行文档记录。
-I尝试添加了这些参数,但没有结果:
--set global.appConfig.ldap.servers.main.encryption='plain'
--set global.appConfig.ldap.servers.main.base='OU=sampleOU1,DC=example,DC=com'
-To使它更加简单,我们没有考虑任何组件的持久性。这就是为什么这些都被设置为假的原因:
--set gitlab.gitaly.persistence.enabled=false
--set postgresql.persistence.enabled=false
--set redis.persistence.enabled=false
--set minio.persistence.enabled=false
*我确实需要持久化,但这次我们只关注LDAP身份验证,这是我目前的主要问题。
-I已经向我的系统管理员进行了检查,我们在中使用了平原389。无加密
我的环境
kubectl.exe version
Client Version: version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.1", GitCommit:"4485c6f18cee9a5d3c3b4e523bd27972b1b53892", GitTreeState:"clean", BuildDate:"2019-07-18T09:18:22Z", GoVersion:"go1.12.5", Compiler:"gc", Platform:"windows/amd64"}
Server Version: version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.1", GitCommit:"4485c6f18cee9a5d3c3b4e523bd27972b1b53892", GitTreeState:"clean", BuildDate:"2019-07-18T09:09:21Z", GoVersion:"go1.12.5", Compiler:"gc", Platform:"linux/amd64"}
helm version
Client: &version.Version{SemVer:"v2.14.3", GitCommit:"0e7f3b6637f7af8fcfddb3d2941fcc7cbebb0085", GitTreeState:"clean"}
Server: &version.Version{SemVer:"v2.14.3", GitCommit:"0e7f3b6637f7af8fcfddb3d2941fcc7cbebb0085", GitTreeState:"clean"}
helm ls --tiller-namespace tiller-ns
NAME REVISION UPDATED STATUS CHART APP VERSION NAMESPACE
gitlab 1 Tue Oct 29 18:16:06 2019 DEPLOYED gitlab-2.3.7 12.3.5 my-ns
kubectl.exe get nodes
NAME STATUS ROLES AGE VERSION
kubernetes01.example.com Ready master 102d v1.15.1
kubernetes02.example.com Ready <none> 7h16m v1.15.1
kubernetes03.example.com Ready <none> 102d v1.15.1
kubernetes04.example.com Ready <none> 11d v1.15.1
安装此图表后,一切似乎都正常:
kubectl.exe get pods
NAME READY STATUS RESTARTS AGE
gitlab-gitaly-0 1/1 Running 0 65m
gitlab-gitlab-exporter-5b649bfbb-5pn7q 1/1 Running 0 65m
gitlab-gitlab-shell-7d9497fcd7-h5478 1/1 Running 0 65m
gitlab-gitlab-shell-7d9497fcd7-jvt9p 1/1 Running 0 64m
gitlab-migrations.1-gf8jr 0/1 Completed 0 65m
gitlab-minio-cb5945f79-kztmj 1/1 Running 0 65m
gitlab-minio-create-buckets.1-d2bh5 0/1 Completed 0 65m
gitlab-postgresql-685b68b4d7-ns2rw 2/2 Running 0 65m
gitlab-redis-5cb5c8b4c6-jtfnr 2/2 Running 0 65m
gitlab-sidekiq-all-in-1-5b997fdffd-n5cj2 1/1 Running 0 65m
gitlab-task-runner-5777748f59-gkf9v 1/1 Running 0 65m
gitlab-unicorn-764f6548d5-fmggl 2/2 Running 0 65m
gitlab-unicorn-764f6548d5-pqcm9 2/2 Running 0 64m
现在,如果我尝试使用LDAP用户登录,就会得到前面提到的错误。如果我进入独角兽舱,我可以在/var/log/gitlab/production.log
中看到以下消息:Production.log
我遗漏了什么?我还需要配置其他东西吗?我已经配置了所有用于LDAP身份验证的参数,提到了这里,但我仍然很难进行身份验证。
对不起,我是新来的Gitlab和它的所有内部组件。我似乎找不到编辑这个文件的地方,例如:/etc/gitlab/gitlab.rb
(我应该在哪个pod中输入?)我确实输入了其中的每一个,没有找到这个配置文件)。另外,我注意到一些文档说可以执行一些诊断工具,比如gitlab-rake
gitlab:ldap:check
,或者实用程序(如gitlab-ctl reconfigure
),但是.这些在哪里运行??在独角兽舱上?gitlab-shell?我注意到不同的Gitlab文档页引用了其中一些工具来排除事故,但我不认为这个图表遵循相同的体系结构。
例如,我看过这个职位,因为这似乎是同一个问题,但我找不到/etc/gitlab/gitlab.rb
任何帮助都将不胜感激。自从我处理这个问题已经有几个星期了。
发布于 2019-11-22 15:02:47
我忘了回答这个问题。通过再次添加基参数,我设法解决了这个问题。
正如我在最初的文章中所解释的那样,我已经尝试过这样做了,但事实证明,我需要避开逗号:
--set global.appConfig.ldap.servers.main.base='OU=sampleOU1\,DC=example\,DC=com'
*与您的bind_dn一样,逗号也需要转义。
我能够意识到,多亏了LDAP诊断工具gitlab-rake
,它在这个舵图中有点不同。您必须进入独角兽容器上的/srv/gitlab
目录,并执行./bin/rake gitlab:ldap:check
。这让我明白问题出在哪里。此外,您还可以检查/srv/gitlab/config/gitlab.yaml
文件,以查看您的LDAP参数是否已成功加载/解析。
还可以运行以下命令来查看有关Gitlab部署的更多信息:./bin/rake gitlab:env:info
https://stackoverflow.com/questions/58618646
复制相似问题