Jenkins -Kubernetes插件代理未部署到配置的云

发布于 2025-02-04 05:08:37 字数 1252 浏览 5 评论 0原文

我们目前正在尝试让詹金斯在另一个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'

Cloud Configuration

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

缱绻入梦 2025-02-11 05:08:37

我看了图像“云配置”,您确定应该将“ Kubernetes名称空间”设置为“默认值”?

我们配置的方式是,“ kubernetes名称空间”必须具有实际的k8s名称空间的名称(在我们的情况下,是一个openShift项目):

“使用K8S

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):

Use k8s ns name

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文