mirror of
https://github.com/fosrl/docs-v2.git
synced 2026-02-07 21:46:42 +00:00
Add new docs
T#
This commit is contained in:
BIN
images/targets_config.png
Normal file
BIN
images/targets_config.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 22 KiB |
@@ -13,6 +13,18 @@ Pangolin supports two blueprint formats:
|
|||||||
|
|
||||||
## YAML Configuration Format
|
## YAML Configuration Format
|
||||||
|
|
||||||
|
YAML config can be applied using the API or from a Newt site. _Application through a CLI tool is planned._
|
||||||
|
|
||||||
|
<Card title="Newt YAML">
|
||||||
|
|
||||||
|
Newt automatically discovers and applies blueprints defined in YAML format when passing the `--blueprint-file` argument. For example
|
||||||
|
|
||||||
|
```bash
|
||||||
|
newt --blueprint-file /path/to/blueprint.yaml <other-args>
|
||||||
|
```
|
||||||
|
|
||||||
|
</Card>
|
||||||
|
|
||||||
### Proxy Resources
|
### Proxy Resources
|
||||||
|
|
||||||
Proxy resources are used to expose HTTP, TCP, or UDP services through Pangolin. Below is an example configuration for proxy resources:
|
Proxy resources are used to expose HTTP, TCP, or UDP services through Pangolin. Below is an example configuration for proxy resources:
|
||||||
@@ -110,7 +122,7 @@ When using targets-only resources, the `name` and `protocol` fields are not requ
|
|||||||
|
|
||||||
### Client Resources
|
### Client Resources
|
||||||
|
|
||||||
Client resources are only accessible when connected via an Olm client:
|
Client resources define proxied resources accessible when connected via an Olm client:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
client-resources:
|
client-resources:
|
||||||
|
|||||||
@@ -54,29 +54,54 @@ newt --prefer-endpoint <specific-endpoint> <other-args>
|
|||||||
Pangolin currently does not load balance between nodes, only between targets on the same node.
|
Pangolin currently does not load balance between nodes, only between targets on the same node.
|
||||||
</Note>
|
</Note>
|
||||||
|
|
||||||
## Configuring Targets
|
## Path-Based Routing
|
||||||
|
|
||||||
<Steps>
|
Path-based routing allows you to direct traffic to different targets based on the request path. This enables sophisticated routing scenarios where different services can handle different parts of your application.
|
||||||
<Step title="Navigate to Resources">
|
|
||||||
In the Pangolin dashboard, go to the **Resources** section.
|
|
||||||
</Step>
|
|
||||||
|
|
||||||
<Step title="Create or Edit Resource">
|
### How Path-Based Routing Works
|
||||||
Either create a new resource or select an existing resource to edit.
|
|
||||||
</Step>
|
|
||||||
|
|
||||||
<Step title="Add Target">
|
Each target can be configured with optional path routing parameters:
|
||||||
Click **Add Target** to configure a new destination.
|
|
||||||
</Step>
|
|
||||||
|
|
||||||
<Step title="Configure Target Details">
|
- **Path**: The path pattern to match against incoming requests
|
||||||
Specify the target configuration:
|
- **Match**: The matching strategy to use when comparing the request path
|
||||||
- **Address**: IP address or hostname of the target service
|
|
||||||
- **Port**: Port number where the service is listening
|
|
||||||
- **Site**: Select the site where this target is located
|
|
||||||
</Step>
|
|
||||||
</Steps>
|
|
||||||
|
|
||||||
<Note>
|
When a request comes in, Pangolin evaluates the path against all targets and routes traffic to the target with the matching path configuration.
|
||||||
Pangolin uses round-robin load balancing by default, distributing traffic evenly across all targets.
|
|
||||||
</Note>
|
### Match Types
|
||||||
|
|
||||||
|
Pangolin supports three different matching strategies:
|
||||||
|
|
||||||
|
<Card title="Exact Match">
|
||||||
|
**exact**: The request path must match the configured path exactly.
|
||||||
|
|
||||||
|
Example: Path `/api/users` with exact match only matches `/api/users`
|
||||||
|
</Card>
|
||||||
|
|
||||||
|
<Card title="Prefix Match">
|
||||||
|
**prefix**: The request path must start with the configured path.
|
||||||
|
|
||||||
|
Example: Path `/api` with prefix match matches `/api/users`, `/api/orders`, `/api/users/123`, etc.
|
||||||
|
</Card>
|
||||||
|
|
||||||
|
<Card title="Regex Match">
|
||||||
|
**regex**: The request path is matched against a regular expression pattern.
|
||||||
|
|
||||||
|
Example: Path `^/api/users/[0-9]+$` with regex match matches `/api/users/123` but not `/api/users/abc`
|
||||||
|
</Card>
|
||||||
|
|
||||||
|
<Frame caption="Pangolin UI showing targets with path-based routing configuration">
|
||||||
|
<img src="/images/targets_config.png" alt="Targets example"/>
|
||||||
|
</Frame>
|
||||||
|
|
||||||
|
### Load Balancing with Path-Based Routing
|
||||||
|
|
||||||
|
When multiple targets have the same path and match configuration, Pangolin will load balance between them using round-robin distribution.
|
||||||
|
|
||||||
|
**Example Scenario:**
|
||||||
|
- Target 1: Path `/api`, Match `prefix`, Address `10.0.1.10:8080`
|
||||||
|
- Target 2: Path `/api`, Match `prefix`, Address `10.0.1.11:8080`
|
||||||
|
- Target 3: Path `/web`, Match `prefix`, Address `10.0.1.12:80`
|
||||||
|
|
||||||
|
In this configuration:
|
||||||
|
- Requests to `/api/users` will be load balanced between Target 1 and Target 2
|
||||||
|
- Requests to `/web/dashboard` will only go to Target 3
|
||||||
6
package-lock.json
generated
Normal file
6
package-lock.json
generated
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"name": "docs-v2",
|
||||||
|
"lockfileVersion": 3,
|
||||||
|
"requires": true,
|
||||||
|
"packages": {}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user