Skip to content

Commit

Permalink
docs(targetRef): added information about proxyTypes (#1605)
Browse files Browse the repository at this point in the history

Signed-off-by: Lukasz Dziedziak <[email protected]>
Co-authored-by: Bart Smykla <[email protected]>
  • Loading branch information
lukidzi and bartsmykla authored Jan 26, 2024
1 parent d54bb7a commit a5ed7c9
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions app/_src/policies/targetref.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,25 @@ Its goal is to select subsets of proxies with maximum flexibility.

It looks like:

{% if_version lte:2.5.x %}
```yaml
targetRef:
kind: Mesh | MeshSubset | MeshService | MeshServiceSubset | MeshGateway
name: "my-name" # For kinds MeshService, MeshServiceSubset and MeshGateway a name has to be defined
tags:
key: value # For kinds MeshServiceSubset, MeshSubset and MeshGateway a list of matching tags can be used
```
{% endif_version %}
{% if_version gte:2.6.x %}
```yaml
targetRef:
kind: Mesh | MeshSubset | MeshService | MeshServiceSubset | MeshGateway
name: "my-name" # For kinds MeshService, MeshServiceSubset and MeshGateway a name has to be defined
tags:
key: value # For kinds MeshServiceSubset, MeshSubset and MeshGateway a list of matching tags can be used
proxyTypes: ["Sidecar", "Gateway"] # For kinds Mesh and MeshSubset a list of matching Dataplanes types can be used
```
{% endif_version %}

Here's an explanation of each kinds and their scope:

Expand All @@ -145,6 +157,13 @@ Here's an explanation of each kinds and their scope:
- Note that it's very strongly recommended to target MeshGateway proxies using this
kind, as opposed to MeshService/MeshServiceSubset.

{% if_version gte:2.6.x %}
In {{site.mesh_product_name}} 2.6.x, the `targetRef` field gained the ability to select a specific subset of data plane proxies. To further refine policy enforcement, a new field named `proxyTypes` has been introduced. It allows you to target policies to specific types of data plane proxies:
- `Sidecar`: Targets data plane proxies acting as sidecars to applications.
- `Gateway`: Applies to data plane proxies operating in Gateway mode.
- Empty list: Defaults to targeting all data plane proxies.
{% endif_version %}

Consider the example below:

```yaml
Expand Down Expand Up @@ -378,3 +397,23 @@ spec:
All proxies in zone `east` (top level `targetRef`) will have this policy configured with `key=value`.

This can be very useful when observability stores are different for each zone for example.

{% if_version gte:2.6.x %}
#### Configuring all gateways in a Mesh

```yaml
type: ExamplePolicy
name: example
mesh: default
spec:
targetRef:
kind: Mesh
proxyTypes: ["Gateway"]
default:
key: value
```

All gateway proxies in mesh `default` will have this policy configured with `key=value`.

This can be very useful when timeout configurations for gateways need to differ from those of other proxies.
{% endif_version %}

0 comments on commit a5ed7c9

Please sign in to comment.