Changes in KrakenD-CE
If you are an existing KrakenD user read "Migrating from KrakenD 1.x and 0.x.
What's new?
The most relevant additions and changes on KrakenD 2.0 are:
GraphQL
REST to GraphQL conversion, or direct consumption of GraphQL through the gateway. Use GraphQL to define new backend queries and expose them as regular REST endpoints to your clients, federate content. GraphQL documentation
New plugin types
The request/response plugin modifiers are two new types of Go plugins to directly modify requests and responses from and to backends, complementing the existing handler and client plugins. Users who are currently using custom logic in Lua scripts can boost its performance. Plugin modifier documentation
Configurable router flags
There are plenty of configurable router flags such as returning the gateway error to the client (e.g: a timeout), redirection options, automatic OPTIONS
, better ways get the real IP (including through Trusted Proxies), or removing entries from the logs such as hiding the /__health
endpoint. See all new router flags
More developer friendly
KrakenD has been always easy to configure, but we wanted to improve the logs and information available while developing:
- The
krakend check
command adds now multiple levels of debug verbosity and colors for easier understanding of the configuration - A new command
krakend check-plugin
lets you check your custom plugins for compatibility - We have shortened and classified all
extra_config
namespaces, for better comprehension and usage of the components. When there was a URL-like component such as"github_com/devopsfaith/krakend-cors"
now becomes acategory/functionality
such as"security/cors"
. - A new migration tool takes care of the transition from 0.x and 1.x to 2.x to make the process straightforward.
- Better logs with more context. All log lines have been rewritten, adding a prefix grouping them with more information, like which endpoint or backend raised the line of a specific component.
- Plugins with access to the logger: If you had custom plugins, now they can use the KrakenD logger to enrich your gateway output.
- Alpine-based Docker image: Docker image extending from Alpine, making it a very lightweight image and without dragging all the security issues of larger containers like Debian.
Async agents
Prior to this version, any KrakenD activity was preceeded by a call to the API. Now, KrakenD is able to listen queues and act as a consumer or a producer on its own, without requiring an end-user request. For instance, when KrakenD detects that a new message has entered a queue (many technologies supported) it can trigger a call to a backend of your choice.