Jenkins global configuration after container starts

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Jenkins global configuration after container starts

robert tingirica
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 [hidden email].
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.
Reply | Threaded
Open this post in threaded view
|

Re: Jenkins global configuration after container starts

Carlos Sanchez
check the jenkins helm chart, it is doing that already

On Wed, Sep 13, 2017 at 11:01 AM, robert tingirica <[hidden email]> 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 [hidden email].
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CALHFn6O8VdMHwS5gy2W_eaSzwFNt%2BM5i89Xa50LNiGm5%2BrWrhg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Jenkins global configuration after container starts

robert tingirica
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 <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="Y4UlVfFAAgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">tingiric...@...> 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 <a href="javascript:" target="_blank" gdf-obfuscated-mailto="Y4UlVfFAAgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/jenkinsci-users/B65A7820-D337-4358-98A9-9A062DE7226C%40gmail.com" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-users/B65A7820-D337-4358-98A9-9A062DE7226C%40gmail.com&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-users/B65A7820-D337-4358-98A9-9A062DE7226C%40gmail.com&#39;;return true;">https://groups.google.com/d/msgid/jenkinsci-users/B65A7820-D337-4358-98A9-9A062DE7226C%40gmail.com.
For more options, visit <a href="https://groups.google.com/d/optout" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/e883c79b-2b1e-40c5-990e-4345367a89f6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Jenkins global configuration after container starts

Carlos Sanchez
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 <[hidden email]> 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 <[hidden email]> 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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/e883c79b-2b1e-40c5-990e-4345367a89f6%40googlegroups.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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CALHFn6P4G5CWm1QoAQ7bhim36dDsp5FoOew5nLbmbHqhXZHgww%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.