Jenkins -Kubernetes插件代理未部署到配置的云
我们目前正在尝试让詹金斯在另一个Kubernetes群集中部署代理商(通过GKE提供)。
我们已经在/configureclouds
下添加了新的群集,并通过cloud:'devkube'
。 net/1nfbj.png“ rel =“ nofollow noreferrer”>云配置
基本的jenkinsfile:
pipeline {
agent none
stages {
stage('Start manangement container') {
agent {
kubernetes {
cloud 'devkube'
defaultContainer 'management'
yaml '''
apiVersion: v1
kind: Pod
spec:
containers:
- name: management
image: eu.gcr.io/dev/management:latest
command:
- cat
tty: true
'''
}
}
steps {
sleep 300
}
}
}
}
问题是,詹金斯不将代理部署到该云中,而是对我们的第一个kubernetes群集> kubernetes 。
我们已经验证了通过cloud提供的名称:...
针对配置的云进行检查;不匹配会导致立即错误。
在/configureclouds
报告成功下执行“测试连接”,但是值仅报告群集版本,因此值有限。
构建输出识别配置的云:创建的pod:devkube/devault-01-Test-test-Pipelines-Test-9-3xd3b-17c8j-6q6xj
,但POD将部署到kubernetes < /代码>无论如何。
我们是否缺少任何明显的东西,还是有已知的错误?
使用的版本:
- Jenkins:2.263.1
- Kubernetes插件:1.28.5
we are currently trying to get our Jenkins to deploy agents in another Kubernetes Cluster (provided via GKE).
We have added the new cluster under /configureClouds
and are referencing it in the pipeline script via cloud: 'devkube'
Basic Jenkinsfile:
pipeline {
agent none
stages {
stage('Start manangement container') {
agent {
kubernetes {
cloud 'devkube'
defaultContainer 'management'
yaml '''
apiVersion: v1
kind: Pod
spec:
containers:
- name: management
image: eu.gcr.io/dev/management:latest
command:
- cat
tty: true
'''
}
}
steps {
sleep 300
}
}
}
}
Problem is that, Jenkins does not deploy the agent to that cloud, but to our first Kubernetes cluster, that has the default name kubernetes
.
We have already verified, that the name provided via cloud: ...
is checked against the configured clouds; a mismatch results in an immediate error.
Executing "Test Connection" under /configureClouds
reports success, but value is limited as it only reports the Cluster version.
Build output recognizes the configured cloud: Created Pod: devkube default/tools-01-test-pipelines-test-9-3xd3b-17c8j-6q6xj
, but the pod will be deployed to kubernetes
anyhow.
Are we missing anything obvious, or is there a known bug?
Used versions:
- Jenkins: 2.263.1
- Kubernetes Plugin: 1.28.5
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我看了图像“云配置”,您确定应该将“ Kubernetes名称空间”设置为“默认值”?
我们配置的方式是,“ kubernetes名称空间”必须具有实际的k8s名称空间的名称(在我们的情况下,是一个openShift项目):
I had a look at the image 'Cloud Configuration', are you sure 'Kubernetes Namespace' should be set to 'default'?
The way we have configured is that the 'Kubernetes Namespace' must have the name of the actual k8s namespace(in our case, an OpenShift project):