Closed MarsForever closed 4 years ago
Hello @MarsForever, please note that you should post questions to https://discuss.konghq.com/c/kubernetes in the future; issues are reserved for bug reports.
The various kinds of plugin relations are created via annotations on other resources, as shown in the diagram at https://github.com/Kong/kubernetes-ingress-controller/blob/master/docs/concepts/custom-resources.md#kongplugin
Example configuration for the size limiting plugin can be found at https://docs.konghq.com/hub/kong-inc/request-size-limiting/#enabling-the-plugin-on-a-service. KongPlugin use the same format as the config block under the "Without a database" example.
Thanks for your answer. @rainest
My question is how to add request-size-limiting to services(route,consumer)
I try to add request-size-limiting to ingress's annotation Method 1
apiVersion: configuration.konghq.com/v1
kind: KongPlugin
metadata:
name: request-size-limiting
plugin: request-size-limiting
config:
allowed_playod_size: 1
size_unit: bytes
kubectl exec -it ingress-controll-xxx-xxx sh
{"next":null, "data":[]}
I tried the following url https://github.com/Kong/kubernetes-ingress-controller/blob/master/docs/guides/using-consumer-credential-resource.md
and I get datas, sorry i can't show the datas because of company's credentials
Method 2 I add the request size limiting to configmap yaml files and deployed it to ingress-controller-xxx-xxx's container proxy /etc/kong/kong.yml
{"next":null, "data":[]}
Can you share the resource you applied the plugin to? That's shown in the second example at https://github.com/Kong/kubernetes-ingress-controller/blob/master/docs/guides/using-consumer-credential-resource.md#add-authentication-to-the-service for an Ingress, but the same annotation can be used for Service or KongConsumer resources:
konghq.com/plugins: request-size-limiting
Closing this due to lack of activity. Please re-open if needed.
NOTE: GitHub issues are reserved for bug reports only. For anything else, please join the conversation in Kong Nation https://discuss.konghq.com/c/kubernetes.
Summary
How to use yaml file to create kong plugins for request limit size(databaseless).
Kong Ingress controller version 0.8
Kubernetes version
17.0.0
Environment
What happened
In kong 2.0. https://docs.konghq.com/hub/kong-inc/request-size-limiting/ There is three ways to limit request size route/service/consumer(user) default size: 128 MB