Set up Kubernetes Ingress and Load Balancer with K8s NodePort

Enable AWS Application Load Balancer

Your administrator needs to enable the AWS Application Load Balancer controller for your infrastructure before you can use Ingress.
  1. 1.
    In the DuploCloud Portal, navigate to Administrator > Infrastructure > Infrastructure_name > Settings.
  2. 2.
    In the Enable ALB Ingress Controller field, select True.

Create Tenants, Hosts, and Services with EKS

See the Containers topic for steps on how to create Tenants, Hosts, and Services.
Once your service is deployed, you are ready to add and configure Kubernetes Ingress.
In this example, three Nginx services run with different paths.
The Services page

Add Kubernetes Ingress

Once Services are deployed, add Ingress:
  1. 1.
    Select DevOpos -> Containers -> EKS/Native from the navigation pane.
  2. 2.
    Click the K8S Ingress tab.
  3. 3.
    Click Add. The Add Kubernetes Ingress page displays.
Add Kubernetes Ingress page

Add rules to Kubernetes Ingress

  1. 1.
    In the Add Kubernetes Ingress page, configure Ingress by clicking Add Rule. The Add Ingress Rule pane displays.
  2. 2.
    Complete the other fields on the page and click Add Rule. Add additional rules as needed.
Add Ingress Rule pane
DuploCloud Platform supports defining multiple paths in Ingress.
Continuing our previous example, we have defined an Ingress to route requests to /path1/for testsvc1, and requests to /path2/ for testsvc2. For the third service, we have brought out own host (BYOH), example.com. In this example, the Ingress rules apply only to example.com.
Kubernetes Ingress rules

Add Load Balancer with Kubernetes NodePort

Add a load balancer listener that uses Kubernetes NodePort.
Using Kubernetes Health Check allows AWS's Application Load Balancer to determine whether your service is running properly.
  1. 1.
    In the DuploCloud Portal, navigate DevOps -> Containers -> EKS/Native.
  2. 2.
    On the Services page, select the Service name in the Name column.
  3. 3.
    Click the Load Balancers tab.
  4. 4.
    Click Configure Load Balancer. The Add Load Balancer Listener pane appears.
  5. 5.
    In the Select Type field, select K8S Node Port.
  6. 6.
    Optionally, select Set Health Check annotations for Ingress to add Kubernetes Health Checks and Probes.
  7. 7.
    Complete the other fields in the Add Load Balancer Listener and click Add.

View Ingress

Once Ingress is configured, you can access Services based on the rules for each DNS.
K8s Ingress Tab
By executing curl commands, you can see the difference in the output for each service. Configured services are accessed based on the DNS name specified in the DuploCloud Portal and the paths that you configured when you added Ingress rules.
>curl http://sample-ingress.qaapps.duplocloud.net/path1/ this is service1 >curl http://sample-ingress.qaapps.duplocloud.net/path2/ this is service2 >curl -H "Host: example.com" http://sample-ingress.qaapps.duplocloud.net/ this is service3