Create environments

5 minute readReferenceAutomation

Environments are logical grouping of machines to which various applications can be mapped and deployed. Using environments and templates, you can model the infrastructure and the middleware available for various applications. Environments consist of logical groups of resources (such as web servers, database servers, and application servers) with a similar function or role called environment tiers.

Environments can be static, dynamic, or hybrid. A static environment has resources that are already provisioned and managed at the platform level. Each resource has its own logical name to identify it from the other resources in the system. It also can be assigned to one or more resource pools or to a zone (a collection of agents). Several resources can correspond to the same physical host or agent machine. Resources can also be configured as standard or proxy.

  • Standard resources are machines running the CloudBees CD/RO agent on a supported agent platform while

  • Proxy resources (agents and targets) are on remote platforms or hosts that exist in your environment and requires SSH keys for authentication. The CloudBees CD/RO agent does not need to run on the remote platform or host.

Enviroment tier - An environment tier is a functional group of resources (such as web servers, database servers, and application servers) in a deployment layer. CloudBees CD/RO runs the procedure on each resource within that tier to ensure every target receives the intended deployment or configuration. It also Guarantees scalability, consistency, and reliability across environments.

In environment tier the procedure is executed one time per resource for the following reasons:

  • Parallel and Consistent Deployments - Each resource (for example, each app server) receives the same deployment in parallel.

  • Isolation of Execution - Process is executed since each resource has its own agent or target endpoint.

  • Scalability When new resources are added, the same tier procedure automatically scales with no manual modification needed.

  • Fault Tolerance - If one resource fails, others can still complete successfully.

Utility resource - A dedicated resource tier created specifically for process steps that must not broadcast to all nodes.This approach keeps deployments clean and predictable. The standard tiers handle distributed tasks across resources, while the Utility Resource runs like a global action only one time per environment, avoiding duplication and maintaining full control of the release process.

In utility resource the process is executed only one time globally per environment for the following reasons:

  • Prevent duplication of centralized tasks.

  • Maintain full control of the release process.

  • Keep deployments clean and predictable.

Environment cluster - A cluster configuration is used with microservices where multiple CloudBees CD/RO servers are linked together to provide high availability, fault tolerance, and horizontal scalability. Multiple CloudBees CD/RO servers and web servers work together as a single system.

Refer to Create and manage resources for more information about how to create, configure, and manage resources.

This example shows to how model a static environment to which the application will be deployed. For information about dynamic environments and how to model them, see Deploying Applications in Dynamic Environments.

Creating an environment

To create an environment:

  1. Select Deployment Automation  Environments.

  2. Select New + to add an environment. The New Environment dialog appears.

  3. Select Create New or From traditional application…​ based on your requirements. If you selected From traditional application choose an application from the list.

  4. Enter a name into the Name field.

  5. Select a project for the new environment and enter a description of the environment.

    You can include hyperlinks as part of an object description for any CloudBees CD/RO object.
  6. Select OK.

    The Environment Editor opens.

    create environment
    Figure 1. Environment editor

From here, you can create a tier with resources or a cluster with nodes.

Creating an environment tier

An environment tier is a logical grouping of resources in a deployment layer. These are used with traditional applications.

  1. Define Tier 1:

    1. Select Details from the vertical dots menu.

    2. On the Details tab, enter the name and optional description.

    3. On the Capabilities tab, optionally define a capability.

    4. Select OK.

  2. Assign resources it:

    1. Select + in Resources block.

    2. In the New dialog box, click Add resources or Add resource pool. The Resources list or Resource Pools list, respectively, displays.

    3. Select one or more enabled resources or resource pools for this environment and then click OK.

The Environment editor now has an environment tier called mysql with one resource. Example:

Environment tier with one resource
Figure 2. mysql environment tier

Creating an environment cluster

Environment clusters are used with microservice applications.

Before creating an environment cluster, you must create a cluster configuration, which is a CloudBees CD/RO object to hold common values, predefined parameter sets, and credentials for your cluster. Creating a cluster configuration leverages the CloudBees CD/RO EC-Helm plugin. You must create one configuration for each cluster in your deployment. For more information, refer to Create Helm plugin configurations.
  1. Select + at the bottom of Cluster 1. The Cluster Definition dialog appears.

  2. Select a platform. For a microservice application, select Kubernetes (via Helm).

  3. Enter the cluster attributes as needed. The following table describes the available attributes:

    Label Definition

    Configuration Name

    The name of the previously defined configuration for the cluster.

    Namespace

    The name of the Kubernetes namespace. If not supplied, the default namespace is used.

    Kubeconfig context

    The name of the context to be used for this cluster deployment. If not specified, the one defined by the current-context inside kubeconfig file is used.

  4. Select OK when finished.

  5. Link a utility resource to the cluster. This defines the static environment to which the cluster is deployed. For more information, refer to Creating a Utility Resource.

Creating a Utility Resource

In CloudBees CD/RO, each environment tier can contain multiple resources, and by design, any process step assigned to a tier runs on every resource within that tier. This ensures consistent deployments across all nodes.

However, some tasks, such as sending a notification, updating a load balancer or DNS record, modifying a shared configuration file, or running a one-time database migration should run only one time per environment rather than more than one time per resource.

To support these scenarios, you can use a utility resource, a dedicated resource tier created specifically for steps that must not run on all nodes. The steps assigned to this tier execute only once, centrally, regardless of how many resources exist in other tiers.

This approach keeps deployments clean and predictable and standard tiers handle distributed, multi-resource tasks, while the Utility Resource runs one-off or global actions just once per environment, preventing duplication and giving you finer control over the release process.

  1. In the Environment Editor page, select the New Utility Resource (with wrench and hammer) in the upper right. A Utility Resource tile appears in the editor page.

  2. Select the (+) icon in the Utility Resource tile and select a resource or a resource pool from the list.

  3. Select OK

The Environment Editor page now displays a utility resource called Utility Resource 1 with one resource added to it.

Utility resource
Figure 3. Utility Resource