krakend | Ultra performant API Gateway with middlewares | REST library
kandi X-RAY | krakend Summary
kandi X-RAY | krakend Summary
An open framework to assemble ultra performance API Gateways with middlewares; core service of the KrakenD API Gateway. Looking for the API gateway ready to use?. Site | Download | Build | Documentation | Blog.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of krakend
krakend Key Features
krakend Examples and Code Snippets
Community Discussions
Trending Discussions on krakend
QUESTION
I am using Consul as SD and while I am running multiple instances I want make gateway recognize them all to load balance. In case of hardcoded host for Krakend config everything works fine
I was going step by step with this: https://www.krakend.io/docs/backends/service-discovery/
Sending
dig @127.0.0.1 -p 8600 user-ms.service.consul SRV gives me response as well (on consul logs a also see that I've made a request)
But when I am making request via krakenD I am getting "no hosts available" and according to logs request wasn't send to consul
Here is a docker-compose file:
...ANSWER
Answered 2022-Mar-23 at 16:12when I am making request via krakenD I am getting "no hosts available" and according to logs request wasn't send to consul
The reason your request is failing is because Consul's DNS server listens on the non-standard port of 8600. Kraken does not appear to support configuring a custom DNS IP and non-standard port. It uses the underlying host's configured nameservers in /etc/resolv.conf
resolve SRV requests, and expects these IPs to be reachable over port 53.
The following is a Docker compose file that includes the following changes to allow Kraken to resolve DNS against Consul.
QUESTION
I have two endpoints and I want one of them to be accessible by requests from the localhost only. The other one should receive requests from anywhere. In the Security section of the documentation I found the next configuration:
...ANSWER
Answered 2022-Mar-15 at 09:50KrakenD Enterprise solves that for you. But if you are with the Community version, then you can use the Common Expression Language (CEL) component.
Although it's much more limited than IP filtering (Enterprise) itself, CEL allows you to write pre-conditions before your backends are actually hit.
An example that checks that a request is coming from localhost (IPv6):
QUESTION
ANSWER
Answered 2022-Mar-15 at 09:05KrakenD does not provide native support for Windows as it is too much effort for a product that is server based. Still, you can use KrakenD on Windows using Docker.
QUESTION
I am using krakend and local nodejs server.
As per : Using KrakenD with local nodejs server
I have created the krakend and nodejs server. It is up and Running and the communication between krakend and nodejs server is properly going on. But, the api response is JSON and while giving response krakend printing
...ANSWER
Answered 2022-Mar-15 at 03:44I am able to get it done via removing the flag
QUESTION
I am trying to enable the wildcard plugin on Krakend following the official documentation (https://www.krakend.io/docs/enterprise/endpoints/wildcard/). I am currently using the CE edition, someone knows if there is a similar plugin for this version? And where can I find the plugins available for it, since I was trying to check on /opt/krakend/plugins of official devopsfaith/krakend docker image but it is empty.
...ANSWER
Answered 2022-Jan-08 at 13:22the wildcard plugin is only available on the Enterprise edition. Check the link you passed that contains "enterprise" in the URL.
All functionalities of the community edition are already embedded in the final binary and there is no need to enable any plugins. Functionalities are activated by declaring its namespace in the extra_config. Plugins are used when you want to extend KrakenD functionalities with your own code. KrakenD Enterprise adds several functionalities through custom plugins, and others using middlewares.
QUESTION
I am using krakend version 1.4.0
docs say I can run generate commands to get OpenAPI, postman or config to graph.
when I try to run any of these commands. I get
Error: unknown command "generate" for "krakend"
do I need to do something differently to enable generate
commands? Heres a link for generator commands. https://www.krakend.io/docs/enterprise/commands/openapi/
ANSWER
Answered 2021-Dec-21 at 08:46You are passing a KrakenD Enterprise documentation link, but you are using the community Edition. There is no command generate on the free version as per 1.4.
QUESTION
Problem summary:
I have a k3s instance running on 192.168.23.231. Port 30001 is mapped to a REST API app I built. Port 31166 is mapped to Krakend. When I enter http://192.168.23.231:31166/datamanager/hello into my browser, I get an HTTP 500 error message stating "http://192.168.23.231 is currently unable to handle this request."
If I browse to http://192.168.23.231:30001/hello, I get "Hello World" as expected, so I know the REST API is running correctly. My expectation is the Krakend endpoint would return the same thing, but it does not.
Here is an excerpt from my krakend.json config file showing the end point configuration:
...ANSWER
Answered 2021-Dec-21 at 08:44The 500 error is the default status code when KrakenD is unable to process your backend response.
In the KrakenD configuration you are showing, we can see that you are telling KrakenD that the response from your backend (the encoding
) is a JSON object, but instead your backend returns a string Hello World
, which is not a JSON.
The KrakenD logs will show something like:
Error #01: invalid character 'H' looking for beginning of value
And that H
is from H
ello World.
If you'd like to consume strings instead of json use string
as the value of encoding
. If you want the response as is from your backend, use no-op
both in encoding
and output_encoding
QUESTION
I have a krakend configuration for endpoint as below
...ANSWER
Answered 2021-Dec-21 at 08:25It looks like your extra configuration is misplaced. The router rate limit goes inside the endpoint, not the backend. Use this:
QUESTION
I have a python program that fetches the client IP using request.client.host headers and Fast API.
This program is running on a kubernetes pod(ip-pod).
I have another Gateway API implemented using KrakenD and this runs on another pod in kubernetes cluster.
The Kubernetes yaml files for both(ip-pod and KrakenD) have the property externalTrafficPolicy: Local
I am unable to retrieve the real IP of the user and this could be because KrakenD is not allowing the real IP to reach to the ip-pod.
I have tested the program by exposing the ip-pod to the internet using type: LoadBalancer
and that way it gives the correct client IP. But when I use the KrakenD gateway, the IP is something different(private IP).
ANSWER
Answered 2021-Oct-06 at 13:58You can use the no-op with krakenD which will forward request to the backend
https://www.krakend.io/docs/endpoints/no-op/
you can check parameter forwarding config in your YAML of KrakenD also
QUESTION
I am fairly new and was building a microservice using nodejs. My problem is that my API gateway is throwing errors when I start my containers using docker compose. I can send request to my service containers directly and the API's are responding. But when I forward them via API gateway I am having problems. emphasized text
Following are my files in apiGateway directory: Docker file:
...ANSWER
Answered 2021-Sep-14 at 05:50You should put service names and service exposed ports (both defined in docker-comose.yml
) in api gateway endpoints configuration. For example, auth-service:4000
instead of localhost:4000
.
When you succeed to connect to localhost:4000
you connect to you docker host (your machine, vm) which routes the requests to container directly.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install krakend
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page