Skip to content
Open

Mkl #288

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
79 changes: 79 additions & 0 deletions input/kube-yaml/service-exposure.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,84 @@ For configuration details, see [Listener resource][listener-resource].
**📌 NOTE**
There must be a `MATCHING-CONNECTOR` for the service to operate.

<a id="kube-creating-multikeylistener-yaml"></a>
## Creating a multi-key listener using YAML
<!--PROCEDURE-->

A multi-key listener binds a single local host and port to multiple routing keys in remote sites.
Use a multi-key listener when you want one service endpoint to aggregate traffic from multiple connectors.

With multi-key listeners, you must choose a strategy which determines how the traffic is distributed:

* priority - Uses the first routing key in list that is available for traffic. If the connector becomes unavailable, the listener matches with the next available routing key in list.
* weighted - Uses the routing keys in proportion to the assigned weights. For example, if `backend1` is assigned 25 and `backend2` is assigned 75, then only a quarter of the TCP connections are directed to `backend1`.

Multi-key listeners provide predictable traffic distribution from the client side and are **not influenced by link costs**.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be too much detail, but as I understand it link costs do not affect the routing key a connection is routed to. Normal link cost + least connected rules apply within that routing key same as a Listener.


For configuration details, see [MultiKeyListener resource][multikeylistener-resource].

**Prerequisites**

