arrow-left
All pages
gitbookPowered by GitBook
1 of 7

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Creating an EKS Service

Finish the Quick Start Tutorial by creating an EKS Service

So far in this DuploCloud AWS tutorial, you created a VPC network with configuration templates (Infrastructure and Plan), an isolated workspace (Tenant), and an RDS database instance (optionally).

Now you need to create a DuploCloud Service on top of your Infrastructure and configure it to run and deploy your application. In this tutorial path, we'll deploy an application using Docker containers and leveraging AWS Elastic Kubernetes Service (EKS)arrow-up-right.

Alternatively, you can finish this tutorial by:

  • Creating an AWS ECS Service in DuploCloud running Docker containers

For a deeper comparison of EKS and ECS, consult.

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

hashtag
Deploying an AWS EKS Service in DuploCloud

For the remaining steps in this tutorial, you will:

  1. Create a Host (EC2 Instance) to serve as an .

  2. Create a Service and application using the premade Docker image: duplocloud/nodejs-hello:latest.

  3. Expose the Service by creating and sharing a Load Balancer and DNS name.

hashtag
Network Architecture and Configurations

The topology that DuploCloud creates behind the scenes resembles this low-level configuration in AWS.

Step 5: Create a Service

Creating a Service to run a Docker-containerized application

DuploCloud supports three container orchestration technologies to deploy Docker-container applications in AWS:

  • Native EKS

  • Native ECS Fargate

  • Built-in container orchestration in DuploCloud using EKS/ECS

