Step 5: Create a Load Balancer
Create a Load Balancer to access your application
Now that your DuploCloud Service is running, you have a mechanism to expose the containers and images where 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 the network configuration.
Estimated time to complete Step 5: 20 minutes.
Prerequisites
Before creating your DuploCloud Load Balancer, ensure that:
All previous steps in this tutorial to create an Infrastructure and Plan, Tenant, Azure Agent Pool, and Service are complete.
AKS Kubernetes cluster is enabled.
dev01 is selected in the Tenant list box, at the top of the DuploCloud Portal.

Adding a Load Balancer
In the DuploCloud Portal, navigate to Kubernetes -> Services.
On the Services page, select the nginx-service you created.
Select the Load Balancers tab.
Click Add. The Add Load Balancer Listener pane displays.
The Add Load Balancer Listener pane Fill the fields as shown in the following tables. Leave any default values for fields not specified.
Select Type
K8S Node Port
Container Port
80
External Port
30008
Health Check
/
(forward-slash)
Backend Protocol
TCP
Click Add. After a few minutes, the LB Status card displays a status of Ready, indicating that the Load Balancer is ready for use.

Enabling the Ingress Controller
When we created the Load Balancer Listener, we used the K8S Node Port type, which leverages the capabilities of the Kubernetes Ingress object.
Ingress is an entry point that front-ends multiple services in a cluster. It can be defined as a collection of routing rules that governs how external users access services running inside a Kubernetes cluster. One of the greatest benefits of Ingress is its ability to secure the network traffic to your application. With Ingress, you can define a TLS private key and certificates by leveraging Kubernetes Secrets, instead of directly defining TLS details in the Ingress resource.
To use Ingress, you first enable the Kubernetes Ingress Controller to open the application gateway for Ingress.
In the DuploCloud Portal, navigate to Administrator -> Infrastructure.
Select your Infrastructure from the NAME column.
Click the Settings tab.
Click Add. The Infra-Set Custom Data pane displays.
In the Setting Name field, select Enable App Gateway Ingress Controller.
Click Enable.
Click Set. In the Settings tab, the Enable App Gateway Ingress Controller setting now contains the true in the Value column.

Adding Kubernetes Ingress
Now that your gateway is established and opened, you add Kubernetes Ingress to expose the backend HTTP routes outside the cluster to your service.
The Ingress object communicates with the Kubernetes NodePort that your Load Balancer Listener uses. Ingress objects are flexible constructs in Kubernetes, and their use here is an example of how DuploCloud leverages the power of Kubernetes constructs while abstracting away their native complexity. To manually create these components (and maintain them) in Kubernetes, takes a significant amount of developer time.
In the DuploCloud Portal, navigate to Kubernetes -> Ingress.
Click Add. The Add Kubernetes Ingress page displays.
In the Ingress Name field, type
viewwebsite
.In the Ingress Controller list box, select azure-application-gateway.
In the Visibility list box, select Public.
Click Add Rule. The Add Ingress Rule pane displays.
In the Path field, type / (forward-slash).
In the Service Name field, select nginx-service:80.
Click Add Rule to add the rule and to close the Add Ingress Rule pane. You should be back to viewing the Add Kubernetes Ingress page.
Add Ingress Rule pane On the Add Kubernetes Ingress page, click Add to add Ingress. On the Ingress page, the VIEWWEBSITE Ingress that you defined, with an Ingress Class of azure-application-gateway, displays.
Ingress page displaying VIEWWEBSITE Ingress
Checking Your Work
Before you proceed to the final step and run your application, ensure that you:
Configured a Load Balancer Listener that uses K8S Node Port.
Enabled the App Gateway Ingress Controller.
Defined an Ingress and a rule for your DuploCloud Service to listen on port 80.
Last updated
Was this helpful?