* Multiple connectors created with different routing keys. See [Creating a connector using YAML](#kube-creating-connector-yaml).

**Procedure**

1. Identify the connectors that you want to aggregate.
Note the routing keys for each connector.

2. Determine which strategy is best for your use case. For example, failover is best achieved using the `priority` strategy.


3. Create a multi-key listener resource YAML file.
For example:
```yaml
apiVersion: skupper.io/v2alpha1
kind: MultiKeyListener
metadata:
name: mkl-backend
spec:
host: mkl-backend
port: 9092
strategy:
weighted:
routingKeys:
east-backend: 1
west-backend: 1
```
This creates a listener named `mkl-backend` that exposes a single endpoint on port 9092 and distributes traffic evenly across the `east-backend` and `west-backend` routing keys.

To prefer one routing key first and fall back to another, use the `priority` strategy:
```yaml
apiVersion: skupper.io/v2alpha1
kind: MultiKeyListener
metadata:
name: mkl-backend-priority
spec:
host: mkl-backend-priority
port: 9095
strategy:
priority:
routingKeys:
- east-backend-http
- west-backend-http
```

To create the multi-key listener resource:

```bash
kubectl apply -f <filename>
```

where `<filename>` is the name of a YAML file that is saved on your local filesystem.

4. Check the multi-key listener status:
```bash
kubectl get multikeylistener
```

**📌 NOTE**
If you need to change strategy after you created a multi-key listener, you must delete and recreate the resource. This does not affect changing routing keys or weights.

<a id="kube-creating-attachedconnector-yaml"></a>
## Creating a connector for a different namespace using YAML
<!--PROCEDURE-->
Expand Down Expand Up @@ -200,3 +278,4 @@ For configuration details, see [Connector resource][connector-resource].

[connector-resource]: https://skupperproject.github.io/refdog/resources/connector.html
[listener-resource]: https://skupperproject.github.io/refdog/resources/listener.html
[multikeylistener-resource]: https://skupperproject.github.io/refdog/resources/multi-key-listener.html
91 changes: 3 additions & 88 deletions input/refdog/commands/connector/create.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,51 +63,9 @@ help for create
</div>
<div class="attribute-body">

The hostname or IP address of the local connector
The hostname or IP address of the local connector (default "localhost") -r, --routing-key string The identifier used to route traffic from listeners to connectors



</div>
</div>

<div class="attribute">
<div class="attribute-heading">
<h3 id="option-include-not-ready">--include-not-ready</h3>
<div class="attribute-type-info">boolean</div>
</div>
<div class="attribute-body">

If true, include server pods that are not in the ready state. -r, --routing-key string The identifier used to route traffic from listeners to connectors



</div>
</div>

<div class="attribute">
<div class="attribute-heading">
<h3 id="option-selector">--selector</h3>
<div class="attribute-type-info">&lt;string&gt;</div>
</div>
<div class="attribute-body">

A Kubernetes label selector for specifying target server pods.



</div>
</div>

<div class="attribute">
<div class="attribute-heading">
<h3 id="option-timeout">--timeout</h3>
<div class="attribute-type-info">&lt;duration&gt;</div>
</div>
<div class="attribute-body">

raise an error if the operation does not complete in the given period of time (expressed in seconds). (default 1m0s)

<table class="fields"><tr><th>Default</th><td><p><code>1m0s</code></p>
<table class="fields"><tr><th>Default</th><td><p><code>&quot;localhost&quot;</code></p>
</td></table>

</div>
Expand All @@ -134,54 +92,11 @@ the name of a Kubernetes secret containing the generated or externally-supplied
</div>
<div class="attribute-body">

The connector type. Choices: [tcp]. (default "tcp")
The connector type. Choices: [tcp]. (default "tcp") ``` ``` -n, --namespace string Set the namespace -p, --platform string Set the platform type to use [kubernetes, podman, docker, linux] ```

<table class="fields"><tr><th>Default</th><td><p><code>&quot;tcp&quot;</code></p>
</td><tr><th>Choices</th><td><table class="choices"><tr><th><code>tcp</code></th><td></td></tr></table></td></table>

</div>
</div>

<div class="attribute">
<div class="attribute-heading">
<h3 id="option-wait">--wait</h3>
<div class="attribute-type-info">&lt;string&gt;</div>
</div>
<div class="attribute-body">

Wait for the given status before exiting. Choices: configured, ready, none (default "configured")

<table class="fields"><tr><th>Default</th><td><p><code>&quot;configured&quot;</code></p>
</td></table>

</div>
</div>

<div class="attribute">
<div class="attribute-heading">
<h3 id="option-workload">--workload</h3>
<div class="attribute-type-info">&lt;string&gt;</div>
</div>
<div class="attribute-body">

A Kubernetes resource name that identifies a workload expressed like resource-type/resource-name. Expected resource types: service, daemonset, deployment, and statefulset. ``` ``` -c, --context string Set the kubeconfig context



</div>
</div>

<div class="attribute">
<div class="attribute-heading">
<h3 id="option-kubeconfig">--kubeconfig</h3>
<div class="attribute-type-info">&lt;string&gt;</div>
</div>
<div class="attribute-body">

Path to the kubeconfig file to use -n, --namespace string Set the namespace -p, --platform string Set the platform type to use [kubernetes, podman, docker, linux] ```



</div>
</div>

Expand Down
16 changes: 1 addition & 15 deletions input/refdog/commands/connector/delete.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,25 +72,11 @@ raise an error if the operation does not complete in the given period of time (e
</div>
<div class="attribute-body">

Wait for deletion to complete before exiting (default true) ``` ``` -c, --context string Set the kubeconfig context
Wait for deletion to complete before exiting (default true) ``` ``` -n, --namespace string Set the namespace -p, --platform string Set the platform type to use [kubernetes, podman, docker, linux] ```

<table class="fields"><tr><th>Default</th><td><p><code>true</code></p>
</td></table>

</div>
</div>

<div class="attribute">
<div class="attribute-heading">
<h3 id="option-kubeconfig">--kubeconfig</h3>
<div class="attribute-type-info">&lt;string&gt;</div>
</div>
<div class="attribute-body">

Path to the kubeconfig file to use -n, --namespace string Set the namespace -p, --platform string Set the platform type to use [kubernetes, podman, docker, linux] ```



</div>
</div>

Expand Down
62 changes: 3 additions & 59 deletions input/refdog/commands/connector/generate.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,23 +66,9 @@ help for generate
</div>
<div class="attribute-body">

The hostname or IP address of the local connector
The hostname or IP address of the local connector (default "localhost") -o, --output string print resources to the console instead of submitting them to the Skupper controller. Choices: json, yaml (default "yaml")



</div>
</div>

<div class="attribute">
<div class="attribute-heading">
<h3 id="option-include-not-ready">--include-not-ready</h3>
<div class="attribute-type-info">boolean</div>
</div>
<div class="attribute-body">

If true, include server pods that are not in the ready state. -o, --output string print resources to the console instead of submitting them to the Skupper controller. Choices: json, yaml (default "yaml")

<table class="fields"><tr><th>Default</th><td><p><code>&quot;yaml&quot;</code></p>
<table class="fields"><tr><th>Default</th><td><p><code>&quot;localhost&quot;</code></p>
</td></table>

</div>
Expand All @@ -99,20 +85,6 @@ The identifier used to route traffic from listeners to connectors



</div>
</div>

<div class="attribute">
<div class="attribute-heading">
<h3 id="option-selector">--selector</h3>
<div class="attribute-type-info">&lt;string&gt;</div>
</div>
<div class="attribute-body">

A Kubernetes label selector for specifying target server pods.



</div>
</div>

Expand All @@ -137,39 +109,11 @@ the name of a Kubernetes secret containing the generated or externally-supplied
</div>
<div class="attribute-body">

The connector type. Choices: [tcp]. (default "tcp")
The connector type. Choices: [tcp]. (default "tcp") ``` ``` -n, --namespace string Set the namespace -p, --platform string Set the platform type to use [kubernetes, podman, docker, linux] ```

<table class="fields"><tr><th>Default</th><td><p><code>&quot;tcp&quot;</code></p>
</td><tr><th>Choices</th><td><table class="choices"><tr><th><code>tcp</code></th><td></td></tr></table></td></table>

</div>
</div>

<div class="attribute">
<div class="attribute-heading">
<h3 id="option-workload">--workload</h3>
<div class="attribute-type-info">&lt;string&gt;</div>
</div>
<div class="attribute-body">

A Kubernetes resource name that identifies a workload expressed like resource-type/resource-name. Expected resource types: service, daemonset, deployment, and statefulset. ``` ``` -c, --context string Set the kubeconfig context



</div>
</div>

<div class="attribute">
<div class="attribute-heading">
<h3 id="option-kubeconfig">--kubeconfig</h3>
<div class="attribute-type-info">&lt;string&gt;</div>
</div>
<div class="attribute-body">

Path to the kubeconfig file to use -n, --namespace string Set the namespace -p, --platform string Set the platform type to use [kubernetes, podman, docker, linux] ```



</div>
</div>

Expand Down
16 changes: 1 addition & 15 deletions input/refdog/commands/connector/status.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,21 +55,7 @@ Has matching listeners: 1
</div>
<div class="attribute-body">

help for status -o, --output string print status of connectors Choices: json, yaml ``` ``` -c, --context string Set the kubeconfig context



</div>
</div>

<div class="attribute">
<div class="attribute-heading">
<h3 id="option-kubeconfig">--kubeconfig</h3>
<div class="attribute-type-info">&lt;string&gt;</div>
</div>
<div class="attribute-body">

Path to the kubeconfig file to use -n, --namespace string Set the namespace -p, --platform string Set the platform type to use [kubernetes, podman, docker, linux] ```
help for status -o, --output string print status of connectors Choices: json, yaml ``` ``` -n, --namespace string Set the namespace -p, --platform string Set the platform type to use [kubernetes, podman, docker, linux] ```



Expand Down
Loading