已经创建了devops项目,可是提示无法解析我的gitlab地址,gitlab地址是公网的都能正常访问

`

git –version # timeout=10
using GIT_ASKPASS to set credentials
git ls-remote –symref http://git项目地址/eureka.git # timeout=10
ERROR: [Tue Nov 24 06:44:23 UTC 2020] Could not update folder level actions from source
hudson.plugins.git.GitException: Command “git ls-remote –symref http://git项目地址//eureka.git” returned status code 128:
stdout:
stderr: fatal: unable to access ‘http://git项目地址/eureka.git/’: Could not resolve host: git项目地址
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2042)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1761)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1666)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1657)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.getRemoteSymbolicReferences(CliGitAPIImpl.java:2919)
at jenkins.plugins.git.AbstractGitSCMSource.retrieveActions(AbstractGitSCMSource.java:1093)
at jenkins.scm.api.SCMSource.fetchActions(SCMSource.java:848)
at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:591)
at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:277)
at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:164)
at jenkins.branch.MultiBranchProject$BranchIndexing.run(MultiBranchProject.java:1025)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:429)
[Tue Nov 24 06:44:23 UTC 2020] Finished branch indexing. Indexing took 8 sec
FATAL: Failed to recompute children of eureka-server96pm5 » test
hudson.plugins.git.GitException: Command “git ls-remote –symref http://git项目地址/eureka.git” returned status code 128:
stdout:
stderr: fatal: unable to access ‘http://git项目地址/eureka.git/’: Could not resolve host: git项目地址
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2042)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1761)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1666)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1657)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.getRemoteSymbolicReferences(CliGitAPIImpl.java:2919)
at jenkins.plugins.git.AbstractGitSCMSource.retrieveActions(AbstractGitSCMSource.java:1093)
at jenkins.scm.api.SCMSource.fetchActions(SCMSource.java:848)
at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:591)
at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:277)
at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:164)
at jenkins.branch.MultiBranchProject$BranchIndexing.run(MultiBranchProject.java:1025)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:429)
Finished: FAILURE
`

我的服务器都能正常访问外网,请问是kubesphere还要配置什么吗

进入 Jenkins 的 pod 中执行下 git clone 命令试试:

    Rick 是在ks-jenkin里面吗?
    Cloning into 'eureka'...
    fatal: unable to access 'http://****/eureka.git/': Could not resolve host: ****

    不行,没法搞下来,我这个git是域名这个有影响吗

    那可能是域名解析的问题,试试其他的公网域名。

      Rick
      curl http://www.baidu.com
      curl: (6) Could not resolve host: www.baidu.com

      应该就是域名解析不了,请问这个该怎么改?

      检查下集群的网络组件配置吧,这块我就不是很清楚了。

        Rick 别啊大神,你们有其他人会弄这个吗?容器内部是不是都没法访问外网呀

        正常是可以访问外网的