首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在Kubernetes上运行SDK管道

如何在Kubernetes上运行SDK管道
EN

Stack Overflow用户
提问于 2019-07-10 04:47:41
回答 1查看 487关注 0票数 1

目前,我正尝试使用以下教程在Kubernetes集群上设置SDK:

https://blogs.sap.com/2018/09/26/autoscaling-of-sap-s4hana-cloud-sdk-continuous-delivery-toolkit-on-kubernetes/

该设置工作良好,我能够配置和启动管道。它还成功地生成并连接到作为代理运行的新POD。然而,在mvn清洁安装步骤中,容器执行是在POD上完成的,但是由于一些未知的原因,这失败了。

我遵循了本教程中的故障排除提示,特别是通过测试Jenkinsfile检查与Kubernetes集群的连接,但这一过程成功完成,似乎不是问题所在。我还试图检查POD上的容器-exec容器的日志,但是没有返回任何内容(对于jnlp容器,我得到了显示成功连接的日志)。

在构建管道中,将给出以下日志语句:

代码语言:javascript
复制
16:44:02  --- Begin library step of: dockerExecute ---
expected to call com.sap.piper.analytics.Telemetry$_getInstance_closure1.call but wound up catching com.sap.piper.analytics.Telemetry.piperOsDefaultReporting; see: https://jenkins.io/redirect/pipeline-cps-method-mismatches/
[Pipeline] timeout
16:44:02  Timeout set to expire in 10 sec
[Pipeline] {
[Pipeline] httpRequest
[Pipeline] }
[Pipeline] // timeout
[Pipeline] echo
16:44:02  --- Begin library step of: dockerExecuteOnKubernetes ---
expected to call com.sap.piper.analytics.Telemetry$_getInstance_closure1.call but wound up catching com.sap.piper.analytics.Telemetry.piperOsDefaultReporting; see: https://jenkins.io/redirect/pipeline-cps-method-mismatches/
[Pipeline] timeout
16:44:02  Timeout set to expire in 10 sec
[Pipeline] {
[Pipeline] httpRequest
[Pipeline] }
[Pipeline] // timeout
[Pipeline] stash
16:44:05  Stashed 115 file(s)
[Pipeline] podTemplate
[Pipeline] {
[Pipeline] node
16:44:20  Still waiting to schedule task
16:44:20  ‘dynamic-agent-7eb57391-be34-4e11-b2e7-e4c3c79e8da1-3lnfp-lwv8q’ is offline
16:44:26  Agent dynamic-agent-7eb57391-be34-4e11-b2e7-e4c3c79e8da1-3lnfp-lwv8q is provisioned from template Kubernetes Pod Template
16:44:26  Agent specification [Kubernetes Pod Template] (7eb57391-be34-4e11-b2e7-e4c3c79e8da1): 
16:44:26  yaml:
16:44:26  {
16:44:26      "apiVersion": "v1",
16:44:26      "kind": "Pod",
16:44:26      "metadata": {
16:44:26          "lables": "7eb57391-be34-4e11-b2e7-e4c3c79e8da1"
16:44:26      },
16:44:26      "spec": {
16:44:26          "containers": [
16:44:26              {
16:44:26                  "name": "jnlp",
16:44:26                  "image": "s4sdk/jenkins-agent-k8s:latest"
16:44:26              },
16:44:26              {
16:44:26                  "name": "container-exec",
16:44:26                  "image": "maven:3.5-jdk-8-alpine",
16:44:26                  "imagePullPolicy": "IfNotPresent",
16:44:26                  "env": [
16:44:26                      
16:44:26                  ],
16:44:26                  "command": [
16:44:26                      "/usr/bin/tail",
16:44:26                      "-f",
16:44:26                      "/dev/null"
16:44:26                  ]
16:44:26              }
16:44:26          ],
16:44:26          "securityContext": {
16:44:26              
16:44:26          }
16:44:26      }
16:44:26  }
16:44:26  
16:44:27  Running on dynamic-agent-7eb57391-be34-4e11-b2e7-e4c3c79e8da1-3lnfp-lwv8q in /home/piper/workspace/address-manager_master
[Pipeline] {
[Pipeline] echo
16:44:27  ContainerConfig: [name:container-exec]
[Pipeline] container
[Pipeline] {
[Pipeline] echo
16:44:27  Unstash content: workspace-7eb57391-be34-4e11-b2e7-e4c3c79e8da1
[Pipeline] unstash
[Pipeline] echo
16:44:31  [INFO][dockerExecute] Executing inside a Kubernetes Pod
[Pipeline] sh
16:49:39  process apparently never started in /home/piper/workspace/address-manager_master@tmp/durable-bc02ec77
16:49:39  (running Jenkins temporarily with -Dorg.jenkinsci.plugins.durabletask.BourneShellScript.LAUNCH_DIAGNOSTICS=true might make the problem clearer)
[Pipeline] sh
16:54:47  process apparently never started in /home/piper/workspace/address-manager_master@tmp/durable-1f05b1bc
16:54:47  (running Jenkins temporarily with -Dorg.jenkinsci.plugins.durabletask.BourneShellScript.LAUNCH_DIAGNOSTICS=true might make the problem clearer)
[Pipeline] echo
16:54:47  script returned exit code -2
[Pipeline] }
[Pipeline] // container
[Pipeline] }
[Pipeline] // node
[Pipeline] }
[Pipeline] // podTemplate
[Pipeline] unstash
[Pipeline] echo
16:54:48  No such saved stash ‘container-7eb57391-be34-4e11-b2e7-e4c3c79e8da1’
[Pipeline] libraryResource
[Pipeline] echo
16:54:48  ----------------------------------------------------------
16:54:48  --- An error occurred in the library step: dockerExecuteOnKubernetes
16:54:48  ----------------------------------------------------------
16:54:48  
16:54:48  The following parameters were available to the step:
16:54:48  ***
16:54:48  [script:Script1@1f99bbb0, dockerImage:maven:3.5-jdk-8-alpine, dockerPullImage:true, stashContent:[]]
16:54:48  ***
16:54:48  
16:54:48  The error was:
16:54:48  ***
16:54:48  hudson.AbortException: script returned exit code -2
16:54:48  ***
16:54:48  
16:54:48  Further information:
16:54:48  * Documentation of library step dockerExecuteOnKubernetes: https://sap.github.io/jenkins-library/steps/dockerExecuteOnKubernetes/
16:54:48  * Source code of library step dockerExecuteOnKubernetes: https://github.com/SAP/jenkins-library/blob/master/vars/dockerExecuteOnKubernetes.groovy
16:54:48  * Library documentation: https://sap.github.io/jenkins-library/
16:54:48  * Library repository: https://github.com/SAP/jenkins-library/
16:54:48  
16:54:48  ----------------------------------------------------------
16:54:48  --- End library step of: dockerExecuteOnKubernetes ---

我知道这个特性在博客中被标记为实验性的,但是几个月前我成功地建立了这样一个场景,所以有些东西似乎已经改变了。这是否仍然是操作管道的有效方案?任何提示,如何继续和使这项工作将是真正的感谢!

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-07-15 07:24:05

评论中所提供的变化起到了作用。对pipeline_config.yaml进行简单的更改以使用不同的图像:

config.yml#L5

后来一切都很顺利。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/56963559

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档