Configuration as Code (CasC) fundamentals

2 minute readScalabilityAutomation

Built over the Jenkins Configuration as Code plugin, CloudBees Configuration as Code is a method of simplifying the configuration of the operations center or controllers by capturing the configuration of the CloudBees CI instance in human-readable declarative YAML files that can be used in a reproducible way.

The set of YAML files that describe a CloudBees CI instance configuration is a Bundle, and in addition to the features provided by the Jenkins Configuration as Code plugin, CloudBees CasC offers the following features:

  • Bundles can contain additional configuration information for:

    • Items like folders, pipelines, freestyle jobs, etc.

    • Plugins to be installed under the CloudBees Assurance Program (CAP) or using plugin catalogs.

    • Role-Based Access Control (RBAC) configurations with users, groups, and roles.

    • Bundle Inheritance is possible when your operations center provides CasC configuration bundles to your controllers.

CasC advantages

The use of CloudBees CasC provides the following advantages to your organization:

  • Portability: Storing all your CasC configuration bundles makes moving your CloudBees CI cluster to a new infrastructure easier.

  • Auditability and Traceability: Using an SCM as a single source of truth for your CasC configuration bundles adds traceability to any change.

  • Manageability: Using your operations center, you can manage the configuration bundles applied to the different controllers in your cluster. CloudBees CasC even allows you to validate a bundle before applying it (pre-validation).

  • Scalability: When you create new controllers in your cluster to match an increasing workload, CloudBees CasC makes this horizontal scaling easier, allowing you to create a new controller with the required configuration stored in a configuration bundle.

CasC bundles

The main element when using CasC to configure your CloudBees CI instance (operations center or controller) is the CasC bundle. A CasC bundle is a collection of YAML files that describes the configuration of a CloudBees CI instance and can be used to configure a CloudBees CI instance.

Refer to Create CasC bundles for more information on the different elements that can be part of a CasC bundle and how to create one.

CasC use cases

CloudBees CasC can be used in many different scenarios and ways. Some common use cases are described below:

  • You can easily add a new controller to your CloudBees CI cluster using the same configuration as other controllers in your cluster. A 1-to-many configuration.

  • You can easily reuse your current CloudBees CI cluster configuration when moving your cluster to a new infrastructure with higher capacities.

  • When many controllers are configured using the same CasC bundle, you can easily update them all at once, propagating those changes from the operations center serving the bundle to all the controllers using it.

  • You can speed up onboarding for new teams in your organization by having controller bundles with all they need ready to be used.

  • Using the bundle inheritance feature, you can create new CasC bundles based on others.

  • You can store CasC bundles to recover your CloudBees CI instance in case of disaster.

  • In a CloudBees CI on modern cloud platforms, you can even configure your whole cluster in a single step by using CasC bundles for the operations center containing information about the CasC bundles needed for all the managed controllers. It’s a One-Shot configuration.