How to update a Managed Master with a Cluster Operation

Issue

  • I would like to update a Managed Master with a Cluster Operation

Environment

Resolution

Common Steps

The first part is common to the two updates.
From the Operation Center, create a new Job of type Cluster Operations.
In the Operations section, choose Managed master then select the Managed Master you wish to apply the operation on.

CAUTION As with any update, you need to make a backup before triggering an update.
You can do so by clicking on Add Step and then Backup Master in the Steps section.

Specific Steps

There are two kinds of updates available:

  • Jenkins updates: when the core of Jenkins is updated. For instance when you update from version 2.164.3.2 to 2.176.1.4.
  • Revisions: these are update of the envelope of plugins coming with Beekeeper. For instance, when you update from 2.164.3.2 revision 2 to 2.164.3.2 revision 3.

Given the above, there are two kind of operations depending on whether you wish to make a Jenkins update or make a revision update.

Jenkins Update

In this case, the operation will consist of updating the Managed Master image and then restart the Managed Master.
In the Steps section, choose Add Step then Update Docker Image.
In order for the docker image to be really updated, you will also need to add a second step: in the Steps section, choose Add Step then Safe Restart.

Revision Update

In the case of a revision update, there is no docker image change.
We can trigger the update nonetheless with some groovy code:
In the Steps section, choose Add Step then Execute Groovy Script on Master.
Then add the following script:

com.cloudbees.jenkins.plugins.assurance.CloudBeesAssurance.get().getUpgradeAction().getUpgrade().with {
    if (isIncrementalUpgrade()) {
        pick(false, null)
    }
}

In order for the update to complete, you will also need to add a second step: in the Steps section, choose Add Step then Safe Restart.

Tested product/plugin versions

CloudBees Core on modern cloud platforms - Managed Master version 2.150.3.2 revision 2 and 4.

Have more questions?

0 Comments

Please sign in to leave a comment.