KubeSphere版本信息
例如:v3.2.1。使用kk安装。
stderr: fatal: unable to access ‘https://test.dev/firstline.git/’: server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none
尝试建立一个流水线,拉取代码失败,如何处理?
KubeSphere版本信息
例如:v3.2.1。使用kk安装。
stderr: fatal: unable to access ‘https://test.dev/firstline.git/’: server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none
尝试建立一个流水线,拉取代码失败,如何处理?
因为你的证书比较新,导致 jnlp 和 agent 的容器内的根证书无法验证通过。可以尝试跳过 SSL 证书验证。后续我们将持续更新镜像中的依赖。
johnniang 多谢,我想着也是先跳过ssl验证。
FatuityCookie 尝试设置 GIT 相关的环境变量。
试试 jenkins/inbound-agent:4.10-2
这个镜像是否可用
Rick 不太明白如何尝试,Jenkins 系统设置 (kubesphere.com.cn) 是需要更改此配置么?
FatuityCookie
把如下图所示的ConfigMap修改
把 jenkins/jnlp-slave:3.27-1
替换为 jenkins/inbound-agent:4.10-2
确认一下你替换的是 jenkins.yaml 还是 jenkins_user.yaml?
johnniang jenkins_user.yaml
FatuityCookie 修改该配置之后需要等待 70s 左右,请参考:https://kubesphere.com.cn/docs/devops-user-guide/how-to-use/jenkins-setting/#%E4%BF%AE%E6%94%B9-configmap
现在运行一个新的流水线试试。
johnniang 不行 我用的是maven 官方容器 server certificate verification failed. CAfile: none CRLfile: none
FatuityCookie 建议提供一下你的 Jenkinsfile。
> pipeline {
>
> agent {
>
> node {
>
> label 'maven'
>
> }
>
> }
>
> stages {
>
> stage('docker login') {
>
> steps {
>
> container('maven') {
>
> sh 'echo $HARBOR_CREDENTIAL_PSW | docker login $REGISTRY -u \\'robot$robot-test\\' --password-stdin'
>
> }
>
> }
>
> }
>
> stage('build & push') {
>
> agent none
>
> steps {
>
> container('maven') {
>
> git(credentialsId: 'test-devops', url: 'https://gitlab.dev/fenghui/kubesphere-demo.git', branch: 'master', changelog: true, poll: false)
>
> sh 'cd kubesphere-demo/src && docker build -t $REGISTRY/$HARBOR_NAMESPACE/$APP_NAME:devops-test .'
>
> sh 'docker push $REGISTRY/$HARBOR_NAMESPACE/$APP_NAME:devops-test'
>
>
>
> }
>
> }
>
> }
>
> }
>
> environment {
>
> REGISTRY = '192.168.111.75:30002'
>
> HARBOR_NAMESPACE = 'ks-devops-harbor'
>
> APP_NAME = 'docker-example-dotnet'
>
> HARBOR_CREDENTIAL = credentials('robot-test')
>
> }
>
> }
把 git step 放到 container 外面试试。
+ git(credentialsId: 'test-devops', url: 'https://gitlab.dev/fenghui/kubesphere-demo.git', branch: 'master', changelog: true, poll: false)
container('maven') {
- git(credentialsId: 'test-devops', url: 'https://gitlab.dev/fenghui/kubesphere-demo.git', branch: 'master', changelog: true, poll: false)
johnniang 依旧是 server certificate verification failed. CAfile: none CRLfile: none
FatuityCookie大佬问题解决了吗?
这样可以了,git clone 用 https://用户:密码@gitlab.com 的形式
商业产品与合作咨询