Skip to content

Commit

Permalink
Add classifier index to classifier ID
Browse files Browse the repository at this point in the history
  • Loading branch information
IridiumOxide committed Sep 6, 2022
1 parent 2e53903 commit f6269b2
Show file tree
Hide file tree
Showing 16 changed files with 299 additions and 243 deletions.
2 changes: 2 additions & 0 deletions api/aperture/common/config/v1/config_properties_wrapper.proto
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ message ClassifierWrapper {
string policy_name = 2;
// Hash of the entire Policy spec.
string policy_hash = 3;
// Index of the classifier within Policy.
int64 classifier_index = 4;
}

message ConcurrencyLimiterWrapper {
Expand Down
1 change: 1 addition & 0 deletions api/aperture/flowcontrol/v1/flowcontrol.proto
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,5 @@ message FluxMeter {
message Classifier {
string policy_name = 1;
string policy_hash = 2;
int64 classifier_index = 3;
}
45 changes: 12 additions & 33 deletions api/gen/openapiv2/aperture.swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -262,10 +262,13 @@ definitions:
[flow labels](/concepts/flow-control/label/label.md).
workload:
$ref: '#/definitions/SchedulerWorkload'
description: Workload associated with requests matching the label matcher.
description: Workload associated with flows matching the label matcher.
apertureflowcontrolv1Classifier:
type: object
properties:
classifier_index:
type: string
format: int64
policy_hash:
type: string
policy_name:
Expand Down Expand Up @@ -366,11 +369,18 @@ definitions:
type: object
additionalProperties:
$ref: '#/definitions/v1Rule'
description: A map of {key, value} pairs mapping from flow label names to rules that define how to extract and propagate them.
description: |-
A map of {key, value} pairs mapping from
[flow label](/concepts/flow-control/label/label.md) keys to rules that define
how to extract and propagate flow labels with that key.
selector:
$ref: '#/definitions/v1Selector'
description: Defines where to apply the flow classification rule.
description: |-
:::info
See also [Classifier overview](/concepts/flow-control/label/classifier.md).
:::
Example:
```yaml
selector:
Expand Down Expand Up @@ -687,37 +697,6 @@ definitions:
docs on how exactly it handles invalid inputs.
:::
title: Circuit is defined as a dataflow graph of inter-connected components
v1Classifier:
type: object
properties:
rules:
type: object
additionalProperties:
$ref: '#/definitions/v1Rule'
description: |-
A map of {key, value} pairs mapping from
[flow label](/concepts/flow-control/label/label.md) keys to rules that define
how to extract and propagate flow labels with that key.
selector:
$ref: '#/definitions/v1Selector'
description: Defines where to apply the flow classification rule.
description: |-
:::info
See also [Classifier overview](/concepts/flow-control/label/classifier.md).
:::
Example:
```yaml
selector:
service: service1.default.svc.cluster.local
control_point:
traffic: ingress
rules:
user:
extractor:
from: request.http.headers.user
```
title: Set of classification rules sharing a common selector
v1Component:
type: object
properties:
Expand Down

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

79 changes: 45 additions & 34 deletions api/gen/proto/go/aperture/flowcontrol/v1/flowcontrol.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

68 changes: 34 additions & 34 deletions docs/gen/policies/gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,39 @@ definitions:
x-go-validate: required
x-order: 5
$ref: '#/definitions/v1Selector'
policylanguagev1Classifier:
description: |-
:::info
See also [Classifier overview](/concepts/flow-control/label/classifier.md).
:::
Example:
```yaml
selector:
service: service1.default.svc.cluster.local
control_point:
traffic: ingress
rules:
user:
extractor:
from: request.http.headers.user
```
type: object
title: Set of classification rules sharing a common selector
properties:
rules:
description: |-
A map of {key, value} pairs mapping from
[flow label](/concepts/flow-control/label/label.md) keys to rules that define
how to extract and propagate flow labels with that key.
type: object
additionalProperties:
$ref: '#/definitions/v1Rule'
x-order: 0
selector:
description: Defines where to apply the flow classification rule.
x-order: 1
$ref: '#/definitions/v1Selector'
policylanguagev1FluxMeter:
description: |-
FluxMeter gathers metrics for the traffic that matches its selector.
Expand Down Expand Up @@ -341,39 +374,6 @@ definitions:
type: string
x-go-default: 0.5s
x-order: 1
v1Classifier:
description: |-
:::info
See also [Classifier overview](/concepts/flow-control/label/classifier.md).
:::
Example:
```yaml
selector:
service: service1.default.svc.cluster.local
control_point:
traffic: ingress
rules:
user:
extractor:
from: request.http.headers.user
```
type: object
title: Set of classification rules sharing a common selector
properties:
rules:
description: |-
A map of {key, value} pairs mapping from
[flow label](/concepts/flow-control/label/label.md) keys to rules that define
how to extract and propagate flow labels with that key.
type: object
additionalProperties:
$ref: '#/definitions/v1Rule'
x-order: 0
selector:
description: Defines where to apply the flow classification rule.
x-order: 1
$ref: '#/definitions/v1Selector'
v1Component:
description: |-
Signals flow into the components via input ports and results are emitted on output ports.
Expand Down Expand Up @@ -1263,7 +1263,7 @@ definitions:
The flow labels created by Classifiers can be matched by FluxMeters to create metrics for control purposes.
type: array
items:
$ref: '#/definitions/v1Classifier'
$ref: '#/definitions/policylanguagev1Classifier'
x-order: 0
flux_meters:
description: |-
Expand Down
Loading

0 comments on commit f6269b2

Please sign in to comment.