Jenkins global configuration after container starts

37 views
Skip to first unread message

robert tingirica

unread,
Sep 13, 2017, 5:06:29 AM9/13/17
to jenkins...@googlegroups.com
Hello,

We are using Jenkins in our environment with the kubernetes plugin. We are currently configuring credentials and creating jobs using the API, but I see no way to do this initially with global configuration.

Examples of configs we need to change:
- Use master node only when specified by name
- Add new cloud
- Maven Project Configuration
- Add sonarqube server

I have tried creating a new image and copying the config.xml file, if it does not exist in $JENKINS_HOME but then we can’t take advantage of the initial run that jenkins.war does which creates the admin user and so on.

Is there a way to configure the desired sections using REST calls?
What would be the best way to achieve this?

Using jenkins-cli isn’t really in our scope.


Thank you

Carlos Sanchez

unread,
Sep 13, 2017, 5:28:21 AM9/13/17
to Jenkins Users
check the jenkins helm chart, it is doing that already


--
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 jenkinsci-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/B65A7820-D337-4358-98A9-9A062DE7226C%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

robert tingirica

unread,
Sep 13, 2017, 6:27:05 AM9/13/17
to Jenkins Users
Thank you for your answer Carlos,

I will definitely consider using helm more in the future. 

If you are referring to https://github.com/kubernetes/charts/tree/master/stable/jenkins , the last step is exactly a manul step that I want to avoid:

"Under configure Jenkins -- Update the credentials config in the cloud section to use the service account credential you created in the step above."

It doesn't present any way of configuring other tools without changing the whole template and adding new values, which requires further maintenance. 
It would also mean introducing a new tool (helm) in our organisation, which I am willing to do, but it will take months to security approve it.
Further configuration on the master cannot be done without another deployment (same case if I script it at start-up, in the container, but that doesn't require internal corporate process loop jumping) and this is the main reason I would like to use a REST API, if it exists.

Kind regards


On Wednesday, 13 September 2017 11:28:21 UTC+2, Carlos Sanchez wrote:
check the jenkins helm chart, it is doing that already
On Wed, Sep 13, 2017 at 11:01 AM, robert tingirica <tingiric...@gmail.com> wrote:
Hello,

We are using Jenkins in our environment with the kubernetes plugin. We are currently configuring credentials and creating jobs using the API, but I see no way to do this initially with global configuration.

Examples of configs we need to change:
- Use master node only when specified by name
- Add new cloud
- Maven Project Configuration
- Add sonarqube server

I have tried creating a new image and copying the config.xml file, if it does not exist in $JENKINS_HOME but then we can’t take advantage of the initial run that jenkins.war does which creates the admin user and so on.

Is there a way to configure the desired sections using REST calls?
What would be the best way to achieve this?

Using jenkins-cli isn’t really in our scope.


Thank you

--
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 jenkinsci-use...@googlegroups.com.

Carlos Sanchez

unread,
Sep 22, 2017, 8:15:30 AM9/22/17
to Jenkins Users
You don't need to use helm, I meant that you can look at how helm does it

On Wed, Sep 13, 2017 at 12:27 PM, robert tingirica <tingiric...@gmail.com> wrote:
Thank you for your answer Carlos,

I will definitely consider using helm more in the future. 

If you are referring to https://github.com/kubernetes/charts/tree/master/stable/jenkins , the last step is exactly a manul step that I want to avoid:

"Under configure Jenkins -- Update the credentials config in the cloud section to use the service account credential you created in the step above."

It doesn't present any way of configuring other tools without changing the whole template and adding new values, which requires further maintenance. 
It would also mean introducing a new tool (helm) in our organisation, which I am willing to do, but it will take months to security approve it.
Further configuration on the master cannot be done without another deployment (same case if I script it at start-up, in the container, but that doesn't require internal corporate process loop jumping) and this is the main reason I would like to use a REST API, if it exists.

I didn't say to use helm, just to check how helm does it.

About REST there is nothing special in the plugin, there is whatever is already available in jenkins global configuration
 

Kind regards


On Wednesday, 13 September 2017 11:28:21 UTC+2, Carlos Sanchez wrote:
check the jenkins helm chart, it is doing that already

On Wed, Sep 13, 2017 at 11:01 AM, robert tingirica <tingiric...@gmail.com> wrote:
Hello,

We are using Jenkins in our environment with the kubernetes plugin. We are currently configuring credentials and creating jobs using the API, but I see no way to do this initially with global configuration.

Examples of configs we need to change:
- Use master node only when specified by name
- Add new cloud
- Maven Project Configuration
- Add sonarqube server

I have tried creating a new image and copying the config.xml file, if it does not exist in $JENKINS_HOME but then we can’t take advantage of the initial run that jenkins.war does which creates the admin user and so on.

Is there a way to configure the desired sections using REST calls?
What would be the best way to achieve this?

Using jenkins-cli isn’t really in our scope.


Thank you

--
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 jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/B65A7820-D337-4358-98A9-9A062DE7226C%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
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 jenkinsci-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/e883c79b-2b1e-40c5-990e-4345367a89f6%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages