On 9/18/18 9:12 AM, Tristan FAURE wrote: > Hello all my previous message with edit : > Thank you to both of you for your answers. I was thinking about creating > services but my db is created then deleted during the build I was not > sure it was a good practice (and if it is possible) to create > dynamically (and delete then) a service directly from the jenkinsfile yaml. > > I will try > *EDIT : I did not find how to declare the service in the yaml in my > jenkinsfile (syntax error). All the containers in one pod works but I > have resource limitations and I would prefer having them separated*
I don't think you've said so, but I assume you're using the Jenkins plugin called simply "kubernetes", which is documented at: https://github.com/jenkinsci/kubernetes-plugin/blob/master/README.md AFAICT, that plugin has no built-in way to create Kubernetes service objects. This is why I recommended using kubectl, which allows to create, delete and query any Kubernetes object. You will need to make sure the Docker container image contains a kubectl binary of a version appropriate for your Kubernetes cluster. You will also need to make sure that kubectl can authenticate itself. I haven't tried it, but the "Kubernetes CLI Plugin" may be a good option: https://wiki.jenkins.io/display/JENKINS/Kubernetes+CLI+Plugin -- Jonathan Rogers -- You received this message because you are subscribed to the Google Groups "Jenkins Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/e19f7df4-8fee-ee18-4d50-591ecb4ee180%40gmail.com. For more options, visit https://groups.google.com/d/optout.
