Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GW Entity Targets #178

Merged
merged 9 commits into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions app/_gateway_entities/target.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
title: Targets
content_type: reference
description: A Target is an IP address/hostname with a port that identifies an instance of a backend service.

entities:
- target

Expand All @@ -11,21 +13,25 @@ tools:
- deck
- terraform

fabianrbz marked this conversation as resolved.
Show resolved Hide resolved
description: A target identifies a specific instance of an upstream service.
related_resources:
- text: Upstream entity
url: /gateway/entities/upstream/
- text: Route entity
url: /gateway/entities/route/

schema:
api: gateway/admin-ee
path: /schemas/Target

---

## What is a target?
## What is a Target?

{{page.description}}
{{page.description}} Each [Upstream](/gateway/entities/upstream/) can have many Targets. Targets are used by Upstreams for [load balancing](https://docs.konghq.com/gateway/latest/how-kong-works/load-balancing/). For example, if you have an `example_upstream` Upstream, you can point it to two different Targets: `httpbin.konghq.com` and `httpbun.com`. This is so that if one of the servers (like `httpbin.konghq.com`) is unavailable, it automatically detects the problem and routes all traffic to the working server (`httpbun.com`).

## Use cases for targets
The following diagram illustrates how Targets are used by Upstreams for load balancing:

The following are examples of common use cases for targets:
{% include entities/upstreams-targets-diagram.md %}

## Schema

Expand Down
13 changes: 13 additions & 0 deletions app/_includes/components/entity_example/format/ui.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,19 @@ The following creates a new service called **{{ include.presenter.data['name'] }
4. Configure your plugin. The configuration options will depend on which plugin you picked.
5. Click **Save**.
{% when 'target' %}
The following creates a new Upstream and a Target with basic configuration:

The following creates a new Upstream with basic configuration:

1. In Kong Manager or Gateway Manager, Navigate to **Workspaces** > **Upstreams**.
1. Click **New Upstream**.
1. Enter a unique name for the Upstream. For example: `{{ include.presenter.data['name'] }}`.
1. Click **Save**.
1. From your Upstream, select the **Targets** tab.
1. Click **New Target**.
1. Enter an IP address/hostname and port in the **Target Address** field, for example: `{{ include.presenter.data['target'] }}`
1. Update the weight for example: `{{ include.presenter.data['weight'] }}`.
1. Click **Save**.
{% when 'upstream' %}
The following creates a new Upstream with basic configuration:

Expand Down
Loading