Skip to content

Commit

Permalink
Remove networkingRef from RateLimitPolicy (Kuadrant#86)
Browse files Browse the repository at this point in the history
* remove networkingRef from RateLimitPolicy

* fix lint errors

* update samples for RLP

* update sample RLP to include vhost level RateLimit
  • Loading branch information
rahulanand16nov authored Feb 16, 2022
1 parent 2464ad5 commit 9adfed3
Show file tree
Hide file tree
Showing 12 changed files with 410 additions and 245 deletions.
4 changes: 0 additions & 4 deletions apis/apim/v1alpha1/ratelimitpolicy_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,6 @@ type NetworkingRef struct {

// RateLimitPolicySpec defines the desired state of RateLimitPolicy
type RateLimitPolicySpec struct {
//+listType=map
//+listMapKey=type
//+listMapKey=name
NetworkingRef []NetworkingRef `json:"networkingRef,omitempty"`
// route specific staging and actions
//+listType=map
//+listMapKey=name
Expand Down
5 changes: 0 additions & 5 deletions apis/apim/v1alpha1/zz_generated.deepcopy.go

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

19 changes: 0 additions & 19 deletions config/crd/bases/apim.kuadrant.io_ratelimitpolicies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,25 +62,6 @@ spec:
- variables
type: object
type: array
networkingRef:
items:
properties:
name:
type: string
type:
enum:
- HTTPRoute
- VirtualService
type: string
required:
- name
- type
type: object
type: array
x-kubernetes-list-map-keys:
- type
- name
x-kubernetes-list-type: map
rateLimits:
description: RateLimits are used for all of the matching rules
items:
Expand Down
19 changes: 0 additions & 19 deletions config/deploy/manifests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -138,25 +138,6 @@ spec:
- variables
type: object
type: array
networkingRef:
items:
properties:
name:
type: string
type:
enum:
- HTTPRoute
- VirtualService
type: string
required:
- name
- type
type: object
type: array
x-kubernetes-list-map-keys:
- type
- name
x-kubernetes-list-type: map
rateLimits:
description: RateLimits are used for all of the matching rules
items:
Expand Down
50 changes: 34 additions & 16 deletions config/samples/apim_v1alpha1_ratelimitpolicy.yaml
Original file line number Diff line number Diff line change
@@ -1,30 +1,48 @@
---
apiVersion: apim.kuadrant.io/v1alpha1
kind: RateLimitPolicy
metadata:
name: ratelimitpolicy-sample
namespace: kuadrant-system
labels:
app: toystore
name: toystore
spec:
networkingRef:
- type: VirtualService
name: toystore
routes:
- name: get-toy
stage: BOTH
actions:
- generic_key:
descriptor_key: get
descriptor_value: "yes"
rateLimits:
- stage: BOTH
actions:
- generic_key:
descriptor_key: get-toy
descriptor_value: "yes"
- generic_key:
descriptor_key: other-get-toy
descriptor_value: "yes"
- name: add-toy
stage: POSTAUTH
rateLimits:
- stage: POSTAUTH
actions:
- generic_key:
descriptor_key: add-toy
descriptor_value: "yes"
- name: delete-toy
rateLimits:
- stage: PREAUTH
actions:
- generic_key:
descriptor_key: delete-toy
descriptor_value: "yes"
rateLimits:
- stage: PREAUTH
actions:
- generic_key:
descriptor_key: admin
descriptor_key: vhaction
descriptor_value: "yes"
limits:
- conditions: ["admin == yes"]
- conditions: ["get-toy == yes"]
max_value: 2
namespace: postauth
namespace: preauth
seconds: 15
variables: []
- condtitions: ["vhaction == yes"]
max_value: 4
namespace: preauth
seconds: 15
variables: []
Loading

0 comments on commit 9adfed3

Please sign in to comment.