SAP Jenkins on Kubernetes

3/3/2020

got some questions running project piper on Kubernetes. We did the setup like described in

https://sap.github.io/jenkins-library/guidedtour/

I assumed that a build will run "out-of-the-box"... but it isn't. Invoking a mtaBuild results in a message ... Cannot connect to docker daemon ... permission denied

Not sure if we have to set env variable ON_K8S. If we set it ... the build is waiting forever for a node to come up.

Is there any setup guide for Kubernetes? Do we have to configure a pod Template in the Jenkins configuration and work with container("container_name") in the Jenkinsfile ?

Is the Jenkins agent https://hub.docker.com/r/ppiper/jenkins-agent-k8s already preconfigured? Do we have to set it over env variable?

-- T1mey
docker
jenkins
kubernetes
sap
sap-cloud-sdk

1 Answer

3/3/2020

Updated answer:

The cx-server scripts are not made for running in Kubernetes, they are built for a "plain docker" setup (a linux server/vm with docker installed).

For scaling on Kubernetes, two options are available:

Using the jenkins master image in a pod as described in this blog post, or using it in a "plain docker" setup and optionally having additional agents on kubernetes.

Additional documentation on this topic is here

-- Florian Wilhelm
Source: StackOverflow