Simulating Hybrid Cloud Deployment

This tutorial demonstrates how to tag Instance Managers (IM) and simulate a hybrid cloud deployment using the Apcera Platform.

Prerequisites

This tutorial assumes that you are familiar with installing and configuring the Apcera Platform.

Single IM tag rule

1) Go to your working directory.

2) Create a backup copy of your original cluster.conf file named cluster.conf-orig or similar.

NOTE: Apcera recommends that you version control your original cluster.conf file before making changes.

3) Open the cluster.conf file with a text editor.

4) Add tag_rules to the Instance Manager (IMs) component.

Add the following tag_rules block to the existing chef.continuum.instance_manager entry:

      "tag_rules": [
          { "network_cidr": "10.0.50.0/24",  "override_tags": ["aws", "us-west-2", "training"] },
      ],
    }

The following block shows where to place the tag_rules in the cluster.conf file:

chef: {
  "continuum": {
    "cluster_platform": "unknown",
    ...
    "instance_manager": {
      "keep_logs": true,
      "container_dns_ip": [ "8.8.8.8" ],
      "log": {
        "level": "all"
      }
      "tag_rules": [
          { "network_cidr": "10.0.50.0/24",  "override_tags": ["aws", "us-west-2", "training"] },
      ],
    }
    ...
  }
}

For the the network_cidr value, you can use the actual IP address of an IM or a subnet. In the example, the IP addresses of the machines.instance_manager.hosts are "10.0.50.132" and "10.0.50.125. We use the chef.continuum.cluster.subnet value ("10.0.0.0/16"), but whitelist it to the third octet. The tag_rules apply to both IMs in this case.

5) Save the changes you made to your cluster.conf file.

6) Redeploy your Apcera Platform using the updated configuration file.

7) Log in to your platform using the web console.

Verify that your IMs are now tagged according to the tag_rules you defined.

screenshot

8) Check the IM tags using APC.

apc cluster im list

screenshot

Multiple IM tag rules

In the previous example, we created a single tag rule on the subnet and used override tags. On redeploy of the platform, both IMs were taged with the override values. The values overridden are the default tags applied during provisioning.

In the following example we use two tag rules, the actual IP addresses for each IM, and both the override_tags and extra_tags tag types.

1) Update your cluster.conf file with the following tag_rules.

chef: {
  "continuum": {
    "cluster_platform": "unknown",
    ...
    "instance_manager": {
      "keep_logs": true,
      "container_dns_ip": [ "8.8.8.8" ],
      "log": {
        "level": "all"
      }
      "tag_rules": [
          { "network_cidr": "192.168.1.7",  "override_tags": ["black", "one", "az"] },
          { "network_cidr": "192.168.1.8",  "extra_tags": ["white", "two", "by"] },
      ],
    }

In this example we are using the actual IP address for each IM, which we obtain from machines.instance_manager.hosts:

machines: {
  ...
  instance_manager: {
    hosts: [ "192.168.1.7", "192.168.1.8" ],
  }
}

Note that for the first rule we use override_tags, but for the second rule we use extra_tags. Let's see the result.

2) Save the changes you made to your cluster.conf file.

3) Run the command orchestrator-cli deploy to redeploy your Apcera Platform using the updated deployment configuration file.

4) Log in to your platform using the web console.

Verify that your IMs are now tagged according to the tag_rules you defined.

screenshot

As you can see, each IM is tagged according to the rules. In this case, the override_tags replace any existing tags, whereas the extra_tags are in addition to the existing tags unknown and host-dfb2e13f.

5) Check the tags using APC.

apc cluster im list

screenshot

Apply job scheduling tags

Now that your IMs are tagged, you can apply tags to jobs and control where job instances run. In so doing you will be able to simulate a hybrid cloud deployment using the Apcera Platform.

You can apply scheduling tags to jobs using policy or APC and the web console.