Test the application.
  • Obtain access to the container shell and kubectl for debugging.

  • Creating a DuploCloud native Docker Service
    this AWS blogarrow-up-right
    AWS EKS worker nodearrow-up-right
    AWS architecture and configuration
    circle-info

    You don't need experience with Kubernetes to deploy an application in the DuploCloud Portal. However, it is helpful to be familiar with the Docker arrow-up-rightplatform. Docker runs on any platform and provides an easy-to-use UI for creating, running, and managing containers.

    To deploy your own applications with DuploCloud, you’ll choose a public image or provide credentials for your private repository and configure your Docker Registry credentials in DuploCloud.

    This tutorial will guide you through deploying a simple Hello World NodeJS web app using DuploCloud's built-in container orchestration with EKS. We’ll use a pre-built Docker container and access Docker images from a preconfigured Docker Hub.

    Estimated time to complete Step 5: 10 minutes.

    hashtag
    Prerequisites

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

    • An Infrastructure and Plan exist, both named NONPROD.

    • The NONPROD infrastructure has EKS Enabled.

    • A Tenant named dev01 has been created.

    • A host named .

    hashtag
    Adding a Service

    1. In the Tenant list box, select the dev01 Tenant.

    2. In the DuploCloud Portal, navigate to Kubernetes -> Services.

    3. Click Add. The Add Service page displays.

      Add Service page
    4. From the table below, enter the values that correspond to the fields on the Add Service page. Accept all other default values for fields not specified.

    5. Click Next. The Advanced Options page is displayed.

    6. At the bottom of the Advanced Options page, click Create. In about five (5) minutes, the Service will be created and initialized, displaying a status of Running in the Containers tab.

    Add a Service page field
    Value

    Service Name

    demo-service

    Docker Image

    duplocloud/nodejs-hello:latest

    circle-info

    Use the Containers tab to monitor the Service creation status, between Desired (Running) and Current.

    hashtag
    Using Spot Instances (optional)

    Follow the steps in Creating Services using Autoscaling Groups. In the Add Service page, Basic Options, Select Tolerate spot instances.

    hashtag
    Checking your work

    Verify that your DuploCloud Service, demo-service, has a status of Running.

    1. In the Tenant list box, select the dev01 Tenant.

    2. In the DuploCloud Portal, navigate to Kubernetes -> Services.

    3. Click on the Service name (demo-service).

    4. On the Containers tab, verify that the current status is Running.

    Step 4: Create a Host

    Creating a Host that acts as an EKS Worker node

    Creating an AWS EKSarrow-up-right Service uses technologies from AWS and the Kubernetes arrow-up-rightopen-source container orchestration system.

    Kubernetes uses worker nodes to distribute workloads within a cluster. The cluster automatically distributes the workload among its nodes, enabling seamless scaling as required system resources expand to support your applications.

    Estimated time to complete Step 4: 5 minutes.

    hashtag
    Prerequisites

    Before creating a Host (essentially a Virtual Machinearrow-up-right), verify that you completed the previous tutorial steps. Using the DuploCloud Portal, confirm that:

    • An exist, both named NONPROD.

    • The NONPROD infrastructure has .

    • A named dev01 has been created.

    hashtag
    Select the Tenant You Created

    In the Tenant list box, select the dev01 Tenant that you created.

    hashtag
    Creating a Host

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

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

    3. In the Friendly Name field, enter host01.

    circle-info

    The EKS Image ID is the image published by AWS specifically for an EKS worker in the version of Kubernetes deployed at Infrastructure creation time. For this tutorial, the region is us-west-2, where the NONPROD Infrastructure was created.

    If there is no Image ID with an EKS prefix, copy the AMI ID for the desired EKS version following this . Select Other from the Image ID list box and paste the AMI ID in the Other Image ID field. Contact the DuploCloud Support team via your Slack channel if you have questions or issues.

    hashtag
    Checking Your Work

    1. In the DuploCloud Portal, navigate to Cloud Services -> Hosts.

    2. Select the EC2 tab.

    3. Verify that the Host status is Running.

    In the Instance Type list box, select t3a.medium.

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

  • From the Agent Platform list box, select EKS Linux.

  • From the Image ID list box, select any Image ID with an EKS prefix (for example, EKS-Oregon-1.23).

  • 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
    EKS Enabled
    Tenant
    AWS documentationarrow-up-right
    The EC2 Add Host page
    The EC2 tab with Host status Running
    host01 has been created

    Step 8: Create a Custom DNS Name (Optional)

    Changing the DNS Name for ease of use

    circle-info

    After you create a Load Balancer Listener you can modify the DNS Name for ease of use and reference by your applications. It isn't necessary to run your application or complete this tutorial.

    To skip this step, proceed to test your application and complete this tutorial.

    Once the Load Balancer is created, DuploCloud programs an autogenerated DNS Name registered to demo-service in the Route 53 domain. Before you create production deployments, you must create the Route 53 Hosted Zone domain (if DuploCloud has not already created one for you). For this tutorial, it is not necessary to create a domain.

    Estimated time to complete Step 8: 5 minutes.

    hashtag
    Prerequisites

    Before securing 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.

    • The NONPROD infrastructure has .

    • A Tenant named .

    hashtag
    Creating a Custom DNS Name

    1. In the Tenant list box, select the dev01 Tenant.

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

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

    An entry for your new DNS name is now registered with demo-service.

    hashtag
    Checking Your Work

    1. Navigate to Kubernetes -> Services.

    2. From the Name column, select demo-service.

    3. Select the Load Balancers tab and verify that the DNS Name card displays your modified DNS Name.

    Step 6: Create a Load Balancer

    Creating a Load Balancer to configure network ports to access the application

    Now that your DuploCloud Service is running, you have a mechanism to expose the containers and images in which your application resides. However, since your containers are inside a private network, you need a Load Balancer listening on the correct ports to access the application.

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

    Estimated time to complete Step 6: 10 minutes.

    hashtag
    Prerequisites

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

    Step 7: Enable Additional Load Balancer Options (Optional)

    Add a security layer and enable other Load Balancer options

    circle-exclamation

    This step is optional and unneeded for the example application in this tutorial; however, production cloud apps require an elevated level of protection.

    To set up a Web Application Firewall (WAF) for a production application, follow the steps in the .

    In this tutorial step, for the Application Load Balancer (ALB) you created in , you will:

    A Host named host01 has been created.
  • A Service named demo-service has been created.

  • An HTTPS ALB Load Balancer has been created.

  • Click the Load Balancers tab. The ALB Load Balancer configuration is displayed.
  • In the DNS Name card, click Edit. The prefix in the DNS Name is editable.

  • Edit the DNS Name and select a meaningful DNS Name prefix.

  • Click Save. A success message briefly displays at the top center of the DuploCloud Portal.

  • Infrastructure and Plan
    EKS Enabled
    dev01 has been created
    The DNS Name card on the Load Balancers tab
  • An Infrastructure and Plan exist, both named NONPROD.

  • The NONPROD infrastructure has EKS Enabled.

  • A Tenant named dev01 has been created.

  • A Host named host01 has been created.

  • A Service named .

  • hashtag
    Creating a Load Balancer

    1. In the Tenant list box, select the dev01 Tenant.

    2. In the DuploCloud Portal, navigate to Kubernetes -> Services.

    3. From the NAME column, select demo-service.

    4. Click the Load Balancers tab.

    5. Click the Configure Load Balancer link. The Add Load Balancer Listener pane displays.

    The Add Load Balancer Listener pane
    1. From the Type list box, select Application LB.

    2. In the Container Port field, enter 3000. This is the configured port on which the application inside the Docker Container Image duplocloud/nodejs-hello:latest is running.

    3. In the External Port field, enter 80. This is the port through which users will access the web application.

    4. From the Visibility list box, select Public.

    5. From the Application Mode list box, select Docker Mode.

    6. Type / (forward-slash) in the Health Check field to indicate that the cluster we want Kubernetes to perform Health Checks on is located at the root level.

    7. In the Backend Protocol list box, select HTTP.

    8. Click Add. The Load Balancer is created and initialized. Monitor the LB Status card on the Services page. The LB Status card displays Ready when the Load Balancer is ready for use.

    hashtag
    Checking your work

    1. In the Tenant list box, select the dev01 Tenant.

    2. In the DuploCloud Portal, navigate to Kubernetes -> Services.

    3. From the NAME column, select demo-service.

    4. Verify that the LB Status card displays a status of Ready.

    5. Note the DNS Name of the Load Balancer that you created.

    6. In the LB Listeners area of the Services page, note the configuration details of the Load Balancer's HTTP protocol, which you specified, when you added it above.

    The Services details page with Ready LB Status highlighted

    Enable access logging to monitor HTTP messagearrow-up-right details and record incoming traffic data. Access logs are crucial for analyzing traffic patterns and identifying potential threats, but they are not enabled by default. You must manually activate them in the Load Balancer settings.

  • Protect against requests that contain invalid headersarrow-up-right.

  • Estimated time to complete Step 7: 5 minutes.

    hashtag
    Prerequisites

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

    • An Infrastructure and Plan exist, both named NONPROD.

    • The NONPROD infrastructure has EKS Enabled.

    • A Tenant named dev01 has been created.

    • A Host named .

    • A Service named .

    • An has been created.

    hashtag
    Securing the Load Balancer

    1. In the Tenant list box, select the dev01 Tenant.

    2. In the DuploCloud Portal, navigate to Kubernetes -> Services.

    3. From the NAME column, select the Service (demo-service).

    4. Select the Load Balancers tab.

    5. In the Other Settings card, click Edit. The Other Load Balancer Settings pane displays.

    6. Select the Enable Access Logs and Drop Invalid Headers options.

    7. Accept the remaining default settings and click Save. The settings are updated.

    hashtag
    Checking Your Work

    1. In the Tenant list box, select the dev01 Tenant.

    2. In the DuploCloud Portal, navigate to Kubernetes -> Services.

    3. From the NAME column, select the Service (demo-service).

    4. Select the Load Balancers tab.

    5. Verify that the Other Settings card contains the selections you made above for:

    • Web ACL - None

    • HTTP to HTTPS Redirect - False

    • Enable Access Logs - True

    • Drop Invalid Headers - True

    The Other Settings card

    Enabling access logs enhances the security and monitoring capabilities of your Load Balancer and provides insights into the traffic accessing your application, for a more robust security posture.

    Web Application Firewall procedure
    Step 6

    Step 9: Test the Application

    Test the application to ensure you get the results you expect

    You can test your application directly from the Services page using the DNS status card.

    Estimated time to complete Step 9 and finish tutorial: 10 minutes.

    hashtag
    Prerequisites

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

    demo-service has been created
    host01 has been created
    demo-service has been created
    Load Balancer
    The Load Balancers tab with the Other Settings Edit option highlighted
    The Other Load Balancer Settings pane

    An Infrastructure and Plan exist, both named NONPROD.

  • The NONPROD infrastructure has EKS Enabled.

  • A Tenant named dev01 has been created.

  • A Host named host01 has been created.

  • A Service named demo-service has been created.

  • An HTTPS Application Load Balancer has been created.

  • hashtag
    Testing the Application

    circle-info

    Note that if you skipped Step 7 and/or Step 8, the configuration in the Other Settings and DNS cards appears slightly different from the configuration depicted in the screenshot below. These changes do not impact you in testing your application, as these steps are optional. You can proceed to test your app with no visible change in the output of the deployable application.

    1. In the Tenant list box, select the dev01 Tenant.

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

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

    4. Click the Load Balancers tab.

    5. In the DNS status card, click the Copy Icon ( ) to copy the DNS address displayed to your clipboard.

    6. Open a browser instance and Paste the DNS in the URL field of your browser.

    7. 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, which is exposed to the web by your Load Balancer.

    Web page with Hello World! displayed
    circle-info

    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!

    hashtag
    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:

    • Created a DuploCloud Infrastructure named NONPROD: a Virtual Private Cloud instance backed by an EKS-enabled Kubernetes cluster.

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

    • Created an EC2 host named host01, providing the application with storage resources.

    • named demo-service to connect the Docker containers and associated images housing your application code to the DuploCloud Tenant environment.

    • to expose your application via ports and backend network configurations.

    • as expected by testing the DNS Name exposed by the Load Balancer Listener.

    hashtag
    Cleaning Up Your Tutorial Environment

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

    1. To delete the dev01 tenant follow these instructions, then return to this page. As you learned, the Tenant segregates all work in one isolated environment, so deleting the Tenant 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 using DuploCloud with AWS.

    Created a Service
    Created an ALB Load Balancer Listener
    Verified that your web page rendered