Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Finish the Quick Start Tutorial by creating an EKS Service
In this tutorial for DuploCloud AWS, you have so far created a VPC network with configuration templates (Infrastructure and Plan), an isolated workspace (Tenant), and optionally, an RDS database instance.
Now you need to create a DuploCloud Service on top of your Infrastructure and configure the Service to run and deploy your application. In this tutorial path, we'll deploy using Docker containers, leveraging AWS Elastic Kubernetes Service (EKS).
Alternatively, you can finish this tutorial by:
Creating an AWS ECS Service in DuploCloud running Docker containers
For a full discussion of the benefits of EKS vs. ECS, consult this AWS blog.
Estimated time to complete remaining tutorial steps: 30-40 minutes
For the remaining steps in this tutorial, you will:
Create a Host (EC2 Instance), which serves as an AWS EKS worker node.
Create a Service and applications (webapp) using the premade Docker image duplocloud/nodejs-hello:latest.
Expose the Service by creating and sharing a load balancer and DNS name.
Test the application.
Obtain access to the container shell and kubectl
for debugging.
Behind the scenes, the topology that DuploCloud creates resembles this low-level configuration in AWS.
Creating a Service to run a Docker-containerized application
DuploCloud supports three container orchestration technologies to deploy containerized applications in AWS:
Native EKS
Native ECS Fargate
Built-in container orchestration in DuploCloud using EKS/ECS Kubernetes
You can use any of these methods, which all employ Docker containers. This tutorial uses DuploCloud's built-in container orchestration using EKS and Kubernetes
You don't have to have experience with Kubernetes to deploy an application in the DuploCloud Portal. However, it is helpful to be familiar with the Docker platform. Docker runs on any platform and provides an easy-to-use UI for creating, running, and managing containers, in which your application code resides.
This tutorial will access a pre-built Docker container to deploy a simple Hello World NodeJS
web app. When you run the application, DuploCloud accesses Docker images in a preconfigured Docker Hub.
When you run your own applications, you will choose a public image or provide credentials to access your private repository. Before you deploy your own applications, configure your Docker Registry credentials in DuploCloud.
Estimated time to complete Step 5: 10 minutes.
Before creating a Service, verify that you accomplished the tasks in the previous tutorial steps. Using the DuploCloud Portal, confirm that:
An Infrastructure and Plan exist, both with the name NONPROD.
The NONPROD infrastructure has EKS Enabled.
A Tenant with the name dev01 has been created.
A host with the name host01 has been created.
In the Tenant list box, on the upper-left side of the DuploCloud Portal, select the dev01 Tenant that you created.
In the DuploCloud Portal, navigate to DevOps -> Containers -> EKS/Native. The Services page displays.
Click Add. The Add Service page displays.
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.
Click Next. The Advanced Options page is displayed.
At the bottom of the Advanced Options page, click Create. Your Service is created and initialized. In about five (5) minutes, in the Containers tab, your DuploCloud Service displays a Current status of Running.
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.
Click Next. The Advanced Options page is displayed.
At the bottom of the Advanced Options page, click Create. Your Service is created and initialized. In about five (5) minutes, in the Containers tab, your DuploCloud Service displays a Current status of Running.
Use the Containers tab to monitor the Service creation status, between Desired (Running) and Current.
Follow the steps in Creating Services using Autoscaling Groups. In the Add Service page, Basic Options, Select Tolerate spot instances.
Verify that your DuploCloud Service, demo-service, has a Current status of Running.
Changing the DNS Name for ease of use
It is possible to modify the DNS Name after you create a Load Balancer Listener for ease of use and reference by your applications, but it isn't necessary to run your application or complete this tutorial.
Estimated time to complete Step 8: 5 minutes.
Before securing a Load Balancer, verify that you accomplished the tasks in the previous tutorial steps. Using the DuploCloud Portal, confirm that:
In the Tenant list box, on the upper-left side of the DuploCloud Portal, select the dev01 Tenant that you created.
In the DuploCloud Portal, navigate to Kubernetes -> Services. The Services page displays.
From the Name column, select demo-service.
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.
An entry for your new DNS name is now registered with demo-service.
The DNS Name card displays your modified DNS Name.
Creating a Host that acts as an EKS Worker node
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.
In the Tenant list box, on the upper-left side of the DuploCloud Portal, select the dev01 Tenant that you created.
In the DuploCloud Portal, navigate to Cloud Services -> Hosts. The Hosts page displays.
In the EC2 tab, click Add. The Add Hosts page displays.
In the Friendly Name field, enter host01.
From the Instance Type list box, select 2 CPU 4 GB - t3.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 that is prefixed by EKS (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.
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.
Verify that the Host you created has a Status of Running.
Add a Service page field | Value |
---|---|
To skip this step, proceed to .
Once the load balancer is created, DuploCloud programs an autogenerated DNS Name registered to demo-service in the domain. Before you create production deployments, you must Hosted Zone domain, if the DuploCloud staff has not already created one for you. For this tutorial, it is not necessary to create the domain.
An exist, both with the name NONPROD.
The NONPROD infrastructure has .
A Tenant with the name .
A Host with the name .
A Service with the name .
An has been created.
When you create an Service, you are using a combination of technologies from AWS and the open-source container orchestration system.
Before creating a Host (essentially a ), verify that you accomplished the tasks in the previous tutorial steps. Using the DuploCloud Portal, confirm that:
An exist, both with the name NONPROD.
The NONPROD infrastructure has .
A Tenant with the name .
If no Image ID is available with a prefix of EKS, copy the AMI ID for the desired EKS version by referring to this . Select Other from the Image ID list box and paste the copied AMI ID in the Other Image ID field. Contact the DuploCloud Support team via your Slack channel if you have questions or issues.
Service Name
demo-service
Docker Image
duplocloud/nodejs-hello:latest
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. But because your containers are running inside a private network, you also need a load balancer to listen on the correct ports in order to access the application.
In this step, we add a Load Balancer Listener to complete this network configuration.
Estimated time to complete Step 6: 10 minutes.
Before creating 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 with the name NONPROD.
The NONPROD infrastructure has EKS Enabled.
A Tenant with the name dev01 has been created.
A Host with the name host01 has been created.
A Service with the name demo-service has been created.
In the Tenant list box, on the upper-left side of the DuploCloud Portal, select the dev01 Tenant that you created.
In the DuploCloud Portal, navigate to Kubernetes -> Services. The Services page displays.
From the Name column, select demo-service.
Click the Load Balancers tab.
Click the Configure Load Balancer link. The Add Load Balancer Listener pane displays.
From the Type list box, select Application LB.
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.
In the External Port field, enter 80. This is the port through which users will access the web application.
From the Visibility list box, select Public.
From the Application Mode list box, select Docker Mode.
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.
In the Backend Protocol list box, select HTTP.
Click Add. The Load Balancer is created and initialized. Monitor the LB Status card on the Services page. When the Load Balancer is ready for use the LB Status card displays Ready.
Verify that the Load Balancer has an LB Status of Ready.
On the Services page, note the DNS Name of the Load Balancer that you created.
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.
Adding a security layer and enabling other options for your Load Balancer
This step is optional and not necessary to run the example application in this tutorial.
However, while it's not as important to secure a load balancer for a small web application in a tutorial, your 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 Web Application Firewall procedure. You won't set up a WAF in this tutorial.
Otherwise, to skip this step, proceed to the next page in this tutorial.
In this tutorial step, for the Application Load Balancer (ALB) you created in Step 6, you will:
Enable access logging to monitor HTTP message details.
Protect against requests that contain invalid headers.
Estimated time to complete Step 7: 5 minutes.
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 with the name NONPROD.
The NONPROD infrastructure has EKS Enabled.
A Tenant with the name dev01 has been created.
A Host with the name host01 has been created.
A Service with the name demo-service has been created.
An HTTPS ALB Load Balancer has been created.
In the Tenant list box, on the upper-left side of the DuploCloud Portal, select the dev01 Tenant that you created.
In the DuploCloud Portal, navigate to Kubernetes -> Services. The Services page displays.
From the Name column, select the Service to which your Load Balancer is attached (demo-service).
Click the Load Balancers tab.
In the Other Settings card, click Edit. The Other Load Balancer Settings pane displays.
In the Web ACL list box, select None, because you are not connecting a Web Application Firewall.
For this tutorial, select only the Enable Access Logs and Drop Invalid Headers options.
Accept the Idle Timeout default setting and click Save. The Other Settings card in the Load Balancers tab is updated with your selections.
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
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.
Before testing your application, verify that you accomplished the tasks in the previous tutorial steps. Using the DuploCloud Portal, confirm that:
In the Tenant list box, on the upper-left side of the DuploCloud Portal, select the dev01 Tenant that you created.
In the DuploCloud Portal, navigate to Kubernetes -> Services. The Services page displays.
From the Name column, select demo-service.
Click the Load Balancers tab. The Application Load Balancer configuration is displayed.
Open a browser instance and Paste the DNS in the URL field of your browser.
Press ENTER. A web page with the text Hello World! is displayed, from the JavaScript program residing in your Docker Container that is running in demo-service, 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!
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:
In this tutorial, you created many artifacts for testing purposes. When you are ready, clean them up so that another person can run this tutorial from the start, using the same names for Infrastructure and Tenant.
The NONPROD Infrastructure is deleted and you have completed the clean-up of your test environment.
An exist, both with the name NONPROD.
The NONPROD infrastructure has EKS.
A Tenant with the name .
A Host with the name .
A Service with the name .
An has been created.
Note that if you skipped and/or , 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.
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.
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 that your application has storage resources with which to run.
named demo-service to connect the Docker containers and associated images, in which your application code resides, 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.
To delete the dev01 tenant and 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.
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.
Thanks for completing this tutorial and proceed to the next section to learn more about .