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

feat: add policy schema display #1289

Merged
merged 7 commits into from
May 2, 2023
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
2 changes: 2 additions & 0 deletions app/_layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@
</div>

<script async defer src="https://buttons.github.io/buttons.js"></script>
<script defer src="https://brianwendt.github.io/json-schema-md-doc/lib/JSONSchemaMarkdown.js"></script>
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/showdown/1.9.0/showdown.min.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.js"></script>
</body>
</html>
4 changes: 4 additions & 0 deletions app/_src/policies/meshaccesslog.md
Original file line number Diff line number Diff line change
Expand Up @@ -519,3 +519,7 @@ To target other non-mesh traffic, i.e. [passthrough traffic](/docs/{{ page.versi
## Select a built-in gateway

You can select a built-in gateway using the `kuma.io/service` value. A current limitation is that traffic routed from a gateway to a service is logged by that gateway as having destination `"*"`.

## All policy options

{% policy_schema MeshAccessLog %}
4 changes: 4 additions & 0 deletions app/_src/policies/meshcircuitbreaker.md
Original file line number Diff line number Diff line change
Expand Up @@ -579,3 +579,7 @@ spec:
We will apply the configuration with `kumactl apply -f [..]` or via the [HTTP API](/docs/{{ page.version }}/reference/http-api).
{% endtab %}
{% endtabs %}

## All policy options

{% policy_schema MeshCircuitBreaker %}
4 changes: 4 additions & 0 deletions app/_src/policies/meshfaultinjection.md
Original file line number Diff line number Diff line change
Expand Up @@ -261,3 +261,7 @@ Apply the configuration with `kumactl apply -f [..]` or with the [HTTP API](../.

{% endtab %}
{% endtabs %}

## All policy options

{% policy_schema MeshFaultInjection %}
4 changes: 4 additions & 0 deletions app/_src/policies/meshhealthcheck.md
Original file line number Diff line number Diff line change
Expand Up @@ -294,3 +294,7 @@ HTTP health checks are executed using HTTP2
- **`serviceName`** - (optional) - service name parameter which will be sent to gRPC service
- **`authority`** - (optional) - value of the :authority header in the gRPC health check request,
by default name of the cluster this health check is associated with

## All policy options

{% policy_schema MeshHealthCheck %}
4 changes: 4 additions & 0 deletions app/_src/policies/meshhttproute.md
Original file line number Diff line number Diff line change
Expand Up @@ -321,3 +321,7 @@ rules:
method: POST
default: merge(CONF_2, CONF_4) # because 'key-2' == 'key-4'
```

## All policy options

{% policy_schema MeshHTTPRoute %}
6 changes: 5 additions & 1 deletion app/_src/policies/meshloadbalancingstrategy.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,4 +236,8 @@ spec:
Apply the configuration with `kumactl apply -f [..]` or with the [HTTP API](../../reference/http-api).

{% endtab %}
{% endtabs %}
{% endtabs %}

## All policy options

{% policy_schema MeshLoadBalancingStrategy %}
3 changes: 3 additions & 0 deletions app/_src/policies/meshproxypatch.md
Original file line number Diff line number Diff line change
Expand Up @@ -1580,3 +1580,6 @@ spec:
{% endtab %}
{% endtabs %}

## All policy options

{% policy_schema MeshProxyPatch %}
4 changes: 4 additions & 0 deletions app/_src/policies/meshratelimit.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,3 +183,7 @@ spec:
We will apply the configuration with `kumactl apply -f [..]` or via the [HTTP API](/docs/{{ page.version }}/reference/http-api).
{% endtab %}
{% endtabs %}

## All policy options

{% policy_schema MeshRateLimit %}
4 changes: 4 additions & 0 deletions app/_src/policies/meshretry.md
Original file line number Diff line number Diff line change
Expand Up @@ -325,3 +325,7 @@ Apply the configuration with `kumactl apply -f [..]` or with the [HTTP API](../.

{% endtab %}
{% endtabs %}

## All policy options

{% policy_schema MeshRetry %}
6 changes: 5 additions & 1 deletion app/_src/policies/meshtimeout.md
Original file line number Diff line number Diff line change
Expand Up @@ -332,4 +332,8 @@ We will apply the configuration with `kumactl apply -f [..]` or via the [HTTP AP

{% if_version eq:2.1.x %}
If you don't specify `from` or `to` section defaults from [Timeout policy](../timeout) will be used. This is [known bug](https://github.com/kumahq/kuma/issues/5850) and will be fixed in the next version.
{% endif_version %}
{% endif_version %}

## All policy options

{% policy_schema MeshTimeout %}
4 changes: 4 additions & 0 deletions app/_src/policies/meshtrace.md
Original file line number Diff line number Diff line change
Expand Up @@ -554,3 +554,7 @@ spec:
```
{% endtab %}
{% endtabs %}

## All policy options

{% policy_schema MeshTrace %}
4 changes: 4 additions & 0 deletions app/_src/policies/meshtrafficpermission.md
Original file line number Diff line number Diff line change
Expand Up @@ -277,3 +277,7 @@ Order of rules inside the `from` array matters.
Request from the proxy that has both `kuma.io/zone: east` and `env: dev` will be denied.
This is because the rule with `Deny` is later in the `from` array than any `Allow` rules.
{% endtip %}

## All policy options

{% policy_schema MeshTrafficPermission %}
153 changes: 153 additions & 0 deletions app/docs/2.0.x/generated/DoNothingPolicy.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
{
michaelbeaumont marked this conversation as resolved.
Show resolved Hide resolved
"properties": {
"type": {
"description": "",
"type": "string",
"enum": [
"DoNothingPolicy"
]
},
"mesh": {
"description": "Mesh is the name of the Kuma mesh this resource belongs to. It may be omitted for cluster-scoped resources.",
"type": "string"
},
"name": {
"description": "Name of the Kuma resource",
"type": "string"
},
"from": {
"description": "From list makes a match between clients and corresponding configurations",
"items": {
"properties": {
"default": {
"description": "Default is a configuration specific to the group of clients referenced in 'targetRef'",
"properties": {
"enableDoNothing": {
"description": "User defined fields Set true in case of doing nothing",
"type": "boolean"
}
},
"type": "object"
},
"targetRef": {
"description": "TargetRef is a reference to the resource that represents a group of clients.",
"properties": {
"kind": {
"description": "Kind of the referenced resource",
"enum": [
"Mesh",
"MeshSubset",
"MeshService",
"MeshServiceSubset",
"MeshGatewayRoute"
],
"type": "string"
},
"mesh": {
"description": "Mesh is reserved for future use to identify cross mesh resources.",
"type": "string"
},
"name": {
"description": "Name of the referenced resource. Can only be used with kinds: `MeshService`, `MeshServiceSubset` and `MeshGatewayRoute`",
"type": "string"
},
"tags": {
"additionalProperties": {
"type": "string"
},
"description": "Tags used to select a subset of proxies by tags. Can only be used with kinds `MeshSubset` and `MeshServiceSubset`",
"type": "object"
}
},
"type": "object"
}
},
"type": "object"
},
"type": "array"
},
"targetRef": {
"description": "TargetRef is a reference to the resource the policy takes an effect on. The resource could be either a real store object or virtual resource defined inplace.",
"properties": {
"kind": {
"description": "Kind of the referenced resource",
"enum": [
"Mesh",
"MeshSubset",
"MeshService",
"MeshServiceSubset",
"MeshGatewayRoute"
],
"type": "string"
},
"mesh": {
"description": "Mesh is reserved for future use to identify cross mesh resources.",
"type": "string"
},
"name": {
"description": "Name of the referenced resource. Can only be used with kinds: `MeshService`, `MeshServiceSubset` and `MeshGatewayRoute`",
"type": "string"
},
"tags": {
"additionalProperties": {
"type": "string"
},
"description": "Tags used to select a subset of proxies by tags. Can only be used with kinds `MeshSubset` and `MeshServiceSubset`",
"type": "object"
}
},
"type": "object"
},
"to": {
"description": "To list makes a match between the consumed services and corresponding configurations",
"items": {
"properties": {
"default": {
"description": "Default is a configuration specific to the group of destinations referenced in 'targetRef'",
"properties": {
"enableDoNothing": {
"description": "User defined fields Set true in case of doing nothing",
"type": "boolean"
}
},
"type": "object"
},
"targetRef": {
"description": "TargetRef is a reference to the resource that represents a group of destinations.",
"properties": {
"kind": {
"description": "Kind of the referenced resource",
"enum": [
"Mesh",
"MeshSubset",
"MeshService",
"MeshServiceSubset",
"MeshGatewayRoute"
],
"type": "string"
},
"mesh": {
"description": "Mesh is reserved for future use to identify cross mesh resources.",
"type": "string"
},
"name": {
"description": "Name of the referenced resource. Can only be used with kinds: `MeshService`, `MeshServiceSubset` and `MeshGatewayRoute`",
"type": "string"
},
"tags": {
"additionalProperties": {
"type": "string"
},
"description": "Tags used to select a subset of proxies by tags. Can only be used with kinds `MeshSubset` and `MeshServiceSubset`",
"type": "object"
}
},
"type": "object"
}
},
"type": "object"
},
"type": "array"
}
}
}
Loading