Lesson 1 Define resources

Create agent resources for a multi-node deployment.

Before you begin the lesson, complete the Configuring the tutorial system topic.

In this tutorial you create two systems that are logically separate, but, for ease of use, run on the same hardware. The two environments behave in the same way and have the same dependencies.

To simulate separate physical environments, you can run the Blue and Green environments on the same server. If you have multiple servers available, of course you can use those. The Green resources run on one port, and the Blue resources run on another. This way, you can simply change the port to direct traffic to a different environment.

IBM® UrbanCode® Deploy provides several loop-type steps that you can use to deploy multiple components. The For Each Agent loop, for instance, lets you control which agents run automated tasks. This way, even if you have a large number of agents, you can run tasks on specific agent groups by tagging agents and running tasks only on agents with those tags. The For Each Tag loop, which is similar, runs once for each of the resource tags that you specify. So you can organize the resources in your environment by tag, and then control which tags to use. For example, you can deploy to canary nodes first and all remaining nodes second, all in the same process.

Follow these steps to create the resource groups that represent the blue-green systems:

  1. Create a top-level resource for the blue system.
    1. On the Resources page, click the Resource Tree tab, and then click Create Top-Level Group, and name the group Blue System.
    2. Add an agent resource to Blue System and name it blue-A
    3. Add the JPetStore component tag to blue-A agent resource.
      The single component tag references all three components in the JPetStore application.
      Note: If you use you own application, make sure to tag the components and then use that tag.
    4. Create agent the blue-B agent resource and add to it the JPetStore component tag.
    5. Add the Load balancer component to the blue-A and blue-B resources.
  2. Click Add tag for the blue-A agent resource, and select the Canary tag, creating a new tag if necessary.
    The canary node always gets updated first. You update the other node when you're satisfied that the canary node is working properly.
  3. Click Add tag for the blue-B agent resource, and select the Main tag, creating a new tag if necessary.
    All agent resources that are not Canary nodes use the Main tag.
  4. Create a top-level resource for the green system by duplicating the actions in the previous steps.
  5. Create a top-level resource for the load balancer, and add the Load balancer component to it.
The complete resource trees look like the following figure:
The blue-green resource tree

In this lesson, you created agent resources required by the blue-green topology.