如何在Kubernetes上运行SAP Cloud SDK管道 [英] How to run the SAP Cloud SDK Pipeline on Kubernetes

查看:139
本文介绍了如何在Kubernetes上运行SAP Cloud SDK管道的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当前,我正在尝试使用此处提供的教程在Kubernetes集群上设置SAP Cloud SDK:

Currently, I am trying to set up the SAP Cloud SDK on a Kubernetes cluster using the tutorial found here:

该安装程序工作正常,我能够配置并启动管道.它还生成并成功连接到作为代理运行的新POD.但是,在mvn全新安装步骤中,将在POD上执行容器执行操作,但这由于某些未知原因而失败.

The setup works fine and I am able to configure and start a pipeline. It also spawns and connects successfully to a new POD running as an agent. However, during the mvn clean install step, a container execution is done on the POD, but this for some unkown reason fails.

我遵循了教程中的故障排除提示,特别是通过测试Jenkinsfile检查了与Kubernetes集群的连接性,但是运行成功,并且似乎不是问题所在.我还尝试检查POD上的container-exec容器的日志,但是什么也没返回(对于jnlp容器,我得到的日志显示连接成功).

I followed the troubleshooting hints in the tutorial, especially checking the connectivity with the Kubernetes cluster via the test Jenkinsfile, but that runs through successfully and does not seem to be the problem. I also tried to check the logs of the container-exec container on the POD, but nothing is returned (for the jnlp container I get the log showing the successful connection).

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

In the build pipeline the following log statements are given:

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

我知道该功能在博客条目中被标记为试验性的,但是几个月前我能够成功设置这种情况,因此某些情况似乎已经改变.这仍然是运行管道的有效方案吗?任何有关如何进行和进行这项工作的提示,将不胜感激!

I know the feature is marked as experimental in the blog entry, but I was able to successfully set up such a scenario some months back, so someting seems to have changed. Is this still a valid scenario to operate the pipeline? Any hints on how to proceed and make this work would be really appreciated!

推荐答案

注释中提供的更改解决了问题.简单更改pipeline_config.yaml以使用其他图像:

The provided change in the comments did the trick. A simple change of the pipeline_config.yaml to use a different image:

https://github.com/SAP/cloud-s4-sdk-book/blob/K8S/pipeline_config.yml#L5

然后一切都顺利了.

这篇关于如何在Kubernetes上运行SAP Cloud SDK管道的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