From b8e91370fde20d8aefc0c7b8a1bdad301940d415 Mon Sep 17 00:00:00 2001 From: Angel Date: Wed, 18 Dec 2024 17:10:38 -0500 Subject: [PATCH 1/9] add targets --- app/_gateway_entities/target.md | 53 +++++++++++++++++++++++++++++---- 1 file changed, 48 insertions(+), 5 deletions(-) diff --git a/app/_gateway_entities/target.md b/app/_gateway_entities/target.md index d6805be19..f9255cd2f 100644 --- a/app/_gateway_entities/target.md +++ b/app/_gateway_entities/target.md @@ -11,7 +11,15 @@ tools: - deck - terraform -description: A target identifies a specific instance of an upstream service. +description: A Target is an IP address/hostname with a port that identifies an instance of a backend service. + +related_resources: + - text: Upstream entity + url: /gateway/entities/upstream/ + - text: Routing in {{site.base_gateway}} + url: /gateway/routing/ + - text: Proxying with {{site.base_gateway}} + url: /gateway/traffic-control/proxy/ schema: api: gateway/admin-ee @@ -19,14 +27,49 @@ schema: --- -## What is a target? +## What is a Target? + +{{page.description}} Each [Upstream](/gateway/entities/upstream/) can have many Targets. Targets are used by Upstreams for [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`). + +The following diagram illustrates how Targets are used by Upstreams for load balancing: + + -{{page.description}} +{% mermaid %} +flowchart LR + A("`Route + (/mock)`") + B("`Service + (example_service)`") + C(Load balancer) + D(httpbin.konghq.com) + E(httpbun.com) + + subgraph id1 ["`**KONG GATEWAY**`"] + A --> B --> C + end -## Use cases for targets + subgraph id2 ["`Targets (example_upstream)`"] + C --> D & E + end -The following are examples of common use cases for targets: + style id1 rx:10,ry:10 + style id2 stroke:none +{% endmermaid %} + + ## Schema {% entity_schema %} + +## Set up a Target + +{% entity_example %} +type: target +data: + - target: httpbun.com:80 + weight: 100 + - target: httpbin.konghq.com:80 + weight: 100 +{% endentity_example %} \ No newline at end of file From 2925e8f868f87e8afeb0eb053eab7a1991fd899b Mon Sep 17 00:00:00 2001 From: Angel Date: Wed, 18 Dec 2024 17:11:58 -0500 Subject: [PATCH 2/9] stray unusued link --- app/_gateway_entities/target.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/_gateway_entities/target.md b/app/_gateway_entities/target.md index f9255cd2f..959097cd9 100644 --- a/app/_gateway_entities/target.md +++ b/app/_gateway_entities/target.md @@ -29,7 +29,7 @@ schema: ## What is a Target? -{{page.description}} Each [Upstream](/gateway/entities/upstream/) can have many Targets. Targets are used by Upstreams for [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`). +{{page.description}} Each [Upstream](/gateway/entities/upstream/) can have many Targets. Targets are used by Upstreams for 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`). The following diagram illustrates how Targets are used by Upstreams for load balancing: From 30d511d34084aa81165ca092e0edecbca8dd8adf Mon Sep 17 00:00:00 2001 From: Lucie Milan Date: Thu, 19 Dec 2024 17:46:52 +0100 Subject: [PATCH 3/9] Update target.md --- app/_gateway_entities/target.md | 28 ++-------------------------- 1 file changed, 2 insertions(+), 26 deletions(-) diff --git a/app/_gateway_entities/target.md b/app/_gateway_entities/target.md index 959097cd9..bac440924 100644 --- a/app/_gateway_entities/target.md +++ b/app/_gateway_entities/target.md @@ -29,35 +29,11 @@ schema: ## What is a Target? -{{page.description}} Each [Upstream](/gateway/entities/upstream/) can have many Targets. Targets are used by Upstreams for 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`). +{{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`). The following diagram illustrates how Targets are used by Upstreams for load balancing: - - -{% mermaid %} -flowchart LR - A("`Route - (/mock)`") - B("`Service - (example_service)`") - C(Load balancer) - D(httpbin.konghq.com) - E(httpbun.com) - - subgraph id1 ["`**KONG GATEWAY**`"] - A --> B --> C - end - - subgraph id2 ["`Targets (example_upstream)`"] - C --> D & E - end - - style id1 rx:10,ry:10 - style id2 stroke:none -{% endmermaid %} - - +{% include entities/upstreams-targets-diagram.md %} ## Schema From 6a035ea311a0fc6b91b0bf13232ae86a48d20ddd Mon Sep 17 00:00:00 2001 From: Lucie Milan Date: Thu, 19 Dec 2024 17:56:09 +0100 Subject: [PATCH 4/9] add ui instructions for target --- .../components/entity_example/format/ui.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/app/_includes/components/entity_example/format/ui.md b/app/_includes/components/entity_example/format/ui.md index 4d9c97ae1..91f28cd34 100644 --- a/app/_includes/components/entity_example/format/ui.md +++ b/app/_includes/components/entity_example/format/ui.md @@ -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: + +1. In Kong Manager or Gateway Manager, click the Workspace you want to add the Upstream to. +1. Click **Upstreams** in the sidebar. +1. Click **New Upstream**. +1. Enter or select a host in the **Name** field. +1. Configure load balancing and health check settings as needed. +1. Click **Save**. +1. Click the **Targets** tab. +1. Click **New Target**. +1. Enter an IP address/hostname and port in the **Target Address** field. +1. Update the weight and add tags as needed. +1. Click **Save**. {% when 'upstream' %} The following creates a new Upstream with basic configuration: From 2e854044a9d899b4e9830474f6220da64d0f8e6f Mon Sep 17 00:00:00 2001 From: Lucie Milan Date: Thu, 19 Dec 2024 18:16:38 +0100 Subject: [PATCH 5/9] fixed entity example --- app/_gateway_entities/target.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/_gateway_entities/target.md b/app/_gateway_entities/target.md index bac440924..b4847ccd8 100644 --- a/app/_gateway_entities/target.md +++ b/app/_gateway_entities/target.md @@ -44,8 +44,6 @@ The following diagram illustrates how Targets are used by Upstreams for load bal {% entity_example %} type: target data: - - target: httpbun.com:80 - weight: 100 - - target: httpbin.konghq.com:80 - weight: 100 + target: httpbun.com:80 + weight: 100 {% endentity_example %} \ No newline at end of file From b7962987f7d9e899b2807a5c77b9739c911b5e12 Mon Sep 17 00:00:00 2001 From: Angel Date: Thu, 19 Dec 2024 13:46:59 -0500 Subject: [PATCH 6/9] targets --- .../components/entity_example/format/ui.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/_includes/components/entity_example/format/ui.md b/app/_includes/components/entity_example/format/ui.md index 91f28cd34..2eff7e2b3 100644 --- a/app/_includes/components/entity_example/format/ui.md +++ b/app/_includes/components/entity_example/format/ui.md @@ -44,16 +44,16 @@ The following creates a new service called **{{ include.presenter.data['name'] } {% when 'target' %} The following creates a new Upstream and a Target with basic configuration: -1. In Kong Manager or Gateway Manager, click the Workspace you want to add the Upstream to. -1. Click **Upstreams** in the sidebar. +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 or select a host in the **Name** field. -1. Configure load balancing and health check settings as needed. +1. Enter a unique name for the Upstream. For example: `{{ include.presenter.data['name'] }}`. 1. Click **Save**. -1. Click the **Targets** tab. +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. -1. Update the weight and add tags as needed. +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: From 43109cea2e0859c8649aca3400a9d6fc60506324 Mon Sep 17 00:00:00 2001 From: Fabian Rodriguez Date: Thu, 19 Dec 2024 20:12:55 +0100 Subject: [PATCH 7/9] Apply suggestions from code review Co-authored-by: Diana <75819066+cloudjumpercat@users.noreply.github.com> --- app/_gateway_entities/target.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/_gateway_entities/target.md b/app/_gateway_entities/target.md index b4847ccd8..dc7d77d8a 100644 --- a/app/_gateway_entities/target.md +++ b/app/_gateway_entities/target.md @@ -10,16 +10,16 @@ tools: - kic - deck - terraform +entities: + - target description: A Target is an IP address/hostname with a port that identifies an instance of a backend service. related_resources: - text: Upstream entity url: /gateway/entities/upstream/ - - text: Routing in {{site.base_gateway}} - url: /gateway/routing/ - - text: Proxying with {{site.base_gateway}} - url: /gateway/traffic-control/proxy/ + - text: Route entity + url: /gateway/entities/route/ schema: api: gateway/admin-ee From 173b8b235bbd247130907b8ffea5a93c7e93ede9 Mon Sep 17 00:00:00 2001 From: Fabian Rodriguez Date: Thu, 19 Dec 2024 16:59:26 -0300 Subject: [PATCH 8/9] Fix target's frontmatter --- app/_gateway_entities/target.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/_gateway_entities/target.md b/app/_gateway_entities/target.md index dc7d77d8a..6f36894eb 100644 --- a/app/_gateway_entities/target.md +++ b/app/_gateway_entities/target.md @@ -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 @@ -10,10 +12,6 @@ tools: - kic - deck - terraform -entities: - - target - -description: A Target is an IP address/hostname with a port that identifies an instance of a backend service. related_resources: - text: Upstream entity From 3bd8c1c8b448851d525e2a5a85958de1c05eae52 Mon Sep 17 00:00:00 2001 From: Fabian Rodriguez Date: Thu, 19 Dec 2024 18:16:29 -0300 Subject: [PATCH 9/9] Remove setup section from target --- app/_gateway_entities/target.md | 9 --------- 1 file changed, 9 deletions(-) diff --git a/app/_gateway_entities/target.md b/app/_gateway_entities/target.md index 6f36894eb..3c9149647 100644 --- a/app/_gateway_entities/target.md +++ b/app/_gateway_entities/target.md @@ -36,12 +36,3 @@ The following diagram illustrates how Targets are used by Upstreams for load bal ## Schema {% entity_schema %} - -## Set up a Target - -{% entity_example %} -type: target -data: - target: httpbun.com:80 - weight: 100 -{% endentity_example %} \ No newline at end of file