# EKS Load Balancers

## Creating an EKS Ingress

If you need to create an Ingress Load Balancer, refer to the [EKS Ingress](https://docs.duplocloud.com/docs/automation-platform/kubernetes-overview/ingress-loadbalancer/adding-ingress) page in the DuploCloud Kubernetes User Guide.

## Adding a Load Balancer Listener

{% hint style="info" %}
For an end-to-end example of deploying an application using an EKS Service, see the [AWS Quick Start Tutorial](https://docs.duplocloud.com/docs/automation-platform/overview/quick-start) and choose the [Creating an EKS Service](https://docs.duplocloud.com/docs/automation-platform/overview/quick-start/quick-start-eks-services) option.
{% endhint %}

1. In the DuploCloud Portal, navigate **Kubernetes** -> **Services**.
2. On the **Services** page, select the Service name in the **Name** column.
3. Click the **Load Balancers** tab.
4. If no Load Balancers exist, click the **Configure Load Balancer** link. If other Load Balancers exist, click **Add** in the **LB listeners** card. The **Add Load Balancer Listener** pane displays.
5. From the **Select Type** list box, select a Load Balancer Listener type based on your Load Balancer.
6. Complete other fields as required and click **Add** to add the Load Balancer Listener.<br>

   <div align="left"><figure><img src="https://2471407984-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F68cb0s9ce5UIUKWPuYs8%2Fuploads%2F0DjPfSIWAusDK8tdNkBV%2FLBL1.png?alt=media&#x26;token=25caf5d9-a2df-418e-a4f9-d553b90749c7" alt=""><figcaption><p><strong>Add Load Balancer Listener</strong> pane</p></figcaption></figure></div>

### Adding a Network Load Balancer (NLB) Listener with a custom CIDR

To specify a custom classless inter-domain routing (CIDR) value for an NLB Load Balancer, edit the Load Balancer Listener configuration in the DuploCloud Portal.

Before completing this task, you must [add a Load Balancer Listener of **Type Network LB**](#adding-a-load-balancer-listener).

1. In the DuploCloud Portal, navigate to **Kubernetes** -> **Services**.
2. On the **Services** page, select the Service name in the **Name** column.
3. Click the **Load Balancers** tab.
4. In the **LB Listeners** area, select the Edit Icon (<img src="https://2471407984-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F68cb0s9ce5UIUKWPuYs8%2Fuploads%2Fmx6BSiTFLuvMblBMNHpl%2Fimage.png?alt=media&#x26;token=8161be7d-0d46-45d1-8592-2039eb15bad2" alt="" data-size="line">) for the NLB Load Balancer you want to edit. The **Edit Load Balancer Listener** pane displays.
5. Click **Add** in the **Custom CIDR** field of the **Edit Load Balancer Listener** pan&#x65;**.**
6. Add the **Custom CIDR**(s) and press ENTER. In the example below **10.180.12.0/22** and **10.180.8.0/22** are added. After the CIDRs are added, you [add Security Groups for Custom CIDR(s)](#adding-security-groups-for-custom-cidrs).

<div align="left"><figure><img src="https://2471407984-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F68cb0s9ce5UIUKWPuYs8%2Fuploads%2FriWLwFIuy0l8AWZuUgIB%2FLBL7.png?alt=media&#x26;token=e912c414-b097-4fb8-a6a0-7fffde67ca9c" alt=""><figcaption><p><strong>Edit Load Balancer Listener</strong> pane with <strong>Custom CIDRs</strong></p></figcaption></figure></div>

### Adding Security Groups for NLBs with custom CIDRs

{% hint style="info" %}
Repeat this procedure for each custom CIDR that you want to add.
{% endhint %}

1. Navigate to **Administrator** -> **Infrastructure**. The **Infrastructure** page displays.
2. From the **Name** column, select the appropriate Infrastructure.
3. Click the **Security Group Rules** tab.
4. Click **Add** to add a Security Group. The **Add Tenant Security** pane displays.
5. From the **Source Type** list box, select **Ip Address**.
6. From the **IP CIDR** list box, select **Custom**. A field labeled **CIDR notation of allowed hosts** displays.
7. In the **CIDR Notation of allowed hosts** field enter a custom CIDR and complete the other required fields.
8. Click **Add** to add the Security Group containing the custom CIDR.

Repeat this procedure to add additional CIDRs.

<div align="left"><figure><img src="https://2471407984-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F68cb0s9ce5UIUKWPuYs8%2Fuploads%2F3CNyfpbno2TkRWCXOWFL%2FLBL8.png?alt=media&#x26;token=7f58c739-8cba-49a4-8f1a-0cf1fe39881e" alt=""><figcaption><p><strong>Add Tenant Security</strong> pane for adding <strong>Custom CIDRs</strong> to Securty Groups</p></figcaption></figure></div>

## Adding a Shared Load Balancer

1. In the DuploCloud Portal, navigate to **Cloud Services** -> **Networking**.
2. Click the **Load Balancer** tab.
3. Click **Add**. The **Create a Load Balancer** pane displays.<br>

   <div align="left"><figure><img src="https://2471407984-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F68cb0s9ce5UIUKWPuYs8%2Fuploads%2F4yMwc2XVK1TbvLnclR0m%2FAWS_alb_lb_create.png?alt=media&#x26;token=062bb6de-2bdb-40c4-9fee-2b8e0e271620" alt=""><figcaption><p><strong>Create a Load Balancer</strong> pane for a shared <strong>Application</strong> load balancer</p></figcaption></figure></div>
4. In the **Name** field, enter a name for the Load Balancer.
5. From the **Type** list box, select a Load Balancer type.
6. From the **Visibility** list box, select **Public** or **Internal**.
7. Click **Create**.

## Creating a Target Group Only Load Balancer for multiple services <a href="#id-2d32" id="id-2d32"></a>

Instead of creating a unique Load Balancer for each Service you create, you can share a single Load Balancer between multiple Services. This is helpful when your applications run distributed microservices where the requests use multiple services and route traffic based on application URLs, which you can define with Load Balancer Listener Rules.

To accomplish this, you:

1. Create a Service Load Balancer with the type Target Group Only. This step creates a Service Load Balancer that includes a Target Group with a pre-defined name.
2. Create a Shared Load Balancer with the Target Group that was defined.
3. Create routing rules for the Shared Load Balancer and the Target Group it defines.

### Creating a Service Load Balancer with the type Target Group Only

1. In the DuploCloud Portal, navigate **Kubernetes -> Services**.
2. On the **Services** page, select the Service name in the **Name** column.
3. Click the **Load Balancers** tab.
4. If no Load Balancers exist, click the **Configure Load Balancer** link. If other Load Balancers exist, click **Add** in the **LB listeners** card. The **Add Load Balancer Listener** pane displays.
5. From the **Select Type** list box, select **Target Group Only**.
6. You can create a Load Balancer Listener with a type of **Target Group** **Only** for Docker Mode or **Native** EKS and ECS Services based on your application requirement. Complete the other required fields and click **Add**.
7. Note the name of the created Target Group by clicking the Info Icon ( <img src="https://2471407984-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F68cb0s9ce5UIUKWPuYs8%2Fuploads%2Fj32iLFAr0qiapahv3QJk%2Finfo_tip_black.png?alt=media&#x26;token=374f5522-02cd-4001-932b-762fde447edc" alt="" data-size="line"> ) for the Load Balancer in the **LB Listener** card and searching for the string `TgName`. You will select the Target Group when you [create a Shared Load Balancer for the Target Group](#creating-a-shared-load-balancer-for-the-target-group).<br>

   <div align="left"><figure><img src="https://2471407984-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F68cb0s9ce5UIUKWPuYs8%2Fuploads%2FUOp43Gj8p61y0JphNPkZ%2FAWS_Target3.png?alt=media&#x26;token=3078cdb7-407d-42fa-9dfa-c73c2729ef6d" alt=""><figcaption><p><strong>Add Load Balancer Listener</strong> pane for <strong>Target Group Only Type</strong></p></figcaption></figure></div>

The **Target Group Only** Service Load Balancer is displayed in the **LB Listeners** area in the **Load Balancers** tab on the **Services** page.

<figure><img src="https://2471407984-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F68cb0s9ce5UIUKWPuYs8%2Fuploads%2FLhgRa6GDTNsQyLikV27Y%2Floadbalance1.png?alt=media&#x26;token=6e3fd454-fd45-485e-b752-6ee11331093e" alt=""><figcaption><p><strong>Load Balancers</strong> tab</p></figcaption></figure>

### Creating a Shared Load Balancer for the Target Group

[Add a Shared Load Balancer](#adding-a-shared-load-balancer) before performing this procedure.

1. Navigate to **Cloud Services** -> **Networking** page.
2. Select the **Load Balancer** tab.
3. Select the Shared Load Balancer you created from the **NAME** column. The **Load Balancer** details page displays.<br>

   <figure><img src="https://2471407984-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F68cb0s9ce5UIUKWPuYs8%2Fuploads%2F4TqXHzGF3lrAfIZFUSBF%2FScreenshot%20(250).png?alt=media&#x26;token=4fa10595-134d-44eb-bd5e-a563f50e1c26" alt=""><figcaption><p><strong>Load Balancers</strong> page with <strong>Listeners</strong> tab</p></figcaption></figure>
4. Select the **Listeners** tab, and click **Add**. The **Load Balancer Listener** pane displays.<br>

   <figure><img src="https://2471407984-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F68cb0s9ce5UIUKWPuYs8%2Fuploads%2FC5cSb6uCzPJlm5fY31Dg%2FScreenshot%20(252).png?alt=media&#x26;token=eb255dbb-0def-4ae4-8012-a559d90265f6" alt=""><figcaption><p>The <strong>Add Load Balancer Listener</strong> pane with <strong>Target Group</strong> specified</p></figcaption></figure>
5. In the **Port** field, enter the port number for incoming traffic (e.g., `80` or `443`).
6. In the **Protocol** list box, select the protocol to use (e.g., **HTTP** or **HTTPS**).
7. In the **Action Type** list box, select **Forward to Target Group**.
   * In the **Forward Target Group** list box, select the Target Group that was created when you [added a Load Balancer with the **Type Target Group Only** in the previous step](https://docs.duplocloud.com/docs/overview/aws-services/load-balancers#creating-a-service-load-balancer-with-the-type-target-group-only).
8. Click **Save**. The Shared Load Balancer for the Target Group displays in the **Listeners** tab.<br>

   <figure><img src="https://2471407984-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F68cb0s9ce5UIUKWPuYs8%2Fuploads%2Ft3VrFC8SByXTS3ucJQI2%2FScreenshot%20(253).png?alt=media&#x26;token=4c97f772-bc74-4272-a829-98f48ea15244" alt=""><figcaption><p>Shared Load Balancer for the Target Group</p></figcaption></figure>

### Adding Routing Rules to the Shared Load Balancer

[Create a Shared Load Balancer for the Target Group](#creating-a-shared-load-balancer-for-the-target-group) before performing this procedure.

{% hint style="warning" %}
Rules are not supported for Network Load Balancers (NLBs).
{% endhint %}

1. Navigate to **Cloud Services** -> **Networking** page.
2. Select the **Load Balancer** tab.
3. Select the Shared Load Balancer you created from the **NAME** column. The **Load Balancer** details page displays.
4. Select the **Listeners** tab.
5. Click the menu icon ( <img src="https://2471407984-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F68cb0s9ce5UIUKWPuYs8%2Fuploads%2FiNwYVMf4fky7ZPl41t38%2FKabab_three_Vertical_dots.png?alt=media&#x26;token=566b1d4e-a9bc-43c8-995a-044ceab9f38b" alt="" data-size="line"> ) next to the listener you want to add rules for, and select **Manage Rules**. The **Listener Rules** page displays.<br>

   <figure><img src="https://2471407984-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F68cb0s9ce5UIUKWPuYs8%2Fuploads%2FKMmDdQTINi8x8CN1ibur%2FScreenshot%20(255).png?alt=media&#x26;token=26d741e2-5121-41fe-9c20-5fedd0ad26ca" alt=""><figcaption><p>The <strong>Listeners</strong> tab on the <strong>Load Balancer</strong> details page w</p></figcaption></figure>
6. Click **Add**. The **Add LB Listener rule** page displays.<br>

   <figure><img src="https://2471407984-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F68cb0s9ce5UIUKWPuYs8%2Fuploads%2Fvj8ssKh6DGDUktnl1IgQ%2Faddrule.png?alt=media&#x26;token=9bc2d873-5a88-4c16-9c88-1bfad80d1168" alt=""><figcaption><p><strong>Add LB Listener</strong> rule page</p></figcaption></figure>
7. Create routing rules for the Target Group by setting appropriate **Conditions**. Add Routing Rules by specifying **Rule Type** and **Values**. Specify the **Forward Target Group** and specify **Priority** for multiple rules.<br>

   <figure><img src="https://2471407984-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F68cb0s9ce5UIUKWPuYs8%2Fuploads%2Fplp9FU8PSp07sfsw2Bkz%2FScreenshot%20(256).png?alt=media&#x26;token=98aaff14-6bef-4a74-a3e1-24e9ea021ad3" alt=""><figcaption></figcaption></figure>
8. Click **Submit**.

## Viewing Shared Load Balancer rules

View the rules you defined for any Shared Load Balancer.

1. In the DuploCloud portal, navigate to **Cloud Services** -> **Networking**.
2. Select the **Load Balancer** tab.
3. From the **Name** column, select the Load Balancer whose rules you want to view.
4. In the **Listeners** tab, in the appropriate **Target Group** row, click the **Actions** menu (<img src="https://2471407984-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F68cb0s9ce5UIUKWPuYs8%2Fuploads%2FaQe5p7flz0LzZESyhTO4%2Fimage.png?alt=media&#x26;token=90762291-a295-4f1c-a32a-e84f2b7687ee" alt="" data-size="line"> ) and select **Manage Rules**.<br>

   <figure><img src="https://2471407984-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F68cb0s9ce5UIUKWPuYs8%2Fuploads%2Fs0MBfbdft54Ghxp6Sd1D%2FScreenshot%20(261).png?alt=media&#x26;token=a972338c-0070-4f8c-9f77-ad93accaf05e" alt=""><figcaption><p><strong>Listener Rules</strong> page displaying Shared Load Balancer rules</p></figcaption></figure>

## Updating Target Group attributes

Update attributes for your defined Target Group.

1. In the DuploCloud portal, navigate to **Cloud Services** -> **Networking**.
2. Select the **Load Balancer** tab.
3. From the **Name** column, select the Load Balancer whose defined Target Group attributes you want to modify.
4. In the **Listeners** tab, in the appropriate **Target Group** row, click the **Actions** menu ( <img src="https://2471407984-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F68cb0s9ce5UIUKWPuYs8%2Fuploads%2FaQe5p7flz0LzZESyhTO4%2Fimage.png?alt=media&#x26;token=90762291-a295-4f1c-a32a-e84f2b7687ee" alt="" data-size="line"> ) and select **Update Target Group attributes**.

<figure><img src="https://2471407984-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F68cb0s9ce5UIUKWPuYs8%2Fuploads%2FuztgyyUpZ0GjH3SZTdDY%2Fupdate%20target%20group.png?alt=media&#x26;token=b9861acb-cee9-4fbb-a7fb-0f9ae61ab10f" alt=""><figcaption><p>The <strong>LB Listener</strong> menu with the <strong>Update Target Group attributes</strong> option highlighted.</p></figcaption></figure>

5. The **Update Target Group Attributes** pane displays.

<div align="left"><figure><img src="https://2471407984-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F68cb0s9ce5UIUKWPuYs8%2Fuploads%2FuOhVfM4O8aqTqXoN9SSV%2Fnot%20sticky%20new.png?alt=media&#x26;token=b22b60cf-5449-466a-b1be-f2f6d608a776" alt=""><figcaption><p>The <strong>Update Target Group Attributes</strong> pane</p></figcaption></figure></div>

5. Find the attribute you want to update in the **Attribute** column and update the associated value in the **Value** column.
6. Click **Update** to save the changes.

### Updating Target Group Attributes to enable stickiness

To enable stickiness, complete steps 1-5 for [Updating Target Group Attributes](#updating-target-group-attributes) above. On the **Update Target Group Attributes** pane, in the **Value** field for **stickiness.enabled**, enter **true**. Update additional stickiness attributes, if needed. Click **Update** to save the changes.

<div align="left"><figure><img src="https://2471407984-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F68cb0s9ce5UIUKWPuYs8%2Fuploads%2FnDkWYcynBJwdmWuGjrVb%2Fsmallest.png?alt=media&#x26;token=befda0f0-ad77-4f61-8106-2a270ecb5b65" alt=""><figcaption><p>The <strong>Update Target Group Attributes</strong> pane configured to enable stickiness.</p></figcaption></figure></div>

## Additional Load Balancer Settings

You can use the **Other Settings** card in the DuploCloud Portal to set the following features:

* WAF Web ACL
* Enable HTTP to HTTPS redirects
* Enable Access Logging
* Set Idle Timeout
* Drop invalid headers
* Delete Protection

1. In the DuploCloud Portal, navigate to **Kubernetes** -> **Services**. The **Services** page displays.
2. Select the Service to which your Load Balancer is attached from the **NAME** column.
3. Click the **Load Balancers** tab.
4. In the **Other Settings** card, click **Edit**.<br>

   <figure><img src="https://2471407984-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F68cb0s9ce5UIUKWPuYs8%2Fuploads%2F2xbuxPOdlFty48egrOUa%2FScreenshot%20(202).png?alt=media&#x26;token=15912d5e-230d-40e8-8363-582688f9139f" alt=""><figcaption><p><strong>Load Balancers</strong> tab with <strong>Other Settings</strong> card</p></figcaption></figure>
5. The **Other Load Balancer Settings** pane displays.<br>

   <div align="left"><figure><img src="https://2471407984-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F68cb0s9ce5UIUKWPuYs8%2Fuploads%2Fhx8au07vvvFmtaccEv46%2FScreenshot%20(68).png?alt=media&#x26;token=3887b3b5-0d94-4521-ab6c-35099e319f93" alt=""><figcaption><p>The <strong>Other Load Balancer Settings</strong> pane</p></figcaption></figure></div>
6. Configure the settings, as needed.
7. Click **Save**. The Load Balancer settings are updated.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.duplocloud.com/docs/automation-platform/overview/aws-services/load-balancers/eks-load-balancers.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
