-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

Jenkins Administrator's Guide
By :

Jenkins is now running – it's time to customize it to make it our own.
We will now learn how to install plugins. We can use the same technique to install additional plugins in other chapters. The following info box shows which plugins to install:
Required plugins
Active Directory
Click Manage Jenkins on the left | Manage Plugins | Available and then search for the plugin name. You can search for and check multiple plugins at once. There are many plugins with similar names – searching for docker
shows over 10 different similarly named plugins. Be sure to pick the exact name from the info box:
Figure 2.16 – Plugin Manager search result for Active Directory
Most plugins can be installed without a restart, but an upgrade always requires a restart. Click Install without restart to install the Active Directory plugin. If you are planning on using OAuth, search for the OAuth provider plugin and install that instead. If you are planning on not using any authentication provider, you can skip the install.
With the basic plugins installed, let's continue to configure the system.
Click Manage Jenkins on the left and then click Configure System. This is the main configuration page for Jenkins, which unfortunately doesn't have a name. We will refer to this page as System Configuration throughout the book:
Figure 2.17 – System Configuration page
There are several configuration items here. In fact, this is where almost all the configurations are. When we install a new plugin, its global configurations will most likely be here. Some plugins require additional configurations on the pipelines, and those will be made on each pipeline's configuration page.
Read through and configure as needed, and be sure to configure these four items:
0
.https://<Jenkins URL>/
(for example, https://jenkins-firewalled.lvin.ca/).# of executors configures the number of executors on the controller to run the build steps. This is useful when there are no other agents. Since we are attaching two dedicated agents and a Docker Cloud, set it to 0
so that the controller does not run build steps.
Jenkins URL is updated from the IP address with temporary HTTP on port 8080
to the Jenkins URL with HTTPS.
Reducing Pipeline Default Speed/Durability Level significantly speeds up Jenkins at the cost of a possible data loss in case of an unexpected shutdown. The Jenkins documentation suggests Performance-optimized as the global default2. This can be overridden to a higher durability setting per pipeline for the pipelines that need a guaranteed record of executions. You can find more information about this in Chapter 9, Reducing Bottlenecks.
Everything in Jenkins is a flat file on the controller. It's important that Global Build Discarders is configured to prune the build history so that the number of files on the controller doesn't grow indefinitely. This can be overridden to a higher number per pipeline, and important builds can further be pinned so that they don't get pruned:
Figure 2.18 – Global Build Discarders configured to keep a maximum of 100 builds by default
The basic Jenkins configuration is done. We can always come back to make additional changes. Let's now move on to the security configurations.
Go to the Global Security page to configure the security-related items by clicking Manage Jenkins on the left and then click Configure Global Security:
admin
user and give Administrator permission, as shown in the following screenshot:
Lockout alert!
You will be locked out if you don't add the admin
user and give Administrator permission.
Figure 2.19 – Project-based Matrix Authorization Strategy configuration
We are deliberately not giving the users permission to see the projects or run a build, as those will be configured for each project.
Click Save to save and exit.
With basic authentication and authorization configured, let's continue to manage secrets.
Secrets are an important part of automation. Click Manage Jenkins on the left | Manage Credentials | (global). This is the Global Credentials page where we store secrets. Keep this page open on a tab because we will come back to Global Credentials very soon to create the secrets for authenticating with agents.
Let's continue to wrap up the controller configuration.
In addition to the required plugins, here are some optional plugins that are useful:
The complete list of available plugins can be found on the Plugins Index page at https://plugins.jenkins.io/.
Our controller configuration is now complete. Let's move on to agent configuration.