Document updated on May 7, 2021
The krakend.json
file whether it is a single file or the result of using the flexible configuration, it might be a complex file. A generated image of the configuration might help you understand better the running configuration.
The config2dot generator will generate internally an intermediate DOT dile that you can render into a png
image with GraphViz or similar software.
The following image illustrates an example of a KrakenD configuration:
The command needed to generate a DOT file is krakend generate config2dot
:
$krakend generate config2dot -h
╓▄█ ▄▄▌ ╓██████▄µ
▐███ ▄███╨▐███▄██H╗██████▄ ║██▌ ,▄███╨ ▄██████▄ ▓██▌█████▄ ███▀╙╙▀▀███╕
▐███▄███▀ ▐█████▀"╙▀▀"╙▀███ ║███▄███┘ ███▀""▀███ ████▀╙▀███H ███ ╙███
▐██████▌ ▐███⌐ ,▄████████M║██████▄ ║██████████M███▌ ███H ███ ,███
▐███╨▀███µ ▐███ ███▌ ,███M║███╙▀███ ███▄```▄▄` ███▌ ███H ███,,,╓▄███▀
▐███ ╙███▄▐███ ╙█████████M║██▌ ╙███▄`▀███████╨ ███▌ ███H █████████▀
`` `'`
Version: 2.5.1
Generates a DOT graph from your KrakenD configuration.
Usage:
krakend generate config2dot [flags]
Examples:
krakend generate config2dot -c config.json -o config.dot
Flags:
-h, --help help for config2dot
Global Flags:
-c, --config string Path to the configuration filename
-d, --debug Enable the debug
-o, --out string Path to the generated result.")
Once you have generated the dot
file, you get a plain text content that is ready to be rendered by any software library that is capable of processing dot files. A good of example is Graphviz.
You can install Graphviz on Linux (Debian/Ubuntu) with the following command, but other distributions are similar:
$sudo apt-get install graphviz
On Mac:
$brew install graphviz
Or you can also add Graphviz to the official Enterprise Docker image (gets heavier):
RUN apk update
RUN apk add graphviz
Then you can generate the image with the following command:
$dot -Tpng graph.dot -o graph.png
The documentation is only a piece of the help you can get! Whether you are looking for Open Source or Enterprise support, see more support channels that can help you.
We use cookies to understand how you use our site and to improve your overall experience. By continuing to use our site, you accept our Privacy Policy. More information