How to create a 2-tier architecture with DNS balancer

Multi-Cloud Orchestrator allows users to create multi-tier infrastructures on the Cloud. Specifically, 2-tier architecture is a client–server architecture in which presentation is physically separated from application processing and data management. It provides a more robust, more secure solution than a monolithic infrastructure, without increasing operative costs in a high percentage respecting other multi-tier architectures. DNS-balance enables a multi-tier architecture to have more than one of each tier replicated ensuring high availability, high reliability and increased disponibility capabilities from the operative point of view.

Leveraging Chef cookbooks, we can create a DNS-balanced 2-tier architecture using Multi-Cloud Orchestrator and a cookbook.

Infrastructure model

Prerequisites

  • Have a cookbook with recipes for both front-end and back-end parts of your architecture, or two cookbooks, each one with one of the sides of your infrastructure.
  • Have a DNS domain created.

Notes:

  • Front-end servers need to be neither in the same region nor in the same cloud provider, so you can have the same front-end service running on different regions and cloud providers to ensure high availability.
  • Back-end server can be on a different region and cloud provider than the front-end servers.
  • You can create a server array for the front-end part of your 2-tier architecture instead of having to create multiple servers one by one. The steps to create a server array are explained in How to create a server array
  • On this example we will use a cookbook with recipes for both front-end and back-end sides.

Upload your service cookbook

  1. Go to Blueprint -> Cookbooks. Step 1
  2. Press the "Add cookbook" button. Step 2
  3. Press the "Upload cookbook" button. A modal window will appear to select the cookbook file you want to upload. After you press on "Accept" button, the cookbook will appear in the cookbook list. Step 3

Configure templates for your architecture

  1. Go to Blueprint -> Templates. Step 4
  2. Press the "Add template" button. Step 5
  3. Provide all mandatory fields, select Generic Image * as Ubuntu 20.04 Focal Fossa x86_64. Then press the "Add template" button.
  4. Wait until the template is in "Ready" state. Step 6
  5. Click on your template name and go to the "Cookbooks" tab. Step 7
  6. On Cookbook list, press the "Edit" button.
  7. On Cookbook list, press the "Add cookbook" button and select the cookbook you uploaded. On Run list, press the "Add recipe" and select the recipe for the front-end part of the infrastructure. Step 1
  8. Press the "Update template" button, and wait for the template to be on "Ready" state. Step 1
  9. For the back-end template, follow these steps to create a template, but on Run List, select the recipe for the back-end part of your infrastructure. Step 1

Create servers for your architecture

  1. Go to Compute -> Servers. Step 1
  2. Press the "Add server" button and press "Add server"
  3. Provide all mandatory fields, select Template * as the template for the front-end side of your infrastructure, and press the "Add server" button. Step 5
  4. Press the action menu and select Boot
  5. Wait until record is in "Operational" state. Step 1
  6. Repeat these steps to create more servers for your front-end part of the infrastructure, changing the names of the servers.
  7. Repeat these steps to create a back-end server for your infrastructure, selecting the template for the back-end side on the Add Server popup. Step 1

Configure DNS load balancer for front-end

  1. Go to Network -> DNS. Step 1
  2. Click on your DNS domain. Step 2
  3. Go to the "Records" tab. Step 3
  4. Press the "Add domain record" button and press "A".
  5. Provide all mandatory fields, select Content Type * as Server, and then select a front-end server you want to include in your DNS load balancer on Server * field. Then press the "Add record" button. Step 4
  6. Wait until record is in "Applied" state. Step 5
  7. Repeat these steps for all the servers you want to include on your DNS load balancer, assigning the same name to all records and selecting a different server from your pool of front-end servers each time. Step 6

Configure DNS for back-end

  1. Press "Add domain record" button and press "A". Step 7
  2. Enter a name, one different to the name assigned to your front-end servers, in the Name * field, select Content Type * as Server, and then select the back-end server on Server * field. Then press the "Add record" button.
  3. Wait until record is in "Applied" state. Step 8
  4. Configure your front-end servers to communicate with your back-end server using the record name and domain name you created; typically, by adapting a cookbook attribute. The steps to adapt a cookbook attribute are explained in How to configure a cookbook

Additional Resources