• DevOps
  • 集群部署的kubepehere使用devops的流水线卡住

创建部署问题时,请参考下面模板,你提供的信息越多,越容易及时获得解答。如果未按模板创建问题,管理员有权关闭问题。
确保帖子格式清晰易读,用 markdown code block 语法格式化代码块。
你只花一分钟创建的问题,不能指望别人花上半个小时给你解答。

操作系统信息
例如:虚拟机,Centos7.9,4C/16G三台

Kubernetes版本信息
Client Version: version.Info{Major:"1", Minor:"22", GitVersion:"v1.22.12", GitCommit:"b058e1760c79f46a834ba59bd7a3486ecf28237d", GitTreeState:"clean", BuildDate:"2022-07-13T14:59:18Z", GoVersion:"go1.16.15", Compiler:"gc", Platform:"linux/amd64"}

Server Version: version.Info{Major:"1", Minor:"22", GitVersion:"v1.22.12", GitCommit:"b058e1760c79f46a834ba59bd7a3486ecf28237d", GitTreeState:"clean", BuildDate:"2022-07-13T14:53:39Z", GoVersion:"go1.16.15", Compiler:"gc", Platform:"linux/amd64"}

容器运行时

Client:

Version: 24.0.6

API version: 1.43

Go version: go1.20.7

Git commit: ed223bc

Built: Mon Sep 4 12:30:51 2023

OS/Arch: linux/amd64

Context: default

Server: Docker Engine - Community

Engine:

Version: 24.0.6

API version: 1.43 (minimum version 1.12)

Go version: go1.20.7

Git commit: 1a79695

Built: Mon Sep 4 12:32:17 2023

OS/Arch: linux/amd64

Experimental: false

containerd:

Version: v1.7.3

GitCommit: 7880925980b188f4c97b462f709d0db8e8962aff

runc:

Version: 1.1.9

GitCommit: v1.1.9-0-gccaecfc

docker-init:

Version: 0.19.0

GitCommit: de40ad0

KubeSphere版本信息
v3.4.1。在线安装。使用kk安装。

问题是什么
devops流水线无法启动

Started by user admin
[Pipeline] Start of Pipeline
[Pipeline] echo
[WARNING] containerTemplate option is deprecated, use yaml syntax to define containers.
[Pipeline] podTemplate
[Pipeline] {
[Pipeline] node
Created Pod: kubernetes kubesphere-devops-worker/testhwcvv-s-1-75l5l-fmq9h-52z6h
[Warning][kubesphere-devops-worker/testhwcvv-s-1-75l5l-fmq9h-52z6h][FailedScheduling] 0/3 nodes are available: 1 node(s) had taint {node-role.kubernetes.io/master: }, that the pod didn't tolerate, 2 Insufficient cpu.
Still waiting to schedule task
‘testhwcvv-s-1-75l5l-fmq9h-52z6h’ is offline
[Warning][kubesphere-devops-worker/testhwcvv-s-1-75l5l-fmq9h-52z6h][FailedScheduling] 0/3 nodes are available: 1 node(s) had taint {node-role.kubernetes.io/master: }, that the pod didn't tolerate, 2 Insufficient cpu.
[Warning][kubesphere-devops-worker/testhwcvv-s-1-75l5l-fmq9h-52z6h][FailedScheduling] 0/3 nodes are available: 1 node(s) had taint {node-role.kubernetes.io/master: }, that the pod didn't tolerate, 2 Insufficient cpu.
[Warning][kubesphere-devops-worker/testhwcvv-s-1-75l5l-fmq9h-52z6h][FailedScheduling] 0/3 nodes are available: 1 node(s) had taint {node-role.kubernetes.io/master: }, that the pod didn't tolerate, 2 Insufficient cpu.
[Warning][kubesphere-devops-worker/testhwcvv-s-1-75l5l-fmq9h-52z6h][FailedScheduling] 0/3 nodes are available: 1 node(s) had taint {node-role.kubernetes.io/master: }, that the pod didn't tolerate, 2 Insufficient cpu.
[Warning][kubesphere-devops-worker/testhwcvv-s-1-75l5l-fmq9h-52z6h][FailedScheduling] 0/3 nodes are available: 1 node(s) had taint {node-role.kubernetes.io/master: }, that the pod didn't tolerate, 2 Insufficient cpu.
[Warning][kubesphere-devops-worker/testhwcvv-s-1-75l5l-fmq9h-52z6h][FailedScheduling] 0/3 nodes are available: 1 node(s) had taint {node-role.kubernetes.io/master: }, that the pod didn't tolerate, 2 Insufficient cpu.

jenkins截图

流水线是用maven模板创建的

pipeline {

agent {

kubernetes {

inheritFrom 'maven'

containerTemplate {

name 'maven'

image 'maven:3.8.4-jdk-11'

}

}

}

stages {

stage('Clone repository') {

steps {

checkout([$class: 'GitSCM', branches: [[name: 'master']],

extensions: [[$class: 'CloneOption', depth: 1, shallow: true]], userRemoteConfigs: [[url: 'https://github.com/kubesphere-sigs/demo-java']]

])

}

}

stage('Run compile') {

steps {

container('maven') {

sh 'mvn compile'

}

}

}

stage('Run test') {

steps {

container('maven') {

sh 'mvn clean test'

}

}

}

stage('Run build') {

steps {

container('maven') {

sh 'mvn package'

}

}

}

stage('Archive artifacts') {

steps {

archiveArtifacts(artifacts: 'target/*.jar', followSymlinks: false)

}

}

}

}

之前allinone部署是可以的,这次换集群部署jenkins就出问题了

    mayadebi 日志里面提示了啊[Warning][kubesphere-devops-worker/testhwcvv-s-1-75l5l-fmq9h-52z6h][FailedScheduling] ↉ nodes are available: 1 node(s) had taint {node-role.kubernetes.io/master: }, that the pod didn’t tolerate, 2 Insufficient cpu.

    主节点设置了不能调度,其它两个节点cpu资源不足,pod调度不了

    mayadebi 运行流水线时,jenkins 会创建一个 agent pod 来运行,上面的报错提示:master 节点禁止调度,worker 节点的 CPU 不足导致无法创建 agent pod ;可以尝试增加 worker 节点的资源配置来解决此问题;