All pages
Powered by GitBook
1 of 5

Loading...

Loading...

Loading...

Loading...

Loading...

Step 4: Create an EC2 Host

Create an EC2 Host in DuploCloud

Before you create your application and service using native Docker, create an EC2 Host for storage in DuploCloud.

Estimated time to complete Step 4: 5 minutes.

Prerequisites

Before creating a Host (essentially a Virtual Machine), verify that you completed the tasks in the previous tutorial steps. Using the DuploCloud Portal, confirm that:

  • An exist, both named NONPROD.

  • A Tenant named .

Creating a Host

  1. In the Tenant list box, select dev01.

  2. In the DuploCloud Portal, navigate to Cloud Services -> Hosts. The Hosts page displays.

  3. In the EC2 tab, click Add. The Add Host page displays.

Checking your work

Verify that host01 has a Status of Running.

In the Friendly Name field, enter host01.

  • From the Instance Type list box, select 2 CPU 4 GB - t3a.medium.

  • Select the Advanced Options checkbox to display advanced configuration fields.

  • From the Agent Platform list box, select Linux/Docker Native.

  • From the Image ID list box, select any Docker-Duplo or Ubuntu image.

  • Click Add. The Host is created, initialized, and started. In a few minutes, when the Status displays Running, the Host is available for use.

  • Infrastructure and Plan
    dev01 has been created
    EC2 Add Hosts page
    The EC2 tab displays host01 with a status of Running

    Creating a Native Docker Service

    Finish the Quick Start Tutorial by running a native Docker Service

    This section of the tutorial shows you how to deploy a web application with a DuploCloud Docker Service, by leveraging DuploCloud platform in-built container management capability.

    Instead of creating a DuploCloud Docker Service, you can alternatively finish the tutorial by:

    • Creating an AWS EKS Service in DuploCloud running Docker containers.

    • running Docker containers.

    Deploying a DuploCloud Docker Service

    Instead of creating a DuploCloud Service using EKS or ECS, you can deploy your application with native Docker containers and services.

    To deploy your app with a DuploCloud Docker Service in this tutorial, you:

    1. Create an EC2 host instance in DuploCloud.

    2. Create a native Docker application and Service.

    3. Expose the app to the web with an Application Load Balancer in DuploCloud.

    4. Complete the tutorial by testing your application.

    Estimated time to complete remaining tutorial steps: 30-40 minutes

    Network Architecture and Configurations

    Behind the scenes, the topology that DuploCloud creates resembles this low-level configuration in AWS.

    Creating an AWS ECS Service in DuploCloud
    A diagram of the DuploCloud Docker Service topology

    Step 6: Create a Load Balancer

    Create a Load Balancer to expose the native Docker Service

    Now that your DuploCloud Service is running, you have a mechanism to expose the containers and images in which your application resides. Since your containers are in a private network, you need a Load Balancer to make the application accessible.

    In this step, we add a Load Balancer Listener to complete this network configuration.

    Estimated time to complete Step 6: 15 minutes.

    Prerequisites

    Before creating a Load Balancer, verify that you completed the tasks in the previous tutorial steps. Using the DuploCloud Portal, confirm that:

    • An exist, both named NONPROD.

    • A Tenant named .

    • An EC2 Host named .

    • A Service named .

    Creating a Load Balancer using Native Docker

    1. In the Tenant list box, select dev01.

    2. Navigate to Docker -> Services.

    3. Select the Service demo-service-d01 .

    When the LB Status card displays Ready, your Load Balancer is running and ready for use.

    Securing the Load Balancer

    If you want to secure the load balancer created, you can follow the steps specified

    Creating a Custom DNS Name

    You can modify the DNS name by clicking Edit in the DNS Name card in the Load Balancers tab. For more info about DNS setup and custom DNS names, see the .

    Step 5: Create a Service

    Create a native Docker Service in the DuploCloud Portal

    You can use the DuploCloud Portal to create a native Docker service without leaving the DuploCloud interface.

    Estimated time to complete Step 5: 10 minutes.

    Prerequisites

    Before creating a Service, verify that you completed the tasks in the previous tutorial steps. Using the DuploCloud Portal, confirm that:

    • An exist, both named NONPROD.

    • A Tenant named .

    • An EC2 Host named .

    Creating a Service with Native Docker

    1. In the Tenant list box, select dev01.

    2. Navigate to Docker -> Services.

    3. Click Add. The Add Service Basic Options page displays.

    On the Add Service page, you can also specify optional Environment Variables (EVs) such as databases, Hosts, ports, etc. You can also pass using EVs for testing purposes.

    Checking Your Work

    1. In the Tenant list box, select dev01.

    2. Navigate to Docker -> Services.

    3. In the NAME column, select demo-service-d01.

    4. Check the Current column to verify that

    Once the Service is Running, you can check the logs for additional information. On the Services page, select the Containers tab, click the menu icon ( ) next to the container name, and select Logs.

    Click the Load Balancers tab.
  • Click the Configure Load Balancer link. The Add Load Balancer Listener pane displays.

  • From the Select Type list box, select Application LB.

  • In the Container Port field, enter 3000: the port on which the application running inside the container image (duplocloud/nodejs-hello:latest) is running.

  • In the External Port field, enter 80.

  • From the Visibility list box, select Public.

  • From the Application list box, select Docker Mode.

  • In the Health Check field, enter /, indicating that you want the Kubernetes Health Check logs written to the root directory.

  • From the Backend Protocol list box, select HTTP.

  • Click Add.

  • Infrastructure and Plan
    dev01 has been created
    host01 has been created
    demo-service-d01 has been created
    that you created
    here.
    DNS Configuration documentation
    The Add Load Balancer Listener pane
    The Services page with LB Status Ready
    The DNS Name card in the Load Balancers tab
    In the Service Name field, enter demo-service-d01.
  • From the Platform list box, select Linux/Docker Native.

  • In the Docker Image field, enter duplocloud/nodejs-hello:latest.

  • From the Docker Networks list box, select Docker Default.

  • Click Next. The Advanced Options page displays.

  • Click Create.

  • demo-service-d01
    has a status of
    Running
    .
    Infrastructure and Plan
    dev01 has been created
    host01 has been created
    Docker credentials
    The details page for demo-service-d01-1
    The Add Service page
    The demo-service-d01 Service details page displaying a Running status

    Step 7: Test the Application

    Test the application to ensure you get the results you expect.

    Estimated time to complete Step 7 and finish tutorial: 5 minutes.

    Prerequisites

    Before testing your application, verify that you completed the tasks in the previous tutorial steps. Using the DuploCloud Portal, confirm that:

    • An exist, both named NONPROD.

    • A Tenant named .

    • An EC2 Host named .

    • A Service named .

    • A Load Balancer .

    Testing the Application

    1. In the Tenant list box, select dev01.

    2. Navigate to Docker -> Services. The Services page displays.

    3. From the Name column, select demo-service-d01.

    1. Open a browser instance and paste the DNS in the URL field of your browser.

    2. Press ENTER. A web page with the text Hello World! is displayed, from the JavaScript program residing in your Docker Container running in demo-service-d01, which is exposed to the web by your Load Balancer.

    It can take from five to fifteen (5-15) minutes for the DNS Name to become active once you launch your browser instance to test your application.

    Congratulations! You have just launched your first web service on DuploCloud!

    Reviewing What You Learned

    In this tutorial, your objective was to create a cloud environment to deploy an application for testing purposes, and to understand how the various components of DuploCloud work together.

    The application rendered a simple web page with text, coded in JavaScript, from software application code residing in a Docker container. You can use this same procedure to deploy much more complex cloud applications.

    In the previous steps, you:

    • named NONPROD, a Virtual Private Cloud instance, backed by an AKS-enabled Kubernetes cluster.

    • named dev01 in Infrastructure NONPROD. While generating the Infrastructure, DuploCloud created a set of templates () to configure multiple Azure and Kubernetes components needed for your environment.

    • named host01, so your application has storage resources.

    Cleaning Up Your Tutorial Environment

    In this tutorial, you created many artifacts for testing purposes. Clean them up so others can run this tutorial using the same names for Infrastructure and Tenant.

    1. To delete the dev01 tenant , then return to this page. As you learned, the Tenant segregates all work in one isolated environment, so deleting the Tenant that you created cleans up most of your artifacts.

    2. Finish by deleting the NONPROD Infrastructure. In the DuploCloud Portal, navigate to Administrator -> Infrastructure. Click the Action menu icon () for the NONPROD row and select Delete.

    The NONPROD Infrastructure is deleted and you have completed the clean-up of your test environment.

    Thanks for completing this tutorial and proceed to the next section to learn more about .

    Click the Load Balancers tab. The Application Load Balancer configuration is displayed.
  • In the DNS status card on the right side of the Portal, click the Copy Icon ( ) to copy the DNS address displayed to your clipboard.

  • Created a Service named demo-service-d01 to connect the Docker containers and associated images, in which your application code resides, to the DuploCloud Tenant environment.

  • Created an ALB Load Balancer Listener to expose your application via ports and backend network configurations.

  • Verified that your web page rendered as expected by testing the DNS Name exposed by the Load Balancer Listener.

  • Infrastructure and Plan
    dev01 has been created
    host01 has been created
    demo-service-d01 has been created
    has been created
    Created a DuploCloud Infrastructure
    Created a Tenant
    Plan
    Created an EC2 host
    follow these instructions
    using DuploCloud with AWS
    The Services Details page with the DNS status card highlighted.
    A Browser instance displaying Hello World!