0
点赞
收藏
分享

微信扫一扫

jenkins slave节点运行在kubernetes构建mvn环境报错:java.io.IOException: Timed out waiting for websocket connectio


背景:jenkins slave节点运行在kubernetes构建mvn环境,运行​​官网提供的demo​​

podTemplate(containers: [
containerTemplate(name: 'maven', image: 'maven:3.8.1-jdk-8', command: 'sleep', args: '99d'),
containerTemplate(name: 'golang', image: 'golang:1.16.5', command: 'sleep', args: '99d')
]) {

node(POD_LABEL) {
stage('Get a Maven project') {
git 'https://github.com/jenkinsci/kubernetes-plugin.git'
container('maven') {
stage('Build a Maven project') {
sh 'mvn -B -ntp clean install'
}
}
}

stage('Get a Golang project') {
git url: 'https://github.com/hashicorp/terraform.git', branch: 'main'
container('golang') {
stage('Build a Go project') {
sh '''
mkdir -p /go/src/github.com/hashicorp
ln -s `pwd` /go/src/github.com/hashicorp/terraform
cd /go/src/github.com/hashicorp/terraform && make
'''
}
}
}

}
}

问题:报错:​​java.io.IOException: Timed out waiting for websocket connection. You should increase the value of system property org.csanchez.jenkins.plugins.kubernetes.pipeline.ContainerExecDecorator.websocketConnectionTimeout currently set at 30 seconds​

解决:把Jenkins升级到2.328以上版本,kubernetes版本升级到1.31.2即可解决这个问题

参考:​​https://stackoverflow.com/questions/70524933/jenkins-with-kubernetes-client-plugin-nosuchmethoderror​​



举报

相关推荐

0 条评论