0

I'm using the Kubernetes plugin for Jenkins (https://github.com/jenkinsci/kubernetes-plugin).

Using their documentation, I was able to create a Jenkins Pipeline to create a pod and run some maven commands inside the maven container within the pod with the use of a Jenkins pipeline script. There is another kubectl container running some kubectl commands. I haven't done anything fancy with it yet other than trying it out.

I would like to create two Jenkins Projects (or Jobs). One for the maven step and the other for the kubectl step.Then combine the two jobs into a single pipeline. At the end, there would be two individual jobs, and one pipeline running those two jobs. The pipeline being equivalent to what I described in the previous paragraph. I did not see a way to do this for doing Kubernetes things; specifically, I did not see a way to create a script that creates a pod with maven container and do something within that container with a Jenkins project, unlike a Jenkins Pipeline.

  1. Is it possible to do what I'm saying by using the Kubernetes Plugin or not?
  2. Is there a better way to do this?
  3. If not possible, is there another way to do something similar?
chief
  • 11
  • 4

0 Answers0