-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(konnect): add support for konghq.com/plugins annotation on KongC…
…onsumers
- Loading branch information
Showing
13 changed files
with
743 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
85 changes: 85 additions & 0 deletions
85
config/samples/konnect-kongservice-kongroute-kongconsumer-plugin-annotated.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
kind: KonnectAPIAuthConfiguration | ||
apiVersion: konnect.konghq.com/v1alpha1 | ||
metadata: | ||
name: demo-auth | ||
namespace: default | ||
spec: | ||
type: token | ||
token: kpat_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX | ||
serverURL: eu.api.konghq.tech | ||
--- | ||
kind: KonnectGatewayControlPlane | ||
apiVersion: konnect.konghq.com/v1alpha1 | ||
metadata: | ||
name: demo-cp | ||
namespace: default | ||
spec: | ||
name: demo-cp | ||
labels: | ||
app: demo-cp | ||
key1: demo-cp | ||
konnect: | ||
authRef: | ||
name: demo-auth | ||
# namespace not required if APIAuthConfiguration is in the same namespace | ||
--- | ||
# This KongPlugin is bound to both the KongService, KongRoute and KongCon | ||
# hence it will create 2 KongPluginBinding with the following targets: | ||
# - KongService and KongConsumer | ||
# - KongRoute and KongConsumer | ||
apiVersion: configuration.konghq.com/v1 | ||
kind: KongPlugin | ||
metadata: | ||
name: rate-limit-5-min | ||
namespace: default | ||
config: | ||
minute: 5 | ||
policy: local | ||
plugin: rate-limiting | ||
--- | ||
kind: KongService | ||
apiVersion: configuration.konghq.com/v1alpha1 | ||
metadata: | ||
name: service-1 | ||
namespace: default | ||
annotations: | ||
konghq.com/plugins: rate-limit-5-min | ||
spec: | ||
name: service-1 | ||
host: example.com | ||
controlPlaneRef: | ||
type: konnectNamespacedRef | ||
konnectNamespacedRef: | ||
name: demo-cp | ||
--- | ||
kind: KongRoute | ||
apiVersion: configuration.konghq.com/v1alpha1 | ||
metadata: | ||
name: route-1 | ||
namespace: default | ||
annotations: | ||
konghq.com/plugins: rate-limit-5-min | ||
spec: | ||
name: route-1 | ||
protocols: | ||
- http | ||
hosts: | ||
- example.com | ||
serviceRef: | ||
type: namespacedRef | ||
namespacedRef: | ||
name: service-1 | ||
--- | ||
kind: KongConsumer | ||
apiVersion: configuration.konghq.com/v1 | ||
metadata: | ||
name: consumer-api-key-1 | ||
namespace: default | ||
annotations: | ||
konghq.com/plugins: rate-limit-5-min | ||
username: consumer1 | ||
spec: | ||
controlPlaneRef: | ||
type: konnectNamespacedRef | ||
konnectNamespacedRef: | ||
name: demo-cp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.