Setting up a managed controller using CasC

3 minute readScalabilityAutomation

Controllers send requests for their configuration bundles through a secure HTTP(S) endpoint in operations center. Each controller is aware of the bundle it is connected to through the casc-bundle-link.yaml file that contains the bundle URL and access token.

When using CloudBees CI on modern cloud platforms, you do not need to create the casc-bundle-link.yaml and add the startup options for the managed controller; these steps are taken care of automatically. However, you must assign a bundle to a managed controller before it has been provisioned. If you assign a bundle to a managed controller after it has been provisioned, you must stop and then restart the controller for the configuration to take effect. For more information, see Assigning a bundle to a controller.

Figure 1. Setting up a managed controller

Prerequisites

The following plugins must be installed to your controller:

Setting up a team controller using CasC

Configuration bundles can be assigned to team controllers. The association mechanism used for team controllers is the same mechanism used for managed controllers. However, you must assign a bundle to the team controller after it has been provisioned. For more information, see Assigning a bundle to a controller.

Plugins and plugin catalogs coming from creation recipes, which are unique to team controllers, are ignored when using a Configuration as Code (CasC) for Controllers bundle for a team controller. The Configuration as Code (CasC) for Controllers bundle takes precedence over the creation recipe values even though other parameters in recipes, such as provisioning configuration, are still applied.

Adding system properties when initializing a managed controller

When initializing a managed controller using CloudBees CI on modern cloud platforms, system properties can be added in the Provisioning options when the controller is being created. You can add the same recurrencePeriod property to the Java Options section in the UI. For example, to check for updates every 5 minutes add the Java Option highlighted in red in the screenshot below:

Figure 2. Adding recurrencePeriod property to Java options

Assigning a bundle to a controller

To assign a bundle to a controller:

  1. Ensure you are signed in to the operations center as a user with the Configure or Administer permission.

  2. From the operations center dashboard, select the down arrow to the right of your controller’s name, and then select Configure.

    Figure 3. Controller dropdown menu
  3. Scroll down to Configuration as Code (CasC).

  4. Select the appropriate bundle to assign to the controller.

    If a Default bundle has already been selected from the Configuration as Code bundles screen, it is pre-selected in the Bundle dropdown.
  5. Select Save.

  6. If the controller has already been provisioned, you must stop and then restart the controller for the configuration change to take effect.

Regenerating a bundle token

You can regenerate a bundle’s access token using the casc-bundle-regenerate-token CLI command. Re-generating the access token is not usually required and should only be done in certain situations, such as for security purposes. Any controller currently using the token will lose access to it after it is regenerated. For more information, refer to CasC bundle management on the operations center CLI.

For managed controllers, if the token needs to be regenerated, the controller using the token needs to be restarted from operations center and the casc-bundle-link.yaml file needs to be updated with the new token.

Adding the CasC bundle column to the operations center dashboard

Once you have set up your controller and assigned a bundle to it, you can add the CasC bundle column to the operations center dashboard to display the CasC bundle assigned to each controller.

  1. From the operations center dashboard, select Edit View in the left pane.

  2. Scroll down to Columns.

  3. Select Add column.

  4. Select CasC bundle.

  5. Select OK.

    The CasC bundle column is now displayed in the operations center dashboard.

    Figure 4. CasC bundle column