环境说明:
k8s v1.18.0 和 v1.22
Jenkins版本:Jenkins 2.346.3
kubernetes插件版本:3690.va_9ddf6635481
问题描述:
0、用sts运行的Jenkins的50000端口是正常的。
1、Jenkins pipeline 构建,调用k8s 动态 slave pod ,一直 xxx is offline
2、日志报错NoSuchMethodError 。
3、删除这个manager node还会报错没有这个namespace啥的。
情况2:
换了个 低版本1.31.3/ 的kubernetes插件, 他能跑了。 但是会运行很多份pod,一直拉镜像失败 (镜像 jenkins/inbound-agent:4.11-1-jdk11)
手动pull 下来后,还是寄。
处理方法:
换Jenkins版本为:
docker pull jenkins/jenkins:2.387.3-lts-centos7
安装默认搜索出来的kubernetes插件即可。 3923.v294a_d4250b_91
#k8s插件下载网址(hpi文件)
http://mirror.xmission.com/jenkins/plugins/kubernetes/
换版本解决了,具体原因也没去深究,看了些许参考链接。 文章底部有提及
运行成功的截图:
一些参考:
参考链接:
https://github.com/jenkinsci/kubernetes-plugin/blob/master/src/main/kubernetes/jenkins.yml
https://stackoverflow.com/questions/38486848/kubernetes-jenkins-plugin-slaves-always-offline
https://stackoverflow.com/questions/55245184/kubernetes-dynamic-jenkins-slaves-with-multiple-build-executors
https://stackoverflow.com/questions/38486848/kubernetes-jenkins-plugin-slaves-always-offline
https://stackoverflow.com/questions/55245184/kubernetes-dynamic-jenkins-slaves-with-multiple-build-executors
https://stackoverflow.com/questions/68141633/cant-provision-jenkins-slave-pods-due-to-unknown-client-name-error
https://kumorilabs.com/blog/dynamically-provisioned-jenkins-slaves-kubernetes-aws/
https://www.appsloveworld.com/docker/100/77/kubernetes-jenkins-slaves-are-offline
https://itnext.io/dynamic-jenkins-agent-from-kubernetes-4adb98901906
https://verifa.io/blog/how-to-debug-failing-build-agent-pods-in-kubernetes-enabled-jenkins/index.html
https://issues.jenkins.io/plugins/servlet/mobile#issue/JENKINS-40805
https://issues.jenkins.io/plugins/servlet/mobile#issue/JENKINS-46444
https://gvasanka.medium.com/workaround-lets-solve-the-jenkins-slave-connection-issue-with-the-jenkins-kubernetes-plugin-b0fb78f9aade
https://www.edureka.co/community/18902/kubernetes-jenkins-slave-node-shows-offline
https://stackoverflow.com/questions/46656268/why-are-our-jenkins-kubernetes-pods-slaves-showing-as-offline
https://stackoverflow.com/questions/38969044/jenkins-kubernetes-jenkins-slave-node-is-offline
https://stackoverflow.com/questions/64053913/jenkins-slave-pod-is-offline
https://github.com/GoogleCloudPlatform/continuous-deployment-on-kubernetes/issues/